19 #ifndef _VATA2_PARSER_HH_
20 #define _VATA2_PARSER_HH_
37 using KeyListStore = std::map<std::string, std::vector<std::string>>;
55 os <<
"@" << parsec.
type <<
"\n";
56 for (
const auto& string_list_pair : parsec.
dict)
58 os <<
"%" << string_list_pair.first;
59 for (
const std::string& str : string_list_pair.second)
68 for (
const auto& body_line : parsec.
body)
71 for (
const std::string& str : body_line)
73 if (!first) { os <<
" ";}
97 using Parsed = std::vector<ParsedSection>;
Parsed parse_vtf(const std::string &input)
Parses a string into an intermediary structure.
Parsed data (single section)
bool operator==(const ParsedSection &rhs) const
Equality operator.
std::vector< std::string > BodyLine
std::vector< ParsedSection > Parsed
Parsed data.
std::list< BodyLine > body
std::map< std::string, std::vector< std::string >> KeyListStore
void init()
registers dispatcher
friend std::ostream & operator<<(std::ostream &os, const ParsedSection &parsec)
Output stream operator.
bool operator!=(const ParsedSection &rhs) const
bool empty() const
Is the section empty?
ParsedSection parse_vtf_section(std::istream &input)
Parses one section from a stream into an intermediary structure.