irccd
3.0.3
|
Namespace for ini related classes. More...
Classes | |
class | document |
Ini document description. More... | |
class | exception |
exception in a file. More... | |
class | option |
option definition. More... | |
class | section |
Section that contains one or more options. More... | |
class | token |
Describe a token read in the .ini source. More... | |
Typedefs | |
using | tokens = std::vector< token > |
Functions | |
auto | analyse (std::istreambuf_iterator< char > it, std::istreambuf_iterator< char > end) -> tokens |
auto | analyse (std::istream &stream) -> tokens |
auto | parse (const tokens &tokens, const std::string &path=".") -> document |
auto | read_file (const std::string &filename) -> document |
auto | read_string (const std::string &buffer) -> document |
void | dump (const tokens &tokens) |
Namespace for ini related classes.
using irccd::ini::tokens = typedef std::vector<token> |
List of tokens in order they are analyzed.
auto irccd::ini::analyse | ( | std::istream & | stream | ) | -> tokens |
Overloaded function for stream.
stream | the stream |
exception | on errors |
auto irccd::ini::analyse | ( | std::istreambuf_iterator< char > | it, |
std::istreambuf_iterator< char > | end | ||
) | -> tokens |
Analyse a stream and detect potential syntax errors. This does not parse the file like including other files in include statement.
It does only analysis, for example if an option is defined under no section, this does not trigger an exception while it's invalid.
it | the iterator |
end | where to stop |
exception | on errors |
void irccd::ini::dump | ( | const tokens & | tokens | ) |
Show all tokens and their description.
tokens | the tokens |
Parse the produced tokens.
tokens | the tokens |
path | the parent path |
exception | on errors |
auto irccd::ini::read_file | ( | const std::string & | filename | ) | -> document |
Parse a file.
filename | the file name |
exception | on errors |
auto irccd::ini::read_string | ( | const std::string & | buffer | ) | -> document |
Parse a string.
If the string contains include statements, they are relative to the current working directory.
buffer | the buffer |
exception | on exceptions |