From 4e206fae5be6093b36c7779ba2a4a3679f0e754b Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 23 Nov 2023 01:47:18 +0000 Subject: something --- heading.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 heading.h (limited to 'heading.h') diff --git a/heading.h b/heading.h new file mode 100644 index 0000000..1b1781b --- /dev/null +++ b/heading.h @@ -0,0 +1,41 @@ +#ifndef HEADING_H +#define HEADING_H + +#include +#include +#include +#include + +struct ResourceRef { + bool internal = false; + int id; +}; + +class Heading { + public: + using keyval_t = std::variant; + + Heading() = default; + + explicit Heading(std::string_view line); + + const std::string& type() const { return type_; } + + void set_type(std::string_view type) { type_ = std::string(type); } + + const keyval_t& GetKeyval(std::string_view key) const { + return keyvals_.at(std::string(key)); + } + + void SetKeyval(std::string_view key, const keyval_t& value) { + keyvals_[std::string(key)] = value; + } + + std::string ToString() const; + + private: + std::string type_; + std::map keyvals_; +}; + +#endif /* HEADING_H */ -- cgit 1.4.1