12#ifndef ZYPP_PARSER_INIDICT_H
13#define ZYPP_PARSER_INIDICT_H
19#include <zypp-core/base/PtrTypes.h>
20#include <zypp-core/base/InputStream>
21#include <zypp-core/base/Iterator.h>
22#include <zypp-core/base/Iterable.h>
23#include <zypp-core/parser/IniParser>
45 typedef std::map<std::string, std::string>
EntrySet;
116 const std::string &key,
117 const std::string &value );
131 bool hasSection(
const std::string §ion )
const;
141 bool hasEntry(
const std::string §ion,
142 const std::string &entry )
const;
146 virtual void consume(
const std::string §ion );
148 virtual void consume(
const std::string §ion,
149 const std::string &key,
150 const std::string &value );
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
Parses a INI file and offers its structure as a dictionary.
section_const_iterator sectionsEnd() const
friend std::ostream & operator<<(std::ostream &str, const IniDict &obj)
void read(const InputStream &is, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
Fill a dictionary from a InputStream containing a ini structured file.
bool hasSection(const std::string §ion) const
True if there is a section with that name.
void deleteSection(const std::string §ion)
add an entry
EntrySet::const_iterator entry_const_iterator
MapKVIteratorTraits< SectionSet >::Key_const_iterator section_const_iterator
Iterable< section_const_iterator > sections() const
entry_const_iterator entriesBegin(const std::string §ion) const
Iterable< entry_const_iterator > entries(const std::string §ion) const
void insertEntry(const std::string §ion, const std::string &key, const std::string &value)
add an entry
section_const_iterator sectionsBegin() const
bool hasEntry(const std::string §ion, const std::string &entry) const
True if an entry exists in the section.
IniDict()
Creates a mepty dictionary.
virtual void consume(const std::string §ion)
Called when a section is found.
EntrySet _empty_map
empty map used to simulate iteration in non-existent sections
std::map< std::string, std::string > EntrySet
entry_const_iterator entriesEnd(const std::string §ion) const
std::map< std::string, EntrySet > SectionSet
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const ProductFileData &obj)
Easy-to use interface to the ZYPP dependency resolver.
transform_iterator< GetPairFirst< typename MapType::value_type >, typename MapType::const_iterator > Key_const_iterator
The key iterator type.