nsnake
Classic snake game for the terminal
Public Member Functions | List of all members
INI::Parser Class Reference

Loads, reads and parses the contents of an INI file (or string). More...

#include <INI.hpp>

Public Member Functions

 Parser ()
 Creates a blank new INI file. More...
 
 Parser (std::string filename)
 Load and parse #filename.
 
 Parser (std::istream &stream)
 Parse a stream. More...
 
void dump (std::ostream &stream)
 Outputs the contents of the INI file to #stream. More...
 
Leveltop ()
 Returns the top level of this INI file. More...
 
const std::string & operator[] (const std::string &name)
 Shortcut to access a key within the top level.
 
Leveloperator() (const std::string &name)
 Shortcut to access a Level within the top level.
 
void create ()
 Creates a blank INI registry. More...
 
void saveAs (std::string filename)
 Save all the internal INI contents on a file with #filename.
 

Detailed Description

Loads, reads and parses the contents of an INI file (or string).

Definition at line 156 of file INI.hpp.

Constructor & Destructor Documentation

INI::Parser::Parser ( )

Creates a blank new INI file.

See also
Parser::create()

Definition at line 55 of file INI.cpp.

INI::Parser::Parser ( std::istream &  stream)

Parse a stream.

It can be used to parse strings from memory.

Definition at line 72 of file INI.cpp.

Member Function Documentation

void INI::Parser::create ( )

Creates a blank INI registry.

It resets itself, allowing you to create brand new INI files from scratch.

See also
Level::addKey()
level::addGroup()
Note
It drops everything that may already have been loaded.

Definition at line 215 of file INI.cpp.

void INI::Parser::dump ( std::ostream &  stream)

Outputs the contents of the INI file to #stream.

It dumps a valid INI file, according to this parsers modifications.

Definition at line 84 of file INI.cpp.

INI::Level & INI::Parser::top ( )

Returns the top level of this INI file.

You can then access all it's keys and nested groups with the Level methods.

See also
Level

Definition at line 79 of file INI.cpp.


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