gem5
v21.0.0.0
|
A section. More...
#include <inifile.hh>
Public Member Functions | |
Section () | |
Constructor. More... | |
bool | isReferenced () |
Has this section been used? More... | |
void | addEntry (const std::string &entryName, const std::string &value, bool append) |
Add an entry to the table. More... | |
bool | add (const std::string &assignment) |
Add an entry to the table given a string assigment. More... | |
Entry * | findEntry (const std::string &entryName) const |
Find the entry with the given name. More... | |
bool | printUnreferenced (const std::string §ionName) |
Print the unreferenced entries in this section to cerr. More... | |
void | dump (const std::string §ionName) |
Print the contents of this section to cout (for debugging). More... | |
EntryTable::const_iterator | begin () const |
EntryTable::const_iterator | end () const |
Private Types | |
typedef std::unordered_map< std::string, Entry * > | EntryTable |
EntryTable type. Map of strings to Entry object pointers. More... | |
Private Attributes | |
EntryTable | table |
Table of entries. More... | |
bool | referenced |
Has this section been used? More... | |
A section.
Definition at line 91 of file inifile.hh.
|
private |
EntryTable type. Map of strings to Entry object pointers.
Definition at line 94 of file inifile.hh.
|
inline |
Constructor.
Definition at line 101 of file inifile.hh.
bool IniFile::Section::add | ( | const std::string & | assignment | ) |
Add an entry to the table given a string assigment.
Assignment should be of the form "param=value" or "param+=value" (for append). This funciton parses the assignment statment and calls addEntry().
True | for success, false if parse error. |
Definition at line 96 of file inifile.cc.
References eat_white(), and ArmISA::offset.
Referenced by IniFile::load().
void IniFile::Section::addEntry | ( | const std::string & | entryName, |
const std::string & | value, | ||
bool | append | ||
) |
Add an entry to the table.
If an entry with the same name already exists, the 'append' parameter is checked If true, the new value will be appended to the existing entry. If false, the new value will replace the existing entry.
Definition at line 74 of file inifile.cc.
References IniFile::table.
IniFile::Section::EntryTable::const_iterator IniFile::Section::begin | ( | ) | const |
Definition at line 349 of file inifile.cc.
References IniFile::table.
void IniFile::Section::dump | ( | const std::string & | sectionName | ) |
Print the contents of this section to cout (for debugging).
Definition at line 330 of file inifile.cc.
References IniFile::table.
IniFile::Section::EntryTable::const_iterator IniFile::Section::end | ( | ) | const |
Definition at line 355 of file inifile.cc.
References IniFile::table.
IniFile::Entry * IniFile::Section::findEntry | ( | const std::string & | entryName | ) | const |
Find the entry with the given name.
Pointer | to the entry object, or NULL if none. |
Definition at line 120 of file inifile.cc.
References IniFile::table.
Referenced by IniFile::entryExists(), IniFile::find(), and IniFile::printUnreferenced().
|
inline |
Has this section been used?
Definition at line 107 of file inifile.hh.
References referenced.
Referenced by IniFile::printUnreferenced().
bool IniFile::Section::printUnreferenced | ( | const std::string & | sectionName | ) |
Print the unreferenced entries in this section to cerr.
Messages can be suppressed using "unref_section_ok" and "unref_entries_ok".
sectionName | Name of this section, for use in output message. |
True | if any entries were printed. |
Definition at line 248 of file inifile.cc.
References IniFile::Entry::getValue(), IniFile::Entry::isReferenced(), IniFile::table, and tokenize().
Referenced by IniFile::printUnreferenced().
|
mutableprivate |
|
private |
Table of entries.
Definition at line 96 of file inifile.hh.