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

libzypp 17.38.13

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< Pathname > | getConfigFiles (const std::string &stem_r, const Pathname &root_r=Pathname("/")) const

## Static Public Attributes
static Pathname | _defaultDistconfDir { APIConfig(LIBZYPP_ZYPPCONFDIR) }
| APIConfig(LIBZYPP_ZYPPCONFDIR) but amendable for Testing.

## 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 (APIConfig(LIBZYPP_ZYPPCONFDIR))

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

## Member Typedef Documentation

## ◆ Exception

using zypp::parser::econf::ConfigurationContext::Exception = EconfException

Definition at line 38 of file econfdict.cc.

## Constructor & Destructor Documentation

## ◆ ConfigurationContext() [1/2]

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

Definition at line 41 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 45 of file econfdict.cc.

## Member Function Documentation

## ◆ etcDir()

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

Definition at line 50 of file econfdict.cc.

## ◆ usrDir()

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

Definition at line 51 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 53 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 115 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 122 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 126 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 138 of file econfdict.cc.

## Member Data Documentation

## ◆ _defaultDistconfDir

Pathname zypp::parser::econf::ConfigurationContext::_defaultDistconfDir { APIConfig(LIBZYPP_ZYPPCONFDIR) }
| static

APIConfig(LIBZYPP_ZYPPCONFDIR) but amendable for Testing.

Definition at line 39 of file econfdict.cc.

## ◆ _etcDir

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

system configuration: /etc

Definition at line 148 of file econfdict.cc.

## ◆ _usrDir

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

vendor configuration: distconfdir (APIConfig(LIBZYPP_ZYPPCONFDIR))

Definition at line 149 of file econfdict.cc.

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

- zypp-core/parser/econfdict.cc