Loading src/scord-ctl/config_file.cpp +13 −2 Original line number Diff line number Diff line Loading @@ -295,8 +295,19 @@ environment::get(const std::string& key) const { std::vector<std::string> environment::as_vector() const { // TODO return {}; std::vector<std::string> tmp; tmp.reserve(m_env.size()); for(const auto& [key, value] : m_env) { tmp.emplace_back(fmt::format("{}={}", key, value)); } return tmp; } std::size_t environment::size() const { return m_env.size(); } std::unordered_map<std::string, std::string>::const_iterator Loading src/scord-ctl/config_file.hpp +9 −0 Original line number Diff line number Diff line Loading @@ -59,12 +59,21 @@ public: /** * @brief Get the environment variables as a vector of strings. * Each string is of the form `key=value`. * * @return The environment variables as a vector of strings. */ std::vector<std::string> as_vector() const; /** * @brief Get the number of environment variables. * * @return The number of environment variables. */ std::size_t size() const; /** * @brief Get an iterator to the beginning of the environment variables. * Loading Loading
src/scord-ctl/config_file.cpp +13 −2 Original line number Diff line number Diff line Loading @@ -295,8 +295,19 @@ environment::get(const std::string& key) const { std::vector<std::string> environment::as_vector() const { // TODO return {}; std::vector<std::string> tmp; tmp.reserve(m_env.size()); for(const auto& [key, value] : m_env) { tmp.emplace_back(fmt::format("{}={}", key, value)); } return tmp; } std::size_t environment::size() const { return m_env.size(); } std::unordered_map<std::string, std::string>::const_iterator Loading
src/scord-ctl/config_file.hpp +9 −0 Original line number Diff line number Diff line Loading @@ -59,12 +59,21 @@ public: /** * @brief Get the environment variables as a vector of strings. * Each string is of the form `key=value`. * * @return The environment variables as a vector of strings. */ std::vector<std::string> as_vector() const; /** * @brief Get the number of environment variables. * * @return The number of environment variables. */ std::size_t size() const; /** * @brief Get an iterator to the beginning of the environment variables. * Loading