89 {
return (! (*
this == rhs_)); }
114 int sync (
const string& fname_);
141 int drop_pair (
const string& section_,
const string& name_);
150 string get_value (
const string& section_,
const string& name_)
const;
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
Wrapper class for UNIX regexp (3).
Regexp m_tuple_pttrn
Name/value pair match.
std::fstream m_stream
File stream.
void add_section(const string §ion_)
Add new section.
int trim_section_name(string &text_)
Remove square brakets around section name.
pair< string, string > tuple_type
A tuple is a name/value pair.
config_type m_config
Cache holds the entire INI file in memory.
int load()
Load configuration data from the file.
config_type::iterator config_iterator
Mutable iterator over the list of configuration sections.
int set_pair(const string §ion_, const tuple_type &newkey_)
Add or change name/value pair in the section.
bool operator==(const IniFile &rhs_) const
Compare two configurations.
bool operator!=(const IniFile &rhs_) const
Compare two configurations.
int drop_pair(const string §ion_, const string &name_)
Remove name/value pair from the section in cache.
config_type::const_iterator const_config_iterator
Constant iterator over the list of configuration sections.
config_iterator find_section(const string §ion_)
Find section by its name.
IniFile(const string &fname_)
Do-nothing constructor.
int drop_section(const string §ion_)
Remove section from cache.
Regexp m_comment_pttrn
Comment match.
void drop_all()
Clear up configuration cache.
Regexp m_section_pttrn
Section header match.
list< sect_type > config_type
INI configuration is the collection of sections.
config_iterator sect_end()
Return iterator past the last section.
int sync()
Write cached configuration to the file.
list< tuple_type >::iterator tuple_iterator
Mutable iterator over name/value pairs in a section.
void dump() const
Dump cache to the log file.
int sync(const string &fname_)
Write cached configuration to the file fname_.
const_config_iterator sect_begin() const
Return iterator to the first section.
string get_value(const string §ion_, const string &name_) const
Find and return a value of the name/value pair in the section section_.
const_config_iterator find_section(const string §ion_) const
Find section by its name.
unsigned int size() const
Return number of sections in the cache.
list< tuple_type >::const_iterator const_tuple_iterator
Constant iterator over name/value pairs in a section.
string m_fname
INI file name.
pair< string, list< tuple_type > > sect_type
A section is a logical subcategory of related configuration information.
~IniFile()
Destructor does not save cache data to the file.
int ltrim(std::string &text_, const std::string &delim_)
Trim string from the beginning to the left of the delimiter.
int rtrim(std::string &text_, const std::string &delim_)
Trim string from the delimiter to the end of the string.
@ INIFILE
Class IniFile messages