liblcf
|
#include <inireader.h>
Public Member Functions | |
INIReader (const std::string &filename) | |
INIReader (std::istream &filestream) | |
int | ParseError () const |
std::string | Get (const std::string §ion, const std::string &name, const std::string &default_value) const |
std::string | GetString (const std::string §ion, const std::string &name, const std::string &default_value) const |
long | GetInteger (const std::string §ion, const std::string &name, long default_value) const |
double | GetReal (const std::string §ion, const std::string &name, double default_value) const |
bool | GetBoolean (const std::string §ion, const std::string &name, bool default_value) const |
bool | HasValue (const std::string §ion, const std::string &name) const |
Static Private Member Functions | |
static std::string | MakeKey (const std::string §ion, const std::string &name) |
static int | ValueHandler (void *user, const char *section, const char *name, const char *value) |
Private Attributes | |
int | _error |
std::map< std::string, std::string > | _values |
Definition at line 40 of file inireader.h.
|
explicit |
Definition at line 42 of file inireader.cpp.
References _error, ini_parse(), and ValueHandler().
INIReader::INIReader | ( | std::istream & | filestream | ) |
Definition at line 47 of file inireader.cpp.
References _error, ini_parse_stream(), and ValueHandler().
string INIReader::Get | ( | const std::string & | section, |
const std::string & | name, | ||
const std::string & | default_value | ||
) | const |
Definition at line 103 of file inireader.cpp.
References _values, and MakeKey().
Referenced by GetBoolean(), ReaderUtil::GetEncoding(), GetInteger(), GetReal(), and GetString().
bool INIReader::GetBoolean | ( | const std::string & | section, |
const std::string & | name, | ||
bool | default_value | ||
) | const |
Definition at line 135 of file inireader.cpp.
References Get().
long INIReader::GetInteger | ( | const std::string & | section, |
const std::string & | name, | ||
long | default_value | ||
) | const |
Definition at line 116 of file inireader.cpp.
References Get().
double INIReader::GetReal | ( | const std::string & | section, |
const std::string & | name, | ||
double | default_value | ||
) | const |
Definition at line 126 of file inireader.cpp.
References Get().
string INIReader::GetString | ( | const std::string & | section, |
const std::string & | name, | ||
const std::string & | default_value | ||
) | const |
Definition at line 110 of file inireader.cpp.
References Get().
bool INIReader::HasValue | ( | const std::string & | section, |
const std::string & | name | ||
) | const |
Definition at line 148 of file inireader.cpp.
References _values, and MakeKey().
|
staticprivate |
Definition at line 154 of file inireader.cpp.
Referenced by Get(), HasValue(), and ValueHandler().
int INIReader::ParseError | ( | ) | const |
Definition at line 98 of file inireader.cpp.
References _error.
Referenced by ReaderUtil::GetEncoding().
|
staticprivate |
Definition at line 162 of file inireader.cpp.
References _values, and MakeKey().
Referenced by INIReader().
|
private |
Definition at line 83 of file inireader.h.
Referenced by INIReader(), and ParseError().
|
private |
Definition at line 84 of file inireader.h.
Referenced by Get(), HasValue(), and ValueHandler().