proxygen
StructuredHeadersBuffer.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
12 #include <string>
13 #include <folly/Range.h>
15 
16 namespace proxygen {
17 
18 using namespace StructuredHeaders;
19 
21 public:
22 
24  content_(s),
25  originalContent_(s) {}
26 
27  /*
28  * helper functions used to extract various lower-level items from a sequence
29  * of bytes. These will be called from higher level functions which parse
30  * dictionaries, lists, and other data structures.
31  */
32 
34 
35  StructuredHeaders::DecodeError parseIdentifier(std::string& result);
36 
38 
39  DecodeError removeSymbol(const std::string& symbol, bool strict);
40 
41  DecodeError removeOptionalWhitespace();
42 
43  bool isEmpty();
44 
45  DecodeError handleDecodeError(const DecodeError& err);
46 
47 private:
48 
49  DecodeError parseBinaryContent(StructuredHeaderItem& result);
50 
51  DecodeError parseNumber(StructuredHeaderItem& result);
52 
53  DecodeError parseString(StructuredHeaderItem& result);
54 
55  DecodeError parseInteger(const std::string& input,
56  StructuredHeaderItem& result);
57 
58  DecodeError parseFloat(const std::string& input,
59  StructuredHeaderItem& result);
60 
61  char peek();
62 
63  void advanceCursor();
64 
65  int32_t getNumCharsParsed();
66 
69 };
70 
71 }
constexpr detail::IsEmpty< true > isEmpty
Definition: Base-inl.h:2555
const char * string
Definition: Conv.cpp:212
static set< string > s