#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 */