aboutsummaryrefslogtreecommitdiff
path: root/source/lib/system/src/environment.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2024-05-17 17:58:38 +0200
committerFelix Morgner <felix.morgner@gmail.com>2024-05-17 17:58:38 +0200
commit577fc0845718ed8ad5bebf02a277c0579a817f77 (patch)
tree3d1cdc53c426a0ba60a7996619a7b787850bb3b3 /source/lib/system/src/environment.cpp
parentde5bf7ca3b7a2bf6be35b86486b00dc6a071b950 (diff)
downloadwanda-577fc0845718ed8ad5bebf02a277c0579a817f77.tar.xz
wanda-577fc0845718ed8ad5bebf02a277c0579a817f77.zip
wanda: restructure source layoutHEADdevelop
Diffstat (limited to 'source/lib/system/src/environment.cpp')
-rw-r--r--source/lib/system/src/environment.cpp71
1 files changed, 0 insertions, 71 deletions
diff --git a/source/lib/system/src/environment.cpp b/source/lib/system/src/environment.cpp
deleted file mode 100644
index 8f79531..0000000
--- a/source/lib/system/src/environment.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-#include "wanda/system/environment.hpp"
-
-#include <string>
-
-namespace wanda::system
-{
- environment::environment(char const * const * env)
- {
- if (!env)
- {
- return;
- }
-
- std::string buffer{};
- for (; *env != nullptr; ++env)
- {
- buffer = *env;
- int split_point = buffer.find('=');
- if (split_point != std::string::npos)
- {
- m_cache[buffer.substr(0, split_point)] = buffer.substr(split_point + 1);
- }
- }
- }
-
- std::string & environment::operator[](std::string const & variable)
- {
- return m_cache[variable];
- }
-
- std::string const & environment::operator[](std::string const & variable) const
- {
- static std::string const empty{};
- if (auto needle = m_cache.find(variable); needle != cend())
- {
- return needle->second;
- }
- return empty;
- }
-
- environment::iterator environment::begin()
- {
- return m_cache.begin();
- }
-
- environment::const_iterator environment::begin() const
- {
- return m_cache.begin();
- }
-
- environment::const_iterator environment::cbegin() const
- {
- return m_cache.cbegin();
- }
-
- environment::iterator environment::end()
- {
- return m_cache.end();
- }
-
- environment::const_iterator environment::end() const
- {
- return m_cache.end();
- }
-
- environment::const_iterator environment::cend() const
- {
- return m_cache.cend();
- }
-
-} // namespace wanda::system \ No newline at end of file