|
libzypp
9.1.2
|
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 |
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 | |
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) |
| add an entry | |
| void | deleteSection (const std::string §ion) |
| add an entry | |
| bool | hasSection (const std::string §ion) const |
| True if there is a section with that name. | |
| bool | hasEntry (const std::string §ion, const std::string &entry) const |
| True if an entry exists in the section. | |
| 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. | |
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.
References zypp::base::sysconfig::read().
Creates a mepty dictionary.
Definition at line 42 of file IniDict.cc.
Dtor.
Definition at line 57 of file IniDict.cc.
Definition at line 94 of file IniDict.cc.
References zypp::make_map_key_begin().
Referenced by zypp::VendorAttr::addVendorFile(), zypp::media::CredentialFileReader::CredentialFileReader(), zypp::ZConfig::Impl::Impl(), zypp::parser::operator<<(), zypp::parser::ServiceFileReader::Impl::parseServices(), and zypp::parser::repositories_in_stream().
Definition at line 99 of file IniDict.cc.
References zypp::make_map_key_end().
Referenced by zypp::VendorAttr::addVendorFile(), zypp::media::CredentialFileReader::CredentialFileReader(), zypp::ZConfig::Impl::Impl(), zypp::parser::operator<<(), zypp::parser::ServiceFileReader::Impl::parseServices(), and zypp::parser::repositories_in_stream().
| IniDict::entry_const_iterator zypp::parser::IniDict::entriesBegin | ( | const std::string & | section | ) | const |
Definition at line 71 of file IniDict.cc.
Referenced by zypp::VendorAttr::addVendorFile(), zypp::media::CredentialFileReader::CredentialFileReader(), zypp::ZConfig::Impl::Impl(), zypp::parser::operator<<(), zypp::parser::ServiceFileReader::Impl::parseServices(), and zypp::parser::repositories_in_stream().
| IniDict::entry_const_iterator zypp::parser::IniDict::entriesEnd | ( | const std::string & | section | ) | const |
Definition at line 82 of file IniDict.cc.
Referenced by zypp::VendorAttr::addVendorFile(), zypp::media::CredentialFileReader::CredentialFileReader(), zypp::ZConfig::Impl::Impl(), zypp::parser::operator<<(), zypp::parser::ServiceFileReader::Impl::parseServices(), and zypp::parser::repositories_in_stream().
| 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.
Referenced by zypp::VendorAttr::addVendorDirectory(), and zypp::VendorAttr::addVendorFile().
| 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.
| 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.
| 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.
| std::ostream& operator<< | ( | std::ostream & | str, |
| const IniDict & | obj | ||
| ) | [friend] |
Definition at line 143 of file IniDict.cc.
| std::ostream & operator<< | ( | std::ostream & | str, |
| const IniDict & | obj | ||
| ) | [related] |
Stream output
Definition at line 143 of file IniDict.cc.
SectionSet zypp::parser::IniDict::_dict [private] |
EntrySet zypp::parser::IniDict::_empty_map [private] |
1.7.6.1