base: Add getSectionNames to IniFile
Add an accessor to IniFile to list all the sections in the file.
This commit is contained in:
@@ -280,6 +280,16 @@ IniFile::Section::printUnreferenced(const string §ionName)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IniFile::getSectionNames(vector<string> &list) const
|
||||
{
|
||||
for (SectionTable::const_iterator i = table.begin();
|
||||
i != table.end(); ++i)
|
||||
{
|
||||
list.push_back((*i).first);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
IniFile::printUnreferenced()
|
||||
{
|
||||
|
||||
@@ -192,6 +192,9 @@ class IniFile
|
||||
/// @return True if the section exists.
|
||||
bool sectionExists(const std::string §ion) const;
|
||||
|
||||
/// Push all section names into the given vector
|
||||
void getSectionNames(std::vector<std::string> &list) const;
|
||||
|
||||
/// Print unreferenced entries in object. Iteratively calls
|
||||
/// printUnreferend() on all the constituent sections.
|
||||
bool printUnreferenced();
|
||||
|
||||
Reference in New Issue
Block a user