diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2018-11-30 10:48:44 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2018-11-30 10:48:44 +0100 |
| commit | 5b2974cd16b5d2841b72c7d0cc4a34469a8ded5b (patch) | |
| tree | 27fe6f0b428a1e02f7fe7c677795bdd989e0498c /src/environment.hpp | |
| parent | 543e91dc65d839864b42114b353d0c30db4dcdd1 (diff) | |
| download | wanda-5b2974cd16b5d2841b72c7d0cc4a34469a8ded5b.tar.xz wanda-5b2974cd16b5d2841b72c7d0cc4a34469a8ded5b.zip | |
core: implement basic XDG Base Specification support
Diffstat (limited to 'src/environment.hpp')
| -rw-r--r-- | src/environment.hpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/environment.hpp b/src/environment.hpp new file mode 100644 index 0000000..a6322cb --- /dev/null +++ b/src/environment.hpp @@ -0,0 +1,39 @@ +#ifndef WANDA_ENVIRONMENT_HPP +#define WANDA_ENVIRONMENT_HPP + +#include <unistd.h> + +#include <map> +#include <string> + +namespace wanda +{ + +struct environment +{ + using map_type = std::map<std::string, std::string>; + using iterator = map_type::iterator; + using const_iterator = map_type::const_iterator; + using reference = map_type::reference; + using const_reference = map_type::const_reference; + + explicit environment(char const *const *env = ::environ); + + std::string &operator[](std::string const &variable); + std::string const &operator[](std::string const &variable) const; + + iterator begin(); + const_iterator begin() const; + const_iterator cbegin() const; + + iterator end(); + const_iterator end() const; + const_iterator cend() const; + + private: + map_type m_cache{}; +}; + +} // namespace wanda + +#endif
\ No newline at end of file |
