added float parse support .

This commit is contained in:
Zero Fanker 2024-04-05 00:20:16 -04:00
parent d4a58864ff
commit 7d80e89afb
3 changed files with 112 additions and 77 deletions

View file

@ -108,6 +108,10 @@ public:
return INIHelper::StringToInteger(this->GetString(key), def);
}
float GetFloat(const CString& key, float def = 0.0) const {
return INIHelper::StringToFloat(this->GetString(key), def);
}
bool GetBool(const CString& key, bool def = false) const {
auto const& str = this->GetString(key);
return INIHelper::StringToBool(str, def);
@ -310,6 +314,9 @@ public:
void SetBool(const CString& section, const CString& key, const bool value) {
this->SetString(section, key, INIHelper::ToString(value));
}
void SetInteger(const CString& section, const CString& key, const bool value) {
this->SetString(section, key, INIHelper::ToString(value));
}
void RemoveValueByKey(const CString& section, const CString& key) {
if (auto pSec = this->TryGetSection(section)) {