aboutsummaryrefslogtreecommitdiff
path: root/src/environment.hpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2018-12-10 09:25:14 +0100
committerFelix Morgner <felix.morgner@gmail.com>2018-12-10 09:25:14 +0100
commitd3e691c9200b7b782c8acf17468068a699588a73 (patch)
tree44f179ebf773dc8536b220f2ffcc3d2eec374aa4 /src/environment.hpp
parent7b940a39dfef6f19846fe357d4a5167c66c79e85 (diff)
downloadwanda-d3e691c9200b7b782c8acf17468068a699588a73.tar.xz
wanda-d3e691c9200b7b782c8acf17468068a699588a73.zip
doc: update documentation
Diffstat (limited to 'src/environment.hpp')
-rw-r--r--src/environment.hpp23
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();