32 #ifndef __INIFILE_HH__ 33 #define __INIFILE_HH__ 38 #include <unordered_map> 69 : value(v), referenced(false)
96 typedef std::unordered_map<std::string, Entry *>
EntryTable;
104 : table(), referenced(false)
115 void addEntry(
const std::string &entryName,
const std::string &
value,
123 bool add(
const std::string &assignment);
127 Entry *findEntry(
const std::string &entryName)
const;
137 void dump(
const std::string §ionName);
167 bool load(std::istream &
f);
174 bool load(
const std::string &file);
179 bool add(
const std::string &
s);
184 bool find(
const std::string §ion,
const std::string &entry,
185 std::string &
value)
const;
191 const std::string &entry)
const;
211 #endif // __INIFILE_HH__
bool find(const std::string §ion, const std::string &entry, std::string &value) const
Find value corresponding to given section and entry names.
bool printUnreferenced()
Print unreferenced entries in object.
std::string value
The entry value.
std::unordered_map< std::string, Entry * > EntryTable
EntryTable type. Map of strings to Entry object pointers.
bool isReferenced()
Has this entry been used?
Section * addSection(const std::string §ionName)
Look up section with the given name, creating a new section if not found.
bool add(const std::string &s)
Take string of the form "<section>:<parameter>=<value>" or "<section>:<parameter>+=<value>" and add t...
bool referenced
Has this entry been used?
bool entryExists(const std::string §ion, const std::string &entry) const
Determine whether the entry exists within named section exists in the .ini file.
bool load(std::istream &f)
Load parameter settings from given istream.
static scfx_rep_node * list
const std::string & getValue() const
Fetch the value.
std::unordered_map< std::string, Section * > SectionTable
SectionTable type. Map of strings to Section object pointers.
void getSectionNames(std::vector< std::string > &list) const
Push all section names into the given vector.
SectionTable table
Hash of section names to Section object pointers.
bool referenced
Has this section been used?
EntryTable table
Table of entries.
bool isReferenced()
Has this section been used?
void appendValue(const std::string &v)
Append the given string to the value.
bool sectionExists(const std::string §ion) const
Determine whether the named section exists in the .ini file.
Entry(const std::string &v)
Constructor.
void setValue(const std::string &v)
Set the value.
void dump()
Dump contents to cout. For debugging.
This class represents the contents of a ".ini" file.
Section * findSection(const std::string §ionName) const
Look up section with the given name.