mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-04 22:56:37 +00:00
[Strings] Add more number formatters (#2873)
* [Strings] Add more number formatters # Notes - Adds `Strings::ToUnsignedInt` for `uint32` support. - Adds `Strings::ToBigInt` for `int64` support. - Adds `Strings::ToUnsignedBigInt` for `uint64` support. - Adds `Strings::ToFloat` for `float` support. - Replaces all `std::stoi` references with `Strings::ToInt`. - Replaces all `atoi` references with `Strings::ToInt`. - Replaces all `std::stoul` references with `Strings::ToUnsignedInt`. - Replaces all `atoul` references with `Strings::ToUnsignedInt`. - Replaces all `std::stoll` references with `Strings::ToBigInt`. - Replaces all `atoll` references with `Strings::ToBigInt`. - Replaces all `std::stoull` references with `Strings::ToUnsignedBigInt`. - Replaces all `atoull` references with `Strings::ToUnsignedBigInt`. - Replaces all `std::stof` references with `Strings::ToFloat`. * [Strings] Add more number formatters - Adds `Strings::ToUnsignedInt` for `uint32` support. - Adds `Strings::ToBigInt` for `int64` support. - Adds `Strings::ToUnsignedBigInt` for `uint64` support. - Adds `Strings::ToFloat` for `float` support. - Replaces all `std::stoi` references with `Strings::ToInt`. - Replaces all `atoi` references with `Strings::ToInt`. - Replaces all `std::stoul` references with `Strings::ToUnsignedInt`. - Replaces all `atoul` references with `Strings::ToUnsignedInt`. - Replaces all `std::stoll` references with `Strings::ToBigInt`. - Replaces all `atoll` references with `Strings::ToBigInt`. - Replaces all `std::stoull` references with `Strings::ToUnsignedBigInt`. - Replaces all `atoull` references with `Strings::ToUnsignedBigInt`. - Replaces all `std::stof` references with `Strings::ToFloat`. * Rebase cleanup * Changes/benchmarks/tests --------- Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
@@ -97,8 +97,8 @@ void command_gearup(Client *c, const Seperator *sep)
|
||||
std::set<int> equipped;
|
||||
|
||||
for (auto row : results) {
|
||||
auto item_id = std::stoul(row[0]);
|
||||
auto slot_id = static_cast<uint16>(std::stoul(row[1]));
|
||||
auto item_id = Strings::ToUnsignedInt(row[0]);
|
||||
auto slot_id = static_cast<uint16>(Strings::ToUnsignedInt(row[1]));
|
||||
|
||||
if (equipped.find(slot_id) != equipped.end()) {
|
||||
if (slot_id == EQ::invslot::slotEar1) {
|
||||
@@ -178,7 +178,7 @@ void command_gearup(Client *c, const Seperator *sep)
|
||||
c->Message(Chat::White, "Choose Armor by Expansion:");
|
||||
std::string message;
|
||||
for (auto row : results) {
|
||||
const auto expansion = std::stoi(row[0]);
|
||||
const auto expansion = Strings::ToInt(row[0]);
|
||||
message += fmt::format(
|
||||
"[{}] ",
|
||||
Saylink::Silent(
|
||||
|
||||
Reference in New Issue
Block a user