LibPkg
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
pkg::env_checker Class Reference

Class to check environment and convert a string environment specification into a pkg_env There is only a single instance of this. More...

#include <env_checker.h>

Classes

class  watcher
 A mixin class to allow an object to watch the environment checker. More...
 

Public Types

typedef std::map< std::string, env_check * > check_map
 

Public Member Functions

void add_ref ()
 
void remove_ref ()
 
pkg_envpackage_env (const std::string &env_list, const std::string &os_depends)
 Get a package environment for list of checks. More...
 
const check_mapchecks () const
 
const check_mapmodule_checks () const
 
std::string get_module_id (const std::string &title)
 Get module id. More...
 
bool clear_environment_overrides ()
 Clear any enviroment overrides. More...
 
bool override_environment (const std::set< std::string > &new_env, const std::set< std::string > &new_mods)
 Set the enviroment. More...
 

Static Public Member Functions

static env_checkerinstance ()
 

Friends

class watcher
 
class env_checker_ptr
 

Detailed Description

Class to check environment and convert a string environment specification into a pkg_env There is only a single instance of this.

Create one or more env_checker_ptr to manager this.

Member Typedef Documentation

◆ check_map

typedef std::map<std::string, env_check *> pkg::env_checker::check_map

Member Function Documentation

◆ instance()

static env_checker* pkg::env_checker::instance ( )
inlinestatic

◆ add_ref()

void pkg::env_checker::add_ref ( )
inline

◆ remove_ref()

void pkg::env_checker::remove_ref ( )

◆ package_env()

pkg_env * pkg::env_checker::package_env ( const std::string &  env_list,
const std::string &  os_depends 
)

Get a package environment for list of checks.

References pkg::ENV_MODULE_SEP, pkg::env_check::name(), and pkg::Unknown.

Referenced by pkg::binary_control::package_env().

◆ checks()

const check_map& pkg::env_checker::checks ( ) const
inline

◆ module_checks()

const check_map& pkg::env_checker::module_checks ( ) const
inline

◆ get_module_id()

std::string pkg::env_checker::get_module_id ( const std::string &  title)

Get module id.

ID is made unique for this machine by using a file as a database of modules found.

◆ clear_environment_overrides()

bool pkg::env_checker::clear_environment_overrides ( )

Clear any enviroment overrides.

Returns
true if anything changed

References pkg::env_check::available(), and pkg::env_check::detected().

◆ override_environment()

bool pkg::env_checker::override_environment ( const std::set< std::string > &  new_env,
const std::set< std::string > &  new_mods 
)

Set the enviroment.

Parameters
new_envset containing name environments that should be marked available
new_modsset containing name of modules that should be marked available
Returns
true if anything changed

References pkg::env_check::available(), pkg::env_check::id(), pkg::env_check::install_priority(), pkg::env_check::name(), pkg::System, and pkg::env_check::type().

Friends And Related Function Documentation

◆ watcher

friend class watcher
friend

◆ env_checker_ptr

friend class env_checker_ptr
friend

The documentation for this class was generated from the following files:

Reference Manual LibPkg Version 0.9.0 (4 Sep 2020)