8 #ifndef LIBPKG_LIBPKG_ENV_CHECKER_H_ 9 #define LIBPKG_LIBPKG_ENV_CHECKER_H_ 38 const std::string &
name()
const {
return _name;}
42 const std::string &
id()
const {
return _id;}
95 const std::string &
name()
const {
return _name;}
102 const std::string &
id()
const {
return _id;}
108 void reset_available();
110 std::string env_names()
const;
111 std::string module_names()
const;
116 pkg_env(
const std::string &
name,
const std::vector<env_check *> &checks);
121 std::vector<env_check *> _checks;
154 std::set<env_checker::watcher *> _watchers;
155 static unsigned int _next_module_id;
156 std::map<std::string, env_check *> _checks;
157 std::map<std::string, env_check *> _module_checks;
160 std::map<std::string, pkg_env *> _environments;
161 std::string _module_map_path;
162 std::map<std::string, std::string> _module_ids;
169 pkg_env *package_env(
const std::string &env_list,
const std::string &os_depends);
173 const check_map &
checks()
const {
return _checks;}
176 std::string get_module_id(
const std::string &title);
178 bool clear_environment_overrides();
179 bool override_environment(
const std::set<std::string> &new_env,
const std::set<std::string> &new_mods);
184 void initialise(
const std::string &module_map_path);
186 void read_module_map();
187 void write_module_map();
193 void register_watcher(
watcher& w);
199 void deregister_watcher(
watcher& w);
211 std::set<env_checker*> _env_checkers;
Class to check environment and convert a string environment specification into a pkg_env There is onl...
Definition: env_checker.h:144
Class for packages where the environment has not been set.
Definition: env_checker.h:64
void add_ref()
Definition: env_checker.h:166
env_check_type
Type for check.
Definition: env_checker.h:21
A class to represent the enviroment a package is designed for.
Definition: env_checker.h:91
int _install_priority
Definition: env_checker.h:60
std::map< std::string, env_check * > check_map
Definition: env_checker.h:171
System check.
Definition: env_checker.h:23
unknown_check(const std::string &name, const std::string &id)
Definition: env_checker.h:79
Module check.
Definition: env_checker.h:24
The namespace used to hold the package management library.
Definition: auto_dir.cc:12
Check unknown to this version of libpkg.
Definition: env_checker.h:25
No check defined on package.
Definition: env_checker.h:26
const std::string & description() const
A one line description for display purposes only.
Definition: env_checker.h:40
env_check_type type() const
Type for this check.
Definition: env_checker.h:49
const std::string & name() const
The full name of this environment.
Definition: env_checker.h:95
int install_priority()
Priority for this check, the higher the more important.
Definition: env_checker.h:51
bool available() const
Software override of status.
Definition: env_checker.h:46
A mixin class to allow an object to watch the environment checker.
Definition: env_checker.h:207
const check_map & module_checks() const
Definition: env_checker.h:174
const std::string & id() const
Short id consisting of a single letter optionally followed be a number.
Definition: env_checker.h:42
bool _detected
Definition: env_checker.h:58
std::string _description
Definition: env_checker.h:57
env_check(const std::string &name, const std::string &desc, const std::string &id, env_check_type type, int install_priority)
Construct a default environment check.
Definition: env_checks.cc:50
virtual ~env_check()
Definition: env_checker.h:36
const std::string & name() const
The name of the check, should be fairly short.
Definition: env_checker.h:38
static env_checker * instance()
Definition: env_checker.h:165
void available(bool override)
Definition: env_checker.h:47
bool _available
Definition: env_checker.h:59
int default_install_priority() const
Default install priority to use if the package doesn't specify one.
Definition: env_checker.h:100
Class for environment checks not recognised by the current version.
Definition: env_checker.h:76
Class to help manage the single env_checker instance.
Definition: env_checker.h:130
bool detected() const
Automatic detection result.
Definition: env_checker.h:44
bool available() const
Return true if this environment is compatible with the current machine.
Definition: env_checker.h:97
Base class for the environment checking classes.
Definition: env_checker.h:31
const check_map & checks() const
Definition: env_checker.h:173
unset_check()
Definition: env_checker.h:67
const std::string & id() const
Unique short Id string for use in maps and file caches.
Definition: env_checker.h:102
env_check_type type() const
Main type to describe this package, chosen from the checks in the environment.
Definition: env_checker.h:105