#include <IniDict.h>
Entries Iterators | |
| Iterate trough ini file entries in a section
for ( IniDict::entry_const_iterator it = dict.entriesBegin("updates"); it != dict.entriesEnd("updates"); ++it ) { MIL << (*it).first << endl; } | |
| SectionSet | _dict |
| EntrySet | _empty_map |
| empty map used to simulate iteration in non existant sections | |
| 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. | |
| IniDict () | |
| Creates a mepty dictionary. | |
| ~IniDict () | |
| Dtor. | |
| void | read (const InputStream &is, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc()) |
| Fill a dictionary from a InputStream containing a ini structured file. | |
| void | insertEntry (const std::string §ion, const std::string &key, const std::string &value) |
| void | deleteSection (const std::string §ion) |
| bool | hasSection (const std::string §ion) const |
| bool | hasEntry (const std::string §ion, const std::string &entry) const |
| virtual void | consume (const std::string §ion) |
| Called when a section is found. | |
| virtual void | consume (const std::string §ion, const std::string &key, const std::string &value) |
| Called when a key value is found. | |
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 |
Friends | |
| std::ostream & | operator<< (std::ostream &str, const IniDict &obj) |
| Stream output. | |
Definition at line 40 of file IniDict.h.
| 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.
References read().
| zypp::parser::IniDict::IniDict | ( | ) |
| zypp::parser::IniDict::~IniDict | ( | ) |
| IniDict::section_const_iterator zypp::parser::IniDict::sectionsBegin | ( | ) | const |
Definition at line 96 of file IniDict.cc.
References _dict, and zypp::make_map_key_begin().
Referenced by zypp::ZConfig::Impl::Impl(), zypp::parser::operator<<(), and zypp::parser::repositories_in_file().
| IniDict::section_const_iterator zypp::parser::IniDict::sectionsEnd | ( | ) | const |
Definition at line 101 of file IniDict.cc.
References _dict, and zypp::make_map_key_end().
Referenced by zypp::ZConfig::Impl::Impl(), zypp::parser::operator<<(), and zypp::parser::repositories_in_file().
| IniDict::entry_const_iterator zypp::parser::IniDict::entriesBegin | ( | const std::string & | section | ) | const |
Definition at line 73 of file IniDict.cc.
References _dict, and _empty_map.
Referenced by zypp::ZConfig::Impl::Impl(), zypp::parser::operator<<(), and zypp::parser::repositories_in_file().
| IniDict::entry_const_iterator zypp::parser::IniDict::entriesEnd | ( | const std::string & | section | ) | const |
Definition at line 84 of file IniDict.cc.
References _dict, and _empty_map.
Referenced by zypp::ZConfig::Impl::Impl(), zypp::parser::operator<<(), and zypp::parser::repositories_in_file().
| 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.
References zypp::parser::IniParser::parse().
Referenced by zypp::ZConfig::Impl::Impl(), and IniDict().
| void zypp::parser::IniDict::insertEntry | ( | const std::string & | section, | |
| const std::string & | key, | |||
| const std::string & | value | |||
| ) |
add an entry
| section | ||
| key | ||
| value |
Definition at line 106 of file IniDict.cc.
References consume().
| void zypp::parser::IniDict::deleteSection | ( | const std::string & | section | ) |
add an entry
| section | ||
| key | ||
| value |
Definition at line 113 of file IniDict.cc.
References _dict.
| 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 118 of file IniDict.cc.
References _dict.
| 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 126 of file IniDict.cc.
References _dict.
| void zypp::parser::IniDict::consume | ( | const std::string & | section | ) | [virtual] |
Called when a section is found.
Reimplemented from zypp::parser::IniParser.
Definition at line 60 of file IniDict.cc.
Referenced by insertEntry().
| void zypp::parser::IniDict::consume | ( | const std::string & | section, | |
| const std::string & | key, | |||
| const std::string & | value | |||
| ) | [virtual] |
Called when a key value is found.
Reimplemented from zypp::parser::IniParser.
Definition at line 65 of file IniDict.cc.
References _dict.
| std::ostream & operator<< | ( | std::ostream & | str, | |
| const IniDict & | obj | |||
| ) | [friend] |
SectionSet zypp::parser::IniDict::_dict [private] |
Definition at line 150 of file IniDict.h.
Referenced by consume(), deleteSection(), entriesBegin(), entriesEnd(), hasEntry(), hasSection(), sectionsBegin(), and sectionsEnd().
EntrySet zypp::parser::IniDict::_empty_map [private] |
empty map used to simulate iteration in non existant sections
Definition at line 156 of file IniDict.h.
Referenced by entriesBegin(), and entriesEnd().
1.5.3