23#ifndef L61_RS_ENVIRONMENT_VARIABLE_HPP
24#define L61_RS_ENVIRONMENT_VARIABLE_HPP
82 std::string
get(
const std::string& defaultValue =
"")
const;
110 const std::string&
getKey()
const;
112 std::string
toString()
const override;
128 std::size_t
hashCode()
const override;
A utility class for accessing environment variables by name.
Definition EnvironmentVariable.hpp:39
~EnvironmentVariable() override=default
nlohmann::json toJsonValue() const override
Serializes the object into JSON form.
Definition EnvironmentVariable.cpp:66
std::string getValue() const
Retrieves the value of the environment variable.
Definition EnvironmentVariable.cpp:31
EnvironmentVariable(const std::string &name)
Constructs an EnvironmentVariable object with the given name.
Definition EnvironmentVariable.cpp:29
bool exists() const
Checks if the environment variable exists.
Definition EnvironmentVariable.cpp:46
std::string toString() const override
Returns a human-readable string representation of the object.
Definition EnvironmentVariable.cpp:56
static EnvironmentVariable of(const std::string &name)
Definition EnvironmentVariable.hpp:44
const std::string & getKey() const
Retrieves the name (key) of the environment variable.
Definition EnvironmentVariable.cpp:51
bool operator==(const EnvironmentVariable &other) const
Equality operator for EnvironmentVariable objects.
Definition EnvironmentVariable.cpp:74
std::size_t hashCode() const override
Computes a hash code for this environment variable.
Definition EnvironmentVariable.cpp:61
std::string name_
Definition EnvironmentVariable.hpp:41
std::string get(const std::string &defaultValue="") const
Retrieves the value of the environment variable, or returns a default.
Definition EnvironmentVariable.cpp:40
Definition EnvironmentVariable.hpp:29
EnvironmentVariable getEnv(const std::string &name)
Definition EnvironmentVariable.hpp:161
Definition EnvironmentVariable.hpp:168