liblcf
INIReader Class Reference

#include <inireader.h>

+ Collaboration diagram for INIReader:

Public Member Functions

 INIReader (const std::string &filename)
 
 INIReader (std::istream &filestream)
 
int ParseError () const
 
std::string Get (const std::string &section, const std::string &name, const std::string &default_value) const
 
std::string GetString (const std::string &section, const std::string &name, const std::string &default_value) const
 
long GetInteger (const std::string &section, const std::string &name, long default_value) const
 
double GetReal (const std::string &section, const std::string &name, double default_value) const
 
bool GetBoolean (const std::string &section, const std::string &name, bool default_value) const
 
bool HasValue (const std::string &section, const std::string &name) const
 

Static Private Member Functions

static std::string MakeKey (const std::string &section, 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
 

Detailed Description

Definition at line 40 of file inireader.h.

Constructor & Destructor Documentation

◆ INIReader() [1/2]

INIReader::INIReader ( const std::string &  filename)
explicit

Definition at line 42 of file inireader.cpp.

References _error, ini_parse(), and ValueHandler().

+ Here is the call graph for this function:

◆ INIReader() [2/2]

INIReader::INIReader ( std::istream &  filestream)

Definition at line 47 of file inireader.cpp.

References _error, ini_parse_stream(), and ValueHandler().

+ Here is the call graph for this function:

Member Function Documentation

◆ Get()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetBoolean()

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().

+ Here is the call graph for this function:

◆ GetInteger()

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().

+ Here is the call graph for this function:

◆ GetReal()

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().

+ Here is the call graph for this function:

◆ GetString()

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().

+ Here is the call graph for this function:

◆ HasValue()

bool INIReader::HasValue ( const std::string &  section,
const std::string &  name 
) const

Definition at line 148 of file inireader.cpp.

References _values, and MakeKey().

+ Here is the call graph for this function:

◆ MakeKey()

string INIReader::MakeKey ( const std::string &  section,
const std::string &  name 
)
staticprivate

Definition at line 154 of file inireader.cpp.

Referenced by Get(), HasValue(), and ValueHandler().

+ Here is the caller graph for this function:

◆ ParseError()

int INIReader::ParseError ( ) const

Definition at line 98 of file inireader.cpp.

References _error.

Referenced by ReaderUtil::GetEncoding().

+ Here is the caller graph for this function:

◆ ValueHandler()

int INIReader::ValueHandler ( void *  user,
const char *  section,
const char *  name,
const char *  value 
)
staticprivate

Definition at line 162 of file inireader.cpp.

References _values, and MakeKey().

Referenced by INIReader().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _error

int INIReader::_error
private

Definition at line 83 of file inireader.h.

Referenced by INIReader(), and ParseError().

◆ _values

std::map<std::string, std::string> INIReader::_values
private

Definition at line 84 of file inireader.h.

Referenced by Get(), HasValue(), and ValueHandler().


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