[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:
Alex King
2023-03-04 18:01:19 -05:00
committed by GitHub
parent be567af70d
commit 2a6cf8c8e7
261 changed files with 3178 additions and 3012 deletions
+8 -8
View File
@@ -1471,8 +1471,8 @@ void Raid::GetRaidDetails()
auto row = results.begin();
locked = atoi(row[0]);
LootType = atoi(row[1]);
locked = Strings::ToInt(row[0]);
LootType = Strings::ToInt(row[1]);
motd = std::string(row[2]);
}
@@ -1509,17 +1509,17 @@ bool Raid::LearnMembers()
members[index].member = nullptr;
strn0cpy(members[index].membername, row[0], 64);
int groupNum = atoi(row[1]);
int groupNum = Strings::ToInt(row[1]);
if(groupNum > 11)
members[index].GroupNumber = 0xFFFFFFFF;
else
members[index].GroupNumber = groupNum;
members[index]._class = atoi(row[2]);
members[index].level = atoi(row[3]);
members[index].IsGroupLeader = atoi(row[4]);
members[index].IsRaidLeader = atoi(row[5]);
members[index].IsLooter = atoi(row[6]);
members[index]._class = Strings::ToInt(row[2]);
members[index].level = Strings::ToInt(row[3]);
members[index].IsGroupLeader = Strings::ToInt(row[4]);
members[index].IsRaidLeader = Strings::ToInt(row[5]);
members[index].IsLooter = Strings::ToInt(row[6]);
++index;
}