iw4x-client/src/Utils/InfoString.hpp
Louve f3c15f2cda
Json11 => NlohmannJson (#393)
* Json11 => NlohmannJson

* Fix release build

* Updated gitmodulie

* Address review

* Update .gitmodules

Co-authored-by: rackover <roxanne@thegamebakers.com>
Co-authored-by: Edo <edoardo.sanguineti222@gmail.com>
2022-07-29 21:54:18 +02:00

28 lines
546 B
C++

#pragma once
namespace Utils
{
class InfoString
{
public:
InfoString() = default;
explicit InfoString(const std::string& buffer);
void set(const std::string& key, const std::string& value);
void remove(const std::string& key);
[[nodiscard]] std::string get(const std::string& key) const;
[[nodiscard]] std::string build() const;
#ifdef _DEBUG
void dump();
#endif
[[nodiscard]] nlohmann::json to_json() const;
private:
std::unordered_map<std::string, std::string> keyValuePairs;
void parse(std::string buffer);
};
}