Go to the documentation of this file.
29 #ifndef __INIFILE_HH__
30 #define __INIFILE_HH__
35 #include <unordered_map>
93 typedef std::unordered_map<std::string, Entry *>
EntryTable;
112 void addEntry(
const std::string &entryName,
const std::string &value,
120 bool add(
const std::string &assignment);
134 void dump(
const std::string §ionName);
164 bool load(std::istream &
f);
171 bool load(
const std::string &file);
176 bool add(
const std::string &
s);
181 bool find(
const std::string §ion,
const std::string &entry,
182 std::string &value)
const;
188 const std::string &entry)
const;
208 #endif // __INIFILE_HH__
bool printUnreferenced()
Print unreferenced entries in object.
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.
void addEntry(const std::string &entryName, const std::string &value, bool append)
Add an entry to the table.
bool find(const std::string §ion, const std::string &entry, std::string &value) const
Find value corresponding to given section and entry names.
This class represents the contents of a ".ini" file.
static scfx_rep_node * list
void appendValue(const std::string &v)
Append the given string to the value.
bool entryExists(const std::string §ion, const std::string &entry) const
Determine whether the entry exists within named section exists in the .ini file.
Entry(const std::string &v)
Constructor.
void dump(const std::string §ionName)
Print the contents of this section to cout (for debugging).
bool add(const std::string &s)
Take string of the form "<section>:<parameter>=<value>" or "<section>:<parameter>+=<value>" and add t...
void setValue(const std::string &v)
Set the value.
bool add(const std::string &assignment)
Add an entry to the table given a string assigment.
Entry * findEntry(const std::string &entryName) const
Find the entry with the given name.
EntryTable table
Table of entries.
bool referenced
Has this section been used?
std::unordered_map< std::string, Entry * > EntryTable
EntryTable type. Map of strings to Entry object pointers.
bool printUnreferenced(const std::string §ionName)
Print the unreferenced entries in this section to cerr.
Section * addSection(const std::string §ionName)
Look up section with the given name, creating a new section if not found.
std::string value
The entry value.
SectionTable table
Hash of section names to Section object pointers.
bool referenced
Has this entry been used?
bool isReferenced()
Has this entry been used?
bool load(std::istream &f)
Load parameter settings from given istream.
Section * findSection(const std::string §ionName) const
Look up section with the given name.
bool isReferenced()
Has this section been used?
bool sectionExists(const std::string §ion) const
Determine whether the named section exists in the .ini file.
const std::string & getValue() const
Fetch the value.
void dump()
Dump contents to cout. For debugging.
Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17