libzypp 17.38.1
zypp::parser::EconfDict Struct Reference

Parse the prioritized list of files and drop-ins to read and merge for a specific config file stem: [PROJECT/]EXAMPLE[.SUFFIX] e.g: zypp/zypp.conf. More...

#include <zypp-core/parser/econfdict.h>

Inheritance diagram for zypp::parser::EconfDict:

Public Member Functions

 EconfDict ()
 EconfDict (const std::string &stem_r, const Pathname &root_r=Pathname("/"))
Public Member Functions inherited from zypp::parser::IniDict
section_const_iterator sectionsBegin () const
section_const_iterator sectionsEnd () const
Iterable< section_const_iteratorsections () const
entry_const_iterator entriesBegin (const std::string &section) const
entry_const_iterator entriesEnd (const std::string &section) const
Iterable< entry_const_iteratorentries (const std::string &section) const
 IniDict (const InputStream &is, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
 Creates a dictionary from a InputStream containing a ini structured file.
 IniDict ()
 Creates an empty dictionary.
 IniDict (IniDict &&)=default
 Move CTor.
IniDictoperator= (IniDict &&)=default
 ~IniDict () override
 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 &section, const std::string &key, const std::string &value)
 add an entry
void deleteSection (const std::string &section)
 add an entry
bool hasSection (const std::string &section) const
 True if there is a section with that name.
bool hasEntry (const std::string &section, const std::string &entry) const
 True if an entry exists in the section.
void consume (const std::string &section) override
 Called when a section is found.
void consume (const std::string &section, const std::string &key, const std::string &value) override
 Called when a key value is found.
std::ostream & dumpAsIniOn (std::ostream &str) const
 Dump the collected iniMap as ini-file.
Public Member Functions inherited from zypp::parser::IniParser
 IniParser ()
 Default ctor.
 IniParser (IniParser &&)
 Being NonCopyable is a legacy but allow at least moving.
IniParseroperator= (IniParser &&)
virtual ~IniParser ()
 Dtor.
void parse (const InputStream &imput_r, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
 Parse the stream.
virtual void beginParse ()
 Called when start parsing.
virtual void endParse ()
 Called when the parse is done.
virtual void garbageLine (const std::string &section, const std::string &line)
 Called whenever a garbage line is found.
const std::string & inputname () const
 Name of the current InputStream.

Additional Inherited Members

Public Types inherited from zypp::parser::IniDict
using EntrySet = std::map<std::string, std::string>
using SectionSet = std::map<std::string, EntrySet>
using section_const_iterator = MapKVIteratorTraits<SectionSet>::Key_const_iterator
using entry_const_iterator = EntrySet::const_iterator

Detailed Description

Parse the prioritized list of files and drop-ins to read and merge for a specific config file stem: [PROJECT/]EXAMPLE[.SUFFIX] e.g: zypp/zypp.conf.

The rules are defined by the UAPI.6 Configuration Files Specification (version 1)[1], but may be changed to follow newer versions in the future.

Exceptions

ref EconfException if stem_r is malformed

Exceptions

ref ParseException thrown from the underlying IniDict

See also
[1] https://github.com/uapi-group/specifications/blob/main/specs/configuration_files_specification.md

Definition at line 35 of file econfdict.h.

Constructor & Destructor Documentation

◆ EconfDict() [1/2]

zypp::parser::EconfDict::EconfDict ( )

Definition at line 151 of file econfdict.cc.

◆ EconfDict() [2/2]

zypp::parser::EconfDict::EconfDict ( const std::string & stem_r,
const Pathname & root_r = Pathname("/") )

Definition at line 154 of file econfdict.cc.


The documentation for this struct was generated from the following files: