8 #ifndef SRC_ENVIRONMENT_H_ 9 #define SRC_ENVIRONMENT_H_ 54 void set (
const std::string &key,
const std::string &value);
63 void set (
const std::string &key,
const bool value);
72 void set (
const std::string &key,
const int value);
82 void set (
const std::string &key,
const double value);
91 const std::string&
getString (
const std::string &key)
const;
100 bool getBool (
const std::string &key)
const;
109 int getInt (
const std::string &key)
const;
118 double getDouble (
const std::string &key)
const;
126 void rm (
const std::string &key);
128 void setProtected (
const std::string &key,
const std::string &value);
129 bool isBuiltinVar (
const std::string &key)
const;
130 static std::string convName (
const std::string &key);
132 std::map<std::string,std::string> m_envMap;
133 std::vector<std::string> m_builtins;
const std::string & getString(const std::string &key) const
Gets the environment variable key as a string.
Definition: Environment.cpp:52
int getInt(const std::string &key) const
Gets the environment variable key as an integer.
Definition: Environment.cpp:68
Environment(const std::string appName="iash")
Creates an Environment instance with the given application name.
Definition: Environment.cpp:17
bool getBool(const std::string &key) const
Gets the environment variable key as a boolean value.
Definition: Environment.cpp:59
The main shell class for iash.
Definition: iash.h:56
void rm(const std::string &key)
Removes the environment variable key.
Definition: Environment.cpp:86
Environment variable manager for iash.
Definition: Environment.h:33
double getDouble(const std::string &key) const
Gets the environment variable key as a floating-point value.
Definition: Environment.cpp:77