libzypp 17.38.15

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_iterator > | sections () const
entry_const_iterator | entriesBegin (const std::string &section) const
entry_const_iterator | entriesEnd (const std::string &section) const
Iterable< entry_const_iterator > | entries (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.
IniDict & | operator= (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.
IniParser & | operator= (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.

## Static Public Member Functions
static Pathname | defaultDistconfDir ()
| Where the vendor configuration files live (APIConfig(LIBZYPP_ZYPPCONFDIR)).
static void | defaultDistconfDir (Pathname path_r)
| Testing: Set an alternate default path for the vendor configuration files.

## 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 156 of file econfdict.cc.

## ◆ EconfDict() [2/2]

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

Definition at line 159 of file econfdict.cc.

## Member Function Documentation

## ◆ defaultDistconfDir() [1/2]

Pathname zypp::parser::EconfDict::defaultDistconfDir | ( |  | ) |
| static

Where the vendor configuration files live (APIConfig(LIBZYPP_ZYPPCONFDIR)).

Definition at line 168 of file econfdict.cc.

## ◆ defaultDistconfDir() [2/2]

void zypp::parser::EconfDict::defaultDistconfDir | ( | Pathname | path_r | ) |
| static

Testing: Set an alternate default path for the vendor configuration files.

Definition at line 171 of file econfdict.cc.

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

- zypp-core/parser/econfdict.h
- zypp-core/parser/econfdict.cc