|
nsnake
Classic snake game for the terminal
|
Contains a "scope" of the INI file. More...
#include <INI.hpp>

Public Types | |
| typedef std::map< std::string, std::string > | ValueMap |
| typedef std::map< std::string, Level > | SectionMap |
| typedef std::list< ValueMap::const_iterator > | Values |
| typedef std::list< SectionMap::const_iterator > | Sections |
Public Member Functions | |
| Level () | |
| Create the topmost Level. | |
| Level (Level *p) | |
| Create a level with parent #p. | |
| const std::string & | operator[] (const std::string &name) |
| Access a key within this Level. | |
| Level & | operator() (const std::string &name) |
| Access another Level within this Level. | |
| void | addGroup (std::string name) |
| Creates a new child group with #name. | |
| void | addKey (std::string name, std::string value) |
| Creates a new key #name with #value. | |
Public Attributes | |
| Level * | parent |
| The parent Level of this one. | |
| size_t | depth |
| Counter of how many nested levels this one is. | |
| ValueMap | values |
| All the key values inside this Level. | |
| SectionMap | sections |
| All the Levels inside this Level. | |
| Values | ordered_values |
| All values in the original order of the INI file. | |
| Sections | ordered_sections |
| All Sections in the original order of the INI file. | |
Contains a "scope" of the INI file.
Suppose an INI file like this:
key=value [group] key=value [[group2]] key=value [[[group3]] key=value
We have four Levels, group, group2 and group3 and the top level, which contains all other levels.
You access keys with the [] operator and child groups with the () operator. So, for the example above:
parser.top()("group")("group2")("group3")["key"] == "value"
| typedef std::list<SectionMap::const_iterator> INI::Level::Sections |
| typedef std::map<std::string, std::string> INI::Level::ValueMap |
| typedef std::list<ValueMap::const_iterator> INI::Level::Values |
|
inline |
| void INI::Level::addGroup | ( | std::string | name | ) |
| void INI::Level::addKey | ( | std::string | name, |
| std::string | value ) |
|
inline |
|
inline |
| size_t INI::Level::depth |
| Sections INI::Level::ordered_sections |
| Values INI::Level::ordered_values |
| Level* INI::Level::parent |
| SectionMap INI::Level::sections |
| ValueMap INI::Level::values |