mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-02 16:46: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:
@@ -53,7 +53,7 @@ void command_faction(Client *c, const Seperator *sep)
|
||||
uint32 found_count = 0;
|
||||
for (auto row : results) {
|
||||
uint32 faction_number = (found_count + 1);
|
||||
auto faction_id = std::stoul(row[0]);
|
||||
auto faction_id = Strings::ToUnsignedInt(row[0]);
|
||||
std::string faction_name = row[1];
|
||||
std::string faction_value = row[2];
|
||||
std::string reset_link = Saylink::Silent(
|
||||
@@ -107,7 +107,7 @@ void command_faction(Client *c, const Seperator *sep)
|
||||
)
|
||||
) {
|
||||
uint32 character_id = target->CharacterID();
|
||||
uint32 faction_id = std::stoul(faction_filter.c_str());
|
||||
uint32 faction_id = Strings::ToUnsignedInt(faction_filter.c_str());
|
||||
if (target->ReloadCharacterFaction(target, faction_id, character_id)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
|
||||
Reference in New Issue
Block a user