libzypp 17.38.1
zypp::parser::econf::ConfigurationContext Struct Reference

Provide access to the prioritized list of files and drop-ins to read and merge for a specific config file. More...

Public Types

using Exception = EconfException

Public Member Functions

 ConfigurationContext ()
 ConfigurationContext (std::optional< Pathname > etcDir_r, std::optional< Pathname > usrDir_r)
const std::optional< Pathname > & etcDir () const
const std::optional< Pathname > & usrDir () const
std::vector< PathnamegetConfigFiles (const std::string &stem_r, const Pathname &root_r=Pathname("/")) const

Static Private Member Functions

static void takeLookupDirIf (std::vector< Pathname > &lookupDirs_r, Pathname dir_r)
 Remember valid lookup dirs.
static bool isSet (const PathInfo &file_r)
 An empty path denotes the unset value.
static void takeOrMask (const PathInfo &file_r, PathInfo &toParse_r)
 The 1st viable file_r is stored in toParse_r; candidates found later are masked.
static void handOutIf (std::vector< Pathname > &ret_r, const PathInfo &file_r)
 Store set values in ret_r.

Private Attributes

std::optional< Pathname_etcDir
 system configuration: /etc
std::optional< Pathname_usrDir
 vendor configuration: distconfdir (/usr/etc)

Detailed Description

Provide access to the prioritized list of files and drop-ins to read and merge for a specific config file.

The list is ordered from lowest priority to highest priority,

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.

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

Definition at line 35 of file econfdict.cc.

Member Typedef Documentation

◆ Exception

Constructor & Destructor Documentation

◆ ConfigurationContext() [1/2]

zypp::parser::econf::ConfigurationContext::ConfigurationContext ( )
inline

Definition at line 39 of file econfdict.cc.

◆ ConfigurationContext() [2/2]

zypp::parser::econf::ConfigurationContext::ConfigurationContext ( std::optional< Pathname > etcDir_r,
std::optional< Pathname > usrDir_r )
inline

Definition at line 43 of file econfdict.cc.

Member Function Documentation

◆ etcDir()

const std::optional< Pathname > & zypp::parser::econf::ConfigurationContext::etcDir ( ) const
inline

Definition at line 48 of file econfdict.cc.

◆ usrDir()

const std::optional< Pathname > & zypp::parser::econf::ConfigurationContext::usrDir ( ) const
inline

Definition at line 49 of file econfdict.cc.

◆ getConfigFiles()

std::vector< Pathname > zypp::parser::econf::ConfigurationContext::getConfigFiles ( const std::string & stem_r,
const Pathname & root_r = Pathname("/") ) const
inline

Definition at line 51 of file econfdict.cc.

◆ takeLookupDirIf()

void zypp::parser::econf::ConfigurationContext::takeLookupDirIf ( std::vector< Pathname > & lookupDirs_r,
Pathname dir_r )
inlinestaticprivate

Remember valid lookup dirs.

Definition at line 113 of file econfdict.cc.

◆ isSet()

bool zypp::parser::econf::ConfigurationContext::isSet ( const PathInfo & file_r)
inlinestaticprivate

An empty path denotes the unset value.

Definition at line 120 of file econfdict.cc.

◆ takeOrMask()

void zypp::parser::econf::ConfigurationContext::takeOrMask ( const PathInfo & file_r,
PathInfo & toParse_r )
inlinestaticprivate

The 1st viable file_r is stored in toParse_r; candidates found later are masked.

Definition at line 124 of file econfdict.cc.

◆ handOutIf()

void zypp::parser::econf::ConfigurationContext::handOutIf ( std::vector< Pathname > & ret_r,
const PathInfo & file_r )
inlinestaticprivate

Store set values in ret_r.

Definition at line 136 of file econfdict.cc.

Member Data Documentation

◆ _etcDir

std::optional<Pathname> zypp::parser::econf::ConfigurationContext::_etcDir
private

system configuration: /etc

Definition at line 145 of file econfdict.cc.

◆ _usrDir

std::optional<Pathname> zypp::parser::econf::ConfigurationContext::_usrDir
private

vendor configuration: distconfdir (/usr/etc)

Definition at line 146 of file econfdict.cc.


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