Author: mlandres Date: Thu May 8 22:38:59 2008 New Revision: 9997 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9997&view=rev Log: Take care IniDict remembers even empty sections. Modified: trunk/libzypp/zypp/parser/IniDict.cc Modified: trunk/libzypp/zypp/parser/IniDict.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/IniDict.cc?rev=9997&r1=9996&r2=9997&view=diff ============================================================================== --- trunk/libzypp/zypp/parser/IniDict.cc (original) +++ trunk/libzypp/zypp/parser/IniDict.cc Thu May 8 22:38:59 2008 @@ -59,14 +59,12 @@ void IniDict::consume( const std::string §ion ) { - // do nothing for now. + _dict[section]; // remember even empty sections } void IniDict::consume( const std::string §ion, const std::string &key, const std::string &value ) { - //MIL << endl; _dict[section][key] = value; - //MIL << this->size() << endl; } @@ -77,10 +75,10 @@ { return _empty_map.begin(); } - + return (secit->second).begin(); } - + IniDict::entry_const_iterator IniDict::entriesEnd(const std::string §ion) const { SectionSet::const_iterator secit = _dict.find(section); @@ -88,33 +86,33 @@ { return _empty_map.end(); } - + return (secit->second).end(); } - - + + IniDict::section_const_iterator IniDict::sectionsBegin() const { return make_map_key_begin( _dict ); } - + IniDict::section_const_iterator IniDict::sectionsEnd() const { return make_map_key_end( _dict ); } - + void IniDict::insertEntry( const std::string §ion, const std::string &key, const std::string &value ) { consume( section, key, value ); } - + void IniDict::deleteSection( const std::string §ion ) { _dict.erase(section); } - + bool IniDict::hasSection( const std::string §ion ) const { SectionSet::const_iterator secit = _dict.find(section); @@ -129,7 +127,7 @@ SectionSet::const_iterator secit = _dict.find(section); if ( secit == _dict.end() ) return false; - + EntrySet::const_iterator entryit = (secit->second).find(entry); if ( entryit == (secit->second).end() ) return false; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org