69    void IniDict::consume( 
const std::string §ion, 
const std::string &key, 
const std::string &value )
 
   71      _dict[section][key] = value;
 
 
   77      SectionSet::const_iterator secit = 
_dict.find(section);
 
   78      if ( secit == 
_dict.end() )
 
   83      return (secit->second).begin();
 
 
   88      SectionSet::const_iterator secit = 
_dict.find(section);
 
   89      if ( secit == 
_dict.end() )
 
   94      return (secit->second).end();
 
 
   99      SectionSet::const_iterator secit = 
_dict.find(section);
 
  100      if ( secit == 
_dict.end() )
 
  105      return makeIterable( (secit->second).begin(), (secit->second).end() );
 
 
  124                               const std::string &key,
 
  125                               const std::string &value )
 
  127      consume( section, key, value );
 
 
  133      _dict.erase(section);
 
 
  138      SectionSet::const_iterator secit = 
_dict.find(section);
 
  139      if ( secit == 
_dict.end() )
 
 
  145                            const std::string &entry )
 const 
  147      SectionSet::const_iterator secit = 
_dict.find(section);
 
  148      if ( secit == 
_dict.end() )
 
  151      EntrySet::const_iterator entryit = (secit->second).find(entry);
 
  152      if ( entryit == (secit->second).end() )
 
 
  169        str << 
"[" << *si << 
"]" << endl;
 
  174          str << ei->first << 
" = " << ei->second << endl;
 
 
Iterable< TIterator > makeIterable(TIterator &&begin_r, TIterator &&end_r)
convenient construction.
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
section_const_iterator sectionsEnd() const
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
IniDict(const InputStream &is, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
Creates a dictionary from a InputStream containing a ini structured file.
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
void consume(const std::string §ion) override
Called when a section is found.
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.
EntrySet _empty_map
empty map used to simulate iteration in non-existent sections
MapKVIteratorTraits< SectionSet >::Key_const_iterator section_const_iterator
EntrySet::const_iterator entry_const_iterator
entry_const_iterator entriesEnd(const std::string §ion) const
void parse(const InputStream &imput_r, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
Parse the stream.
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.
MapKVIteratorTraits< TMap >::Key_const_iterator make_map_key_begin(const TMap &map_r)
Convenience to create the key iterator from container::begin()
MapKVIteratorTraits< TMap >::Key_const_iterator make_map_key_end(const TMap &map_r)
Convenience to create the key iterator from container::end()