gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::IniFile::Section Class Reference

A section. More...

#include <inifile.hh>

Public Member Functions

 Section ()
 Constructor.
 
bool isReferenced () const
 Has this section been used?
 
void addEntry (const std::string &entryName, const std::string &value, bool append)
 Add an entry to the table.
 
bool add (const std::string &assignment)
 Add an entry to the table given a string assigment.
 
EntryfindEntry (const std::string &entryName)
 Find the entry with the given name.
 
const EntryfindEntry (const std::string &entryName) const
 
bool printUnreferenced (const std::string &sectionName) const
 Print the unreferenced entries in this section to cerr.
 
void dump (const std::string &sectionName) const
 Print the contents of this section to cout (for debugging).
 
EntryTable::const_iterator begin () const
 
EntryTable::const_iterator end () const
 

Private Types

typedef std::unordered_map< std::string, EntryEntryTable
 EntryTable type. Map of strings to Entry object pointers.
 

Private Attributes

EntryTable table
 Table of entries.
 
bool referenced
 Has this section been used?
 

Detailed Description

A section.

Definition at line 94 of file inifile.hh.

Member Typedef Documentation

◆ EntryTable

typedef std::unordered_map<std::string, Entry> gem5::IniFile::Section::EntryTable
private

EntryTable type. Map of strings to Entry object pointers.

Definition at line 97 of file inifile.hh.

Constructor & Destructor Documentation

◆ Section()

gem5::IniFile::Section::Section ( )
inline

Constructor.

Definition at line 104 of file inifile.hh.

Member Function Documentation

◆ add()

bool gem5::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().

Return values
Truefor success, false if parse error.

Definition at line 88 of file inifile.cc.

References gem5::eat_white(), and gem5::ArmISA::offset.

Referenced by gem5::IniFile::load().

◆ addEntry()

void gem5::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 66 of file inifile.cc.

References gem5::IniFile::table.

◆ begin()

IniFile::Section::EntryTable::const_iterator gem5::IniFile::Section::begin ( ) const

Definition at line 339 of file inifile.cc.

References gem5::IniFile::table.

◆ dump()

void gem5::IniFile::Section::dump ( const std::string & sectionName) const

Print the contents of this section to cout (for debugging).

Definition at line 321 of file inifile.cc.

References gem5::IniFile::table.

◆ end()

IniFile::Section::EntryTable::const_iterator gem5::IniFile::Section::end ( ) const

Definition at line 345 of file inifile.cc.

References gem5::IniFile::table.

◆ findEntry() [1/2]

IniFile::Entry * gem5::IniFile::Section::findEntry ( const std::string & entryName)

Find the entry with the given name.

Return values
Pointerto the entry object, or NULL if none.

Definition at line 112 of file inifile.cc.

◆ findEntry() [2/2]

const IniFile::Entry * gem5::IniFile::Section::findEntry ( const std::string & entryName) const

Definition at line 119 of file inifile.cc.

References gem5::IniFile::table.

◆ isReferenced()

bool gem5::IniFile::Section::isReferenced ( ) const
inline

Has this section been used?

Definition at line 110 of file inifile.hh.

References referenced.

◆ printUnreferenced()

bool gem5::IniFile::Section::printUnreferenced ( const std::string & sectionName) const

Print the unreferenced entries in this section to cerr.

Messages can be suppressed using "unref_section_ok" and "unref_entries_ok".

Parameters
sectionNameName of this section, for use in output message.
Return values
Trueif any entries were printed.

Definition at line 243 of file inifile.cc.

References gem5::IniFile::table, and gem5::tokenize().

Member Data Documentation

◆ referenced

bool gem5::IniFile::Section::referenced
mutableprivate

Has this section been used?

Definition at line 100 of file inifile.hh.

Referenced by isReferenced().

◆ table

EntryTable gem5::IniFile::Section::table
private

Table of entries.

Definition at line 99 of file inifile.hh.


The documentation for this class was generated from the following files:

Generated on Tue Jun 18 2024 16:24:12 for gem5 by doxygen 1.11.0