From fa3cc057530570ba4113e022b3f44c2483a87684 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sat, 15 Mar 2014 03:29:53 +0100 Subject: Turn some non-const refs into pointers --- Source/Core/Common/IniFile.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'Source/Core/Common/IniFile.cpp') 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& out) +bool IniFile::Section::Get(const std::string& key, std::vector* out) { std::string temp; bool retval = Get(key, &temp); @@ -132,7 +132,7 @@ bool IniFile::Section::Get(const std::string& key, std::vector& 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& keys) const +bool IniFile::GetKeys(const std::string& sectionName, std::vector* 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& lines, const bool remove_comments) const +bool IniFile::GetLines(const std::string& sectionName, std::vector* 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& } } - 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& values) +bool IniFile::Get(const std::string& sectionName, const std::string& key, std::vector* values) { Section *section = GetSection(sectionName); if (!section) -- cgit v1.2.3