Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nix::AbstractConfig Class Referenceabstract
Inheritance diagram for nix::AbstractConfig:
nix::Config nix::GlobalConfig DevelopSettings nix::ArchiveSettings nix::CompatibilitySettings nix::EvalSettings nix::ExperimentalFeatureSettings nix::FileTransferSettings nix::LoggerSettings nix::PluginSettings nix::RestoreSinkSettings nix::Settings nix::StoreDirConfig nix::fetchers::Settings nixC::MySettings

Classes

struct  SettingInfo
 

Public Member Functions

virtual bool set (const std::string &name, const std::string &value)=0
 
virtual void getSettings (std::map< std::string, SettingInfo > &res, bool overriddenOnly=false)=0
 
void applyConfig (const std::string &contents, const std::string &path="<unknown>")
 
virtual void resetOverridden ()=0
 
virtual nlohmann::json toJSON ()=0
 
virtual std::string toKeyValue ()=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 std::string & path = "<unknown>" )

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 )
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 nlohmann::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.

◆ toKeyValue()

virtual std::string nix::AbstractConfig::toKeyValue ( )
pure virtual

Outputs all settings in a key-value pair format suitable to be used as nix.conf

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: