libzypp
13.10.6
|
Parses a INI file and offers its structure as a dictionary. More...
#include <IniDict.h>
Public Types | |
typedef std::map< std::string, std::string > | EntrySet |
typedef std::map< std::string, EntrySet > | SectionSet |
typedef MapKVIteratorTraits < SectionSet > ::Key_const_iterator | section_const_iterator |
typedef EntrySet::const_iterator | entry_const_iterator |
Public Member Functions | |
Section Iterators | |
Iterate trough ini file sections * for ( IniDict::section_const_iterator it = dict.sectionsBegin();
* it != dict.sectionsEnd();
* ++it )
* {
* MIL << (*it) << endl;
* }
*
| |
section_const_iterator | sectionsBegin () const |
section_const_iterator | sectionsEnd () const |
Public Member Functions inherited from zypp::parser::IniParser | |
IniParser () | |
Default ctor. More... | |
virtual | ~IniParser () |
Dtor. More... | |
void | parse (const InputStream &imput_r, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc()) |
Parse the stream. More... | |
virtual void | beginParse () |
Called when start parsing. More... | |
virtual void | endParse () |
Called when the parse is done. More... | |
const std::string & | inputname () const |
Name of the current InputStream. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &str, const IniDict &obj) |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &str, const IniDict &obj) |
Entries Iterators | |
SectionSet | _dict |
EntrySet | _empty_map |
empty map used to simulate iteration in non existant sections More... | |
entry_const_iterator | entriesBegin (const std::string §ion) const |
entry_const_iterator | entriesEnd (const std::string §ion) const |
IniDict (const InputStream &is, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc()) | |
Creates a dictionary from a InputStream containing a ini structured file. More... | |
IniDict () | |
Creates a mepty dictionary. More... | |
~IniDict () | |
Dtor. More... | |
void | read (const InputStream &is, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc()) |
Fill a dictionary from a InputStream containing a ini structured file. More... | |
void | insertEntry (const std::string §ion, const std::string &key, const std::string &value) |
add an entry More... | |
void | deleteSection (const std::string §ion) |
add an entry More... | |
bool | hasSection (const std::string §ion) const |
True if there is a section with that name. More... | |
bool | hasEntry (const std::string §ion, const std::string &entry) const |
True if an entry exists in the section. More... | |
virtual void | consume (const std::string §ion) |
Called when a section is found. More... | |
virtual void | consume (const std::string §ion, const std::string &key, const std::string &value) |
Called when a key value is found. More... | |
Parses a INI file and offers its structure as a dictionary.
typedef std::map<std::string, std::string> zypp::parser::IniDict::EntrySet |
typedef std::map<std::string, EntrySet> zypp::parser::IniDict::SectionSet |
typedef MapKVIteratorTraits<SectionSet>::Key_const_iterator zypp::parser::IniDict::section_const_iterator |
typedef EntrySet::const_iterator zypp::parser::IniDict::entry_const_iterator |
zypp::parser::IniDict::IniDict | ( | const InputStream & | is, |
const ProgressData::ReceiverFnc & | progress = ProgressData::ReceiverFnc() |
||
) |
Creates a dictionary from a InputStream containing a ini structured file.
Definition at line 36 of file IniDict.cc.
zypp::parser::IniDict::IniDict | ( | ) |
Creates a mepty dictionary.
Definition at line 42 of file IniDict.cc.
zypp::parser::IniDict::~IniDict | ( | ) |
Dtor.
Definition at line 57 of file IniDict.cc.
IniDict::section_const_iterator zypp::parser::IniDict::sectionsBegin | ( | ) | const |
Definition at line 94 of file IniDict.cc.
IniDict::section_const_iterator zypp::parser::IniDict::sectionsEnd | ( | ) | const |
Definition at line 99 of file IniDict.cc.
IniDict::entry_const_iterator zypp::parser::IniDict::entriesBegin | ( | const std::string & | section | ) | const |
Definition at line 71 of file IniDict.cc.
IniDict::entry_const_iterator zypp::parser::IniDict::entriesEnd | ( | const std::string & | section | ) | const |
Definition at line 82 of file IniDict.cc.
void zypp::parser::IniDict::read | ( | const InputStream & | is, |
const ProgressData::ReceiverFnc & | progress = ProgressData::ReceiverFnc() |
||
) |
Fill a dictionary from a InputStream containing a ini structured file.
Definition at line 46 of file IniDict.cc.
void zypp::parser::IniDict::insertEntry | ( | const std::string & | section, |
const std::string & | key, | ||
const std::string & | value | ||
) |
void zypp::parser::IniDict::deleteSection | ( | const std::string & | section | ) |
bool zypp::parser::IniDict::hasSection | ( | const std::string & | section | ) | const |
True if there is a section with that name.
section | Section Name |
Definition at line 116 of file IniDict.cc.
bool zypp::parser::IniDict::hasEntry | ( | const std::string & | section, |
const std::string & | entry | ||
) | const |
True if an entry exists in the section.
section | Section name |
entry | entry name |
Definition at line 124 of file IniDict.cc.
|
virtual |
Called when a section is found.
Reimplemented from zypp::parser::IniParser.
Definition at line 60 of file IniDict.cc.
|
virtual |
Called when a key value is found.
Reimplemented from zypp::parser::IniParser.
Definition at line 65 of file IniDict.cc.
|
friend |
Definition at line 143 of file IniDict.cc.
|
related |
Stream output
Definition at line 143 of file IniDict.cc.
|
private |
|
private |