diff options
Diffstat (limited to 'src/environment.hpp')
| -rw-r--r-- | src/environment.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/environment.hpp b/src/environment.hpp index 1b5bd80..5a702a8 100644 --- a/src/environment.hpp +++ b/src/environment.hpp @@ -1,3 +1,9 @@ +/** + * @file environment.hpp + * @author Felix Morgner (felix.morgner@gmail.com) + * @since 1.0.0 + */ + #ifndef WANDA_ENVIRONMENT_HPP #define WANDA_ENVIRONMENT_HPP @@ -8,6 +14,9 @@ namespace wanda { + /** + * @brief A type to provide access to the runtime environment + */ struct environment { using map_type = std::map<std::string, std::string>; @@ -16,9 +25,23 @@ namespace wanda using reference = map_type::reference; using const_reference = map_type::const_reference; + /** + * @brief Construct a new environment from the given string array + */ explicit environment(char const * const * env = ::environ); + /** + * @brief Get the value of the given variable + * + * @return A mutable reference to the value of the given environment variable + */ std::string & operator[](std::string const & variable); + + /** + * @brief Get the value of the given variable + * + * @return An immutable reference to the value of the given environment variable + */ std::string const & operator[](std::string const & variable) const; iterator begin(); |
