12 #include <boost/lexical_cast.hpp> 17 using namespace StructuredHeaders;
21 removeOptionalWhitespace();
26 char firstCharacter = peek();
27 if (firstCharacter ==
'"') {
28 return parseString(result);
29 }
else if (firstCharacter ==
'*') {
30 return parseBinaryContent(result);
31 }
else if (std::isdigit(firstCharacter) || firstCharacter ==
'-') {
32 return parseNumber(result);
59 if (!std::isdigit(peek())) {
65 if (std::isdigit(current)) {
66 input.push_back(current);
70 input.push_back(current);
76 int numDigits = input.length() - (positive ? 0 : 1);
87 return parseInteger(input, result);
88 }
else if (input.back() ==
'.') {
91 return parseFloat(input, result);
114 if (current ==
'*') {
132 outputString.push_back(current);
144 auto err = parseIdentifier(outputString);
149 result.
value = outputString;
172 result.push_back(current);
185 }
catch (boost::bad_lexical_cast &) {
195 result.
value = boost::lexical_cast<
double>(input);
197 }
catch (boost::bad_lexical_cast &) {
219 if (current ==
'\\') {
224 char nextChar = peek();
226 if (nextChar !=
'"' && nextChar !=
'\\') {
229 outputString.push_back(nextChar);
231 }
else if (current ==
'"') {
233 result.
value = outputString;
240 outputString.push_back(current);
248 while (peek() ==
' ' || peek() ==
'\t') {
257 if (content_.startsWith(symbol)) {
258 content_.advance(symbol.length());
270 LOG_EVERY_N(
ERROR, 1000) <<
"Error message: " <<
272 ". Number of characters parsed before error:" <<
273 getNumCharsParsed() <<
". Header Content:" << originalContent_.str();
278 return *content_.begin();
286 return content_.begin() == content_.end();
290 return std::distance(originalContent_.begin(), content_.begin());
constexpr detail::Map< Move > move
constexpr detail::IsEmpty< true > isEmpty