mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 11:49:06 +00:00
Fix IniFile to use string& instead of char*
Also removes .c_str() usages where found.
This commit is contained in:
parent
079b1ba93d
commit
3fe05e0a9f
17 changed files with 205 additions and 218 deletions
|
@ -28,7 +28,7 @@ const u8* SettingsHandler::GetData() const
|
|||
return m_buffer;
|
||||
}
|
||||
|
||||
const std::string SettingsHandler::GetValue(const std::string key)
|
||||
const std::string SettingsHandler::GetValue(const std::string& key)
|
||||
{
|
||||
std::string delim = std::string("\r\n");
|
||||
std::string toFind = delim + key + "=";
|
||||
|
@ -79,20 +79,16 @@ void SettingsHandler::Reset()
|
|||
memset(m_buffer, 0, SETTINGS_SIZE);
|
||||
}
|
||||
|
||||
void SettingsHandler::AddSetting(const char *key, const char *value)
|
||||
void SettingsHandler::AddSetting(const std::string& key, const std::string& value)
|
||||
{
|
||||
while (*key != 0)
|
||||
{
|
||||
WriteByte(*key);
|
||||
key++;
|
||||
for(const char& c : key) {
|
||||
WriteByte(c);
|
||||
}
|
||||
|
||||
WriteByte('=');
|
||||
|
||||
while (*value != 0)
|
||||
{
|
||||
WriteByte(*value);
|
||||
value++;
|
||||
for(const char& c : value) {
|
||||
WriteByte(c);
|
||||
}
|
||||
|
||||
WriteByte(13);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue