20 #ifndef LIBPKG_LIBPKG_ENV_CHECKER_H_ 21 #define LIBPKG_LIBPKG_ENV_CHECKER_H_ 50 const std::string &
name()
const {
return _name;}
54 const std::string &
id()
const {
return _id;}
107 const std::string &
name()
const {
return _name;}
114 const std::string &
id()
const {
return _id;}
120 void reset_available();
122 std::string env_names()
const;
123 std::string module_names()
const;
128 pkg_env(
const std::string &
name,
const std::vector<env_check *> &checks);
133 std::vector<env_check *> _checks;
166 std::set<env_checker::watcher *> _watchers;
167 static unsigned int _next_module_id;
168 std::map<std::string, env_check *> _checks;
169 std::map<std::string, env_check *> _module_checks;
172 std::map<std::string, pkg_env *> _environments;
173 std::string _module_map_path;
174 std::map<std::string, std::string> _module_ids;
181 pkg_env *package_env(
const std::string &env_list,
const std::string &os_depends);
185 const check_map &
checks()
const {
return _checks;}
188 std::string get_module_id(
const std::string &title);
190 bool clear_environment_overrides();
191 bool override_environment(
const std::set<std::string> &new_env,
const std::set<std::string> &new_mods);
196 void initialise(
const std::string &module_map_path);
198 void read_module_map();
199 void write_module_map();
205 void register_watcher(
watcher& w);
211 void deregister_watcher(
watcher& w);
223 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:156
Class for packages where the environment has not been set.
Definition: env_checker.h:76
void add_ref()
Definition: env_checker.h:178
env_check_type
Type for check.
Definition: env_checker.h:33
A class to represent the enviroment a package is designed for.
Definition: env_checker.h:103
int _install_priority
Definition: env_checker.h:72
std::map< std::string, env_check * > check_map
Definition: env_checker.h:183
System check.
Definition: env_checker.h:35
unknown_check(const std::string &name, const std::string &id)
Definition: env_checker.h:91
Module check.
Definition: env_checker.h:36
The namespace used to hold the package management library.
Definition: auto_dir.cc:23
Check unknown to this version of libpkg.
Definition: env_checker.h:37
No check defined on package.
Definition: env_checker.h:38
const std::string & description() const
A one line description for display purposes only.
Definition: env_checker.h:52
env_check_type type() const
Type for this check.
Definition: env_checker.h:61
const std::string & name() const
The full name of this environment.
Definition: env_checker.h:107
int install_priority()
Priority for this check, the higher the more important.
Definition: env_checker.h:63
bool available() const
Software override of status.
Definition: env_checker.h:58
A mixin class to allow an object to watch the environment checker.
Definition: env_checker.h:219
const check_map & module_checks() const
Definition: env_checker.h:186
const std::string & id() const
Short id consisting of a single letter optionally followed be a number.
Definition: env_checker.h:54
bool _detected
Definition: env_checker.h:70
std::string _description
Definition: env_checker.h:69
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:62
virtual ~env_check()
Definition: env_checker.h:48
const std::string & name() const
The name of the check, should be fairly short.
Definition: env_checker.h:50
static env_checker * instance()
Definition: env_checker.h:177
void available(bool override)
Definition: env_checker.h:59
bool _available
Definition: env_checker.h:71
int default_install_priority() const
Default install priority to use if the package doesn't specify one.
Definition: env_checker.h:112
Class for environment checks not recognised by the current version.
Definition: env_checker.h:88
Class to help manage the single env_checker instance.
Definition: env_checker.h:142
bool detected() const
Automatic detection result.
Definition: env_checker.h:56
bool available() const
Return true if this environment is compatible with the current machine.
Definition: env_checker.h:109
Base class for the environment checking classes.
Definition: env_checker.h:43
const check_map & checks() const
Definition: env_checker.h:185
unset_check()
Definition: env_checker.h:79
const std::string & id() const
Unique short Id string for use in maps and file caches.
Definition: env_checker.h:114
env_check_type type() const
Main type to describe this package, chosen from the checks in the environment.
Definition: env_checker.h:117