diff --git a/common/entdata.cc b/common/entdata.cc index 7ba2f9b4..94ec79a2 100644 --- a/common/entdata.cc +++ b/common/entdata.cc @@ -28,6 +28,10 @@ #include #include +entdict_t::entdict_t(std::initializer_list l) : keyvalues(l) {} + +entdict_t::entdict_t() = default; + const std::string& entdict_t::get(const std::string& key) const { if (auto it = find(key); it != keyvalues.end()) { return it->second; diff --git a/include/common/entdata.h b/include/common/entdata.h index 675e32de..5314a62b 100644 --- a/include/common/entdata.h +++ b/include/common/entdata.h @@ -19,6 +19,7 @@ #pragma once +#include #include #include #include @@ -30,6 +31,9 @@ using keyvalues_t = std::vector; class entdict_t { keyvalues_t keyvalues; public: + entdict_t(std::initializer_list l); + entdict_t(); + const std::string& get(const std::string& key) const; void set(const std::string& key, const std::string& value); void remove(const std::string& key);