[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
@@ -195,7 +195,7 @@ void MainFrame::OnRewardButton(wxCommandEvent& event)
{
wxString ridStr = mRewardID->GetValue();
int rtype = mRewardMethod->GetCurrentSelection();
int rid = atoi(ridStr.mb_str());
int rid = Strings::ToInt(ridStr.mb_str());
ShowRewardChange(rtype,rid);
}
@@ -224,15 +224,15 @@ void MainFrame::SaveTask(wxCommandEvent& event)
getStr.Clear();
getStr = mTaskMinLvl->GetValue();
ourTask.level_min = atoi(getStr.mb_str());
ourTask.level_min = Strings::ToInt(getStr.mb_str());
getStr.Clear();
getStr = mTaskMaxLvl->GetValue();
ourTask.level_max = atoi(getStr.mb_str());
ourTask.level_max = Strings::ToInt(getStr.mb_str());
getStr.Clear();
getStr = mTaskDuration->GetValue();
ourTask.duration = atoi(getStr.mb_str());
ourTask.duration = Strings::ToInt(getStr.mb_str());
getStr.Clear();
getStr = mRewardName->GetValue();
@@ -240,15 +240,15 @@ void MainFrame::SaveTask(wxCommandEvent& event)
getStr.Clear();
getStr = mRewardID->GetValue();
ourTask.rewardid = atoi(getStr.mb_str());
ourTask.rewardid = Strings::ToInt(getStr.mb_str());
getStr.Clear();
getStr = mRewardCash->GetValue();
ourTask.cashreward = atoi(getStr.mb_str());
ourTask.cashreward = Strings::ToInt(getStr.mb_str());
getStr.Clear();
getStr = mRewardXP->GetValue();
ourTask.xpreward = atoi(getStr.mb_str());
ourTask.xpreward = Strings::ToInt(getStr.mb_str());
getStr.Clear();
int * i = (int*)mStartZone->GetClientData(mStartZone->GetSelection());
@@ -325,4 +325,4 @@ void MainFrame::ContextMenuTaskList()
PopupMenu(mMenu);
delete mMenu;
}
}