mirror of
https://github.com/diamante0018/MW3ServerFreezer.git
synced 2025-07-05 02:31:54 +00:00
Refactor this (tekno gods dont sue please)
This commit is contained in:
22
src/common/utils/info_string.hpp
Normal file
22
src/common/utils/info_string.hpp
Normal file
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace utils {
|
||||
class info_string {
|
||||
public:
|
||||
info_string() = default;
|
||||
explicit info_string(const std::string& buffer);
|
||||
explicit info_string(const std::string_view& buffer);
|
||||
|
||||
void set(const std::string& key, const std::string& value);
|
||||
[[nodiscard]] std::string get(const std::string& key) const;
|
||||
[[nodiscard]] std::string build() const;
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, std::string> key_value_pairs_;
|
||||
|
||||
void parse(std::string buffer);
|
||||
};
|
||||
} // namespace utils
|
Reference in New Issue
Block a user