15 using namespace StructuredHeaders;
19 auto err = buf_.parseItem(result);
23 return buf_.isEmpty() ?
28 std::vector<StructuredHeaderItem>& result) {
30 while (!buf_.isEmpty()) {
33 auto err = buf_.parseItem(item);
38 result.push_back(item);
40 buf_.removeOptionalWhitespace();
46 err = buf_.removeSymbol(
",",
true);
51 buf_.removeOptionalWhitespace();
62 return decodeMap(result, MapType::DICTIONARY);
68 while (!buf_.isEmpty()) {
72 auto err = buf_.parseIdentifier(primaryIdentifier.
identifier);
77 buf_.removeOptionalWhitespace();
79 err = decodeMap(primaryIdentifier.
parameterMap, MapType::PARAMETERISED_MAP);
84 result.emplace_back(primaryIdentifier);
86 buf_.removeOptionalWhitespace();
96 buf_.removeOptionalWhitespace();
104 std::unordered_map<std::string, StructuredHeaderItem>& result,
107 std::string delimiter = (mapType == MapType::PARAMETERISED_MAP) ?
";" :
",";
109 buf_.removeOptionalWhitespace();
111 if ((mapType == MapType::PARAMETERISED_MAP) &&
116 while (!buf_.isEmpty()) {
118 buf_.removeOptionalWhitespace();
121 auto err = buf_.parseIdentifier(thisKey);
126 if (result.find(thisKey) != result.end()) {
130 err = buf_.removeSymbol(
"=", mapType == MapType::DICTIONARY);
132 if (mapType == MapType::DICTIONARY) {
137 result[thisKey] =
value;
141 err = buf_.parseItem(value);
146 result[thisKey] =
value;
149 buf_.removeOptionalWhitespace();
151 if (buf_.isEmpty()) {
155 err = buf_.removeSymbol(delimiter, mapType == MapType::DICTIONARY);
157 if (mapType == MapType::PARAMETERISED_MAP) {
static const char *const value