60 void IniDict::consume(
const std::string §ion )
65 void IniDict::consume(
const std::string §ion,
const std::string &key,
const std::string &value )
67 _dict[section][key] = value;
73 SectionSet::const_iterator secit = _dict.find(section);
74 if ( secit == _dict.end() )
76 return _empty_map.begin();
79 return (secit->second).begin();
84 SectionSet::const_iterator secit = _dict.find(section);
85 if ( secit == _dict.end() )
87 return _empty_map.end();
90 return (secit->second).end();
104 void IniDict::insertEntry(
const std::string §ion,
105 const std::string &key,
106 const std::string &value )
108 consume( section, key, value );
111 void IniDict::deleteSection(
const std::string §ion )
113 _dict.erase(section);
116 bool IniDict::hasSection(
const std::string §ion )
const
118 SectionSet::const_iterator secit = _dict.find(section);
119 if ( secit == _dict.end() )
124 bool IniDict::hasEntry(
const std::string §ion,
125 const std::string &entry )
const
127 SectionSet::const_iterator secit = _dict.find(section);
128 if ( secit == _dict.end() )
131 EntrySet::const_iterator entryit = (secit->second).find(entry);
132 if ( entryit == (secit->second).end() )
149 str <<
"[" << *si <<
"]" << endl;
154 str << ei->first <<
" = " << ei->second << endl;
MapKVIteratorTraits< SectionSet >::Key_const_iterator section_const_iterator
map< string, string > read(const Pathname &_path)
Read sysconfig file path_r and return (key,valye) pairs.
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
std::ostream & operator<<(std::ostream &str, const ::_Dataiterator *obj)
section_const_iterator sectionsBegin() const
entry_const_iterator entriesEnd(const std::string §ion) const
MapKVIteratorTraits< _Map >::Key_const_iterator make_map_key_begin(const _Map &map_r)
Convenience to create the key iterator from container::begin()
Parses a INI file and offers its structure as a dictionary.
entry_const_iterator entriesBegin(const std::string §ion) const
EntrySet::const_iterator entry_const_iterator
MapKVIteratorTraits< _Map >::Key_const_iterator make_map_key_end(const _Map &map_r)
Convenience to create the key iterator from container::end()
section_const_iterator sectionsEnd() const