proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
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
>
14
#include "
StructuredHeadersConstants.h
"
15
16
namespace
proxygen
{
17
18
using namespace
StructuredHeaders;
19
20
class
StructuredHeadersBuffer
{
21
public
:
22
23
explicit
StructuredHeadersBuffer
(
const
std::string
&
s
) :
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
33
StructuredHeaders::DecodeError
parseIdentifier(
StructuredHeaderItem
& result);
34
35
StructuredHeaders::DecodeError
parseIdentifier(
std::string
& result);
36
37
StructuredHeaders::DecodeError
parseItem(
StructuredHeaderItem
& result);
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
67
folly::StringPiece
content_
;
68
folly::StringPiece
originalContent_
;
69
};
70
71
}
int32_t
int32_t
Definition:
ConstexprMathBenchmark.cpp:184
proxygen::StructuredHeadersBuffer::content_
folly::StringPiece content_
Definition:
StructuredHeadersBuffer.h:67
proxygen::StructuredHeadersBuffer::StructuredHeadersBuffer
StructuredHeadersBuffer(const std::string &s)
Definition:
StructuredHeadersBuffer.h:23
Range.h
folly::gen::isEmpty
constexpr detail::IsEmpty< true > isEmpty
Definition:
Base-inl.h:2555
proxygen::StructuredHeaders::DecodeError
DecodeError
Definition:
StructuredHeadersConstants.h:63
proxygen::StructuredHeadersBuffer
Definition:
StructuredHeadersBuffer.h:20
folly::Range< const char * >
proxygen::StructuredHeadersBuffer::originalContent_
folly::StringPiece originalContent_
Definition:
StructuredHeadersBuffer.h:68
StructuredHeadersConstants.h
string
const char * string
Definition:
Conv.cpp:212
s
static set< string > s
Definition:
StringKeyedBenchmark.cpp:48
proxygen
Definition:
ExMessageHandler.h:14
proxygen::StructuredHeaders::StructuredHeaderItem
Definition:
StructuredHeadersConstants.h:24
proxygen
lib
http
structuredheaders
StructuredHeadersBuffer.h
Generated by
1.8.11