Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::AbstractConfig Class Referenceabstract
Inheritance diagram for nix::AbstractConfig:
nix::Config nix::GlobalConfig nix::ArchiveSettings nix::AuthorizationSettings nix::DevelopSettings nix::EvalSettings nix::FeatureSettings nix::FetchSettings nix::FileTransferSettings nix::LoggerSettings nix::PathsSettingTestConfig nix::Settings nix::StoreConfig

Classes

struct  SettingInfo

Public Member Functions

virtual bool set (const std::string &name, const std::string &value, const ApplyConfigOptions &options={})=0
virtual void getSettings (std::map< std::string, SettingInfo > &res, bool overriddenOnly=false)=0
void applyConfig (const std::string &contents, const ApplyConfigOptions &options={})
virtual void resetOverridden ()=0
virtual JSON toJSON ()=0
virtual void convertToArgs (Args &args, const std::string &category)=0
void warnUnknownSettings ()
void reapplyUnknownSettings ()

Protected Member Functions

 AbstractConfig (StringMap initials={})

Protected Attributes

StringMap unknownSettings

Member Function Documentation

◆ applyConfig()

void nix::AbstractConfig::applyConfig ( const std::string & contents,
const ApplyConfigOptions & options = {} )

Parses the configuration in contents and applies it

  • contents: configuration contents to be parsed and applied
  • path: location of the configuration file

◆ convertToArgs()

virtual void nix::AbstractConfig::convertToArgs ( Args & args,
const std::string & category )
pure virtual

Converts settings to Args to be used on the command line interface

  • args: args to write to
  • category: category of the settings

Implemented in nix::Config, and nix::GlobalConfig.

◆ getSettings()

virtual void nix::AbstractConfig::getSettings ( std::map< std::string, SettingInfo > & res,
bool overriddenOnly = false )
pure virtual

Adds the currently known settings to the given result map res.

  • res: map to store settings in
  • overriddenOnly: when set to true only overridden settings will be added to res

Implemented in nix::Config, and nix::GlobalConfig.

◆ reapplyUnknownSettings()

void nix::AbstractConfig::reapplyUnknownSettings ( )

Re-applies all previously attempted changes to unknown settings

◆ resetOverridden()

virtual void nix::AbstractConfig::resetOverridden ( )
pure virtual

Resets the overridden flag of all Settings

Implemented in nix::Config, and nix::GlobalConfig.

◆ set()

virtual bool nix::AbstractConfig::set ( const std::string & name,
const std::string & value,
const ApplyConfigOptions & options = {} )
pure virtual

Sets the value referenced by name to value. Returns true if the setting is known, false otherwise.

Implemented in nix::Config, and nix::GlobalConfig.

◆ toJSON()

virtual JSON nix::AbstractConfig::toJSON ( )
pure virtual

Outputs all settings to JSON

  • out: JSONObject to write the configuration to

Implemented in nix::Config, and nix::GlobalConfig.

◆ warnUnknownSettings()

void nix::AbstractConfig::warnUnknownSettings ( )

Logs a warning for each unregistered setting


The documentation for this class was generated from the following files:
  • lix/libutil/config.hh
  • lix/libutil/config.cc