INIFile Class Reference

#include <INIFile.h>

List of all members.

Public Member Functions

 INIFile ()
 INIFile (std::string fname, Pentagram::istring root)
 ~INIFile ()
bool readConfigFile (std::string fname)
bool readConfigString (std::string s)
void clear (Pentagram::istring root)
std::string dump ()
void write ()
void setReadonly ()
bool isReadonly () const
bool hasSection (Pentagram::istring section)
bool hasKey (Pentagram::istring key)
bool checkRoot (Pentagram::istring key)
bool value (Pentagram::istring key, std::string &ret)
bool value (Pentagram::istring key, int &ret)
bool value (Pentagram::istring key, bool &ret)
void set (Pentagram::istring key, std::string value)
void set (Pentagram::istring key, const char *value)
void set (Pentagram::istring key, int value)
void set (Pentagram::istring key, bool value)
void unset (Pentagram::istring key)
void listKeys (std::set< Pentagram::istring > &keys, Pentagram::istring section, bool longformat=false)
void listSections (std::set< Pentagram::istring > &sections, bool longformat=false)
void listKeyValues (std::map< Pentagram::istring, std::string > &keyvalues, Pentagram::istring section, bool longformat=false)

Private Member Functions

bool stripRoot (Pentagram::istring &key)
SectiongetSection (Pentagram::istring section)
bool splitKey (Pentagram::istring key, Pentagram::istring &section, Pentagram::istring &sectionkey)

Private Attributes

std::string filename
Pentagram::istring root
bool is_file
bool readonly
std::list< Sectionsections

Classes

struct  KeyValue
struct  Section


Detailed Description

Definition at line 25 of file INIFile.h.


Constructor & Destructor Documentation

INIFile::INIFile (  ) 

Definition at line 28 of file INIFile.cpp.

INIFile::INIFile ( std::string  fname,
Pentagram::istring  root 
)

INIFile::~INIFile (  ) 

Definition at line 40 of file INIFile.cpp.


Member Function Documentation

bool INIFile::checkRoot ( Pentagram::istring  key  ) 

void INIFile::clear ( Pentagram::istring  root  ) 

string INIFile::dump (  ) 

Definition at line 287 of file INIFile.cpp.

References sections.

Referenced by write().

Section* INIFile::getSection ( Pentagram::istring  section  )  [private]

bool INIFile::hasKey ( Pentagram::istring  key  ) 

bool INIFile::hasSection ( Pentagram::istring  section  ) 

bool INIFile::isReadonly (  )  const [inline]

Definition at line 43 of file INIFile.h.

References readonly.

void INIFile::listKeys ( std::set< Pentagram::istring > &  keys,
Pentagram::istring  section,
bool  longformat = false 
)

void INIFile::listKeyValues ( std::map< Pentagram::istring, std::string > &  keyvalues,
Pentagram::istring  section,
bool  longformat = false 
)

void INIFile::listSections ( std::set< Pentagram::istring > &  sections,
bool  longformat = false 
)

bool INIFile::readConfigFile ( std::string  fname  ) 

bool INIFile::readConfigString ( std::string  s  ) 

read configuration from a string s. Lines must be separated by

void INIFile::set ( Pentagram::istring  key,
bool  value 
)

void INIFile::set ( Pentagram::istring  key,
int  value 
)

void INIFile::set ( Pentagram::istring  key,
const char *  value 
)

void INIFile::set ( Pentagram::istring  key,
std::string  value 
)

void INIFile::setReadonly (  )  [inline]

Definition at line 42 of file INIFile.h.

References readonly.

bool INIFile::splitKey ( Pentagram::istring  key,
Pentagram::istring section,
Pentagram::istring sectionkey 
) [private]

bool INIFile::stripRoot ( Pentagram::istring key  )  [private]

void INIFile::unset ( Pentagram::istring  key  ) 

bool INIFile::value ( Pentagram::istring  key,
bool &  ret 
)

bool INIFile::value ( Pentagram::istring  key,
int &  ret 
)

bool INIFile::value ( Pentagram::istring  key,
std::string &  ret 
)

void INIFile::write (  ) 

Definition at line 302 of file INIFile.cpp.

References dump(), filename, FileSystem::get_instance(), is_file, readonly, ODataSource::write(), and FileSystem::WriteFile().


Member Data Documentation

std::string INIFile::filename [private]

Definition at line 75 of file INIFile.h.

Referenced by write().

bool INIFile::is_file [private]

Definition at line 77 of file INIFile.h.

Referenced by write().

bool INIFile::readonly [private]

Definition at line 78 of file INIFile.h.

Referenced by isReadonly(), setReadonly(), and write().

Pentagram::istring INIFile::root [private]

Definition at line 76 of file INIFile.h.

std::list<Section> INIFile::sections [private]

Definition at line 99 of file INIFile.h.

Referenced by dump().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:29:23 2007 for pentagram by  doxygen 1.4.7