base: Add getSectionNames to IniFile
Add an accessor to IniFile to list all the sections in the file.
This commit is contained in:
parent
e553ca67d4
commit
b2c2e67468
2 changed files with 13 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue