diff options
| author | Tillmann Karras <tilkax@gmail.com> | 2014-03-15 03:29:53 +0100 |
|---|---|---|
| committer | Tillmann Karras <tilkax@gmail.com> | 2014-03-17 02:55:57 +0100 |
| commit | fa3cc057530570ba4113e022b3f44c2483a87684 (patch) | |
| tree | 346ce646a11c31b659b084cb9510ce5e03e357ba /Source/Core/Common/IniFile.cpp | |
| parent | 7e39cf3b0d1bd41f830c8afe792bd0f2d9c8f2a6 (diff) | |
Turn some non-const refs into pointers
Diffstat (limited to 'Source/Core/Common/IniFile.cpp')
| -rw-r--r-- | Source/Core/Common/IniFile.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp index 5fb5ce1e38..f830fd6b45 100644 --- a/Source/Core/Common/IniFile.cpp +++ b/Source/Core/Common/IniFile.cpp @@ -114,7 +114,7 @@ bool IniFile::Section::Get(const std::string& key, std::string* value, const std return false; } -bool IniFile::Section::Get(const std::string& key, std::vector<std::string>& out) +bool IniFile::Section::Get(const std::string& key, std::vector<std::string>* out) { std::string temp; bool retval = Get(key, &temp); @@ -132,7 +132,7 @@ bool IniFile::Section::Get(const std::string& key, std::vector<std::string>& out size_t subEnd = temp.find_first_of(",", subStart); if (subStart != subEnd) // take from first char until next , - out.push_back(StripSpaces(temp.substr(subStart, subEnd - subStart))); + out->push_back(StripSpaces(temp.substr(subStart, subEnd - subStart))); // Find the next non , char subStart = temp.find_first_not_of(",", subEnd); } @@ -273,23 +273,25 @@ bool IniFile::DeleteKey(const std::string& sectionName, const std::string& key) } // Return a list of all keys in a section -bool IniFile::GetKeys(const std::string& sectionName, std::vector<std::string>& keys) const +bool IniFile::GetKeys(const std::string& sectionName, std::vector<std::string>* keys) const { const Section* section = GetSection(sectionName); if (!section) + { return false; - keys = section->keys_order; + } + *keys = section->keys_order; return true; } // Return a list of all lines in a section -bool IniFile::GetLines(const std::string& sectionName, std::vector<std::string>& lines, const bool remove_comments) const +bool IniFile::GetLines(const std::string& sectionName, std::vector<std::string>* lines, const bool remove_comments) const { const Section* section = GetSection(sectionName); if (!section) return false; - lines.clear(); + lines->clear(); for (std::string line : section->lines) { line = StripSpaces(line); @@ -308,7 +310,7 @@ bool IniFile::GetLines(const std::string& sectionName, std::vector<std::string>& } } - lines.push_back(line); + lines->push_back(line); } return true; @@ -426,7 +428,7 @@ bool IniFile::Save(const std::string& filename) return File::RenameSync(temp, filename); } -bool IniFile::Get(const std::string& sectionName, const std::string& key, std::vector<std::string>& values) +bool IniFile::Get(const std::string& sectionName, const std::string& key, std::vector<std::string>* values) { Section *section = GetSection(sectionName); if (!section) |
