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

Static Public Member Functions

static Pathname defaultDistconfDir ()
 Where the vendor configuration files live (APIConfig(LIBZYPP_ZYPPCONFDIR)) More...
 
static void defaultDistconfDir (Pathname path_r)
 Testing: Set an alternate default path for the vendor configuration files. More...
 

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

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: