proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
StructuredHeadersEncoder.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
11
#pragma once
12
13
#include "
StructuredHeadersConstants.h
"
14
#include <ostream>
15
#include <string>
16
#include <unordered_map>
17
#include <vector>
18
#include <boost/iostreams/device/back_inserter.hpp>
19
#include <boost/iostreams/stream_buffer.hpp>
20
21
namespace
proxygen
{
22
23
using namespace
StructuredHeaders;
24
25
using
string_buf
= boost::iostreams::stream_buffer<
26
boost::iostreams::back_insert_device<std::string> >;
27
28
class
StructuredHeadersEncoder
{
29
30
public
:
31
32
StructuredHeadersEncoder
();
33
34
EncodeError
encodeParameterisedList(
const
ParameterisedList
& input);
35
36
EncodeError
encodeDictionary(
const
Dictionary
& input);
37
38
EncodeError
encodeList(
const
std::vector<StructuredHeaderItem>& input);
39
40
EncodeError
encodeItem(
const
StructuredHeaderItem
& input);
41
42
EncodeError
encodeIdentifier(
const
std::string
& input);
43
44
std::string
get
();
45
46
private
:
47
48
EncodeError
encodeBinaryContent(
const
std::string
& input);
49
50
EncodeError
encodeString(
const
std::string
& input);
51
52
EncodeError
encodeInteger(
int64_t
input);
53
54
EncodeError
encodeFloat(
double
input);
55
56
EncodeError
handleEncodeError(
EncodeError
err,
57
const
std::string
& badContent);
58
59
EncodeError
handleEncodeError(
EncodeError
err);
60
61
std::string
output_
;
62
string_buf
buf_
;
63
std::ostream
outputStream_
;
64
65
};
66
67
}
proxygen::StructuredHeaders::ParameterisedList
std::vector< StructuredHeaders::ParameterisedIdentifier > ParameterisedList
Definition:
StructuredHeadersConstants.h:59
proxygen::StructuredHeadersEncoder
Definition:
StructuredHeadersEncoder.h:28
proxygen::StructuredHeaders::Dictionary
std::unordered_map< std::string, StructuredHeaderItem > Dictionary
Definition:
StructuredHeadersConstants.h:61
proxygen::StructuredHeaders::EncodeError
EncodeError
Definition:
StructuredHeadersConstants.h:73
StructuredHeadersConstants.h
string
const char * string
Definition:
Conv.cpp:212
proxygen
Definition:
ExMessageHandler.h:14
proxygen::StructuredHeadersEncoder::outputStream_
std::ostream outputStream_
Definition:
StructuredHeadersEncoder.h:63
proxygen::StructuredHeadersEncoder::output_
std::string output_
Definition:
StructuredHeadersEncoder.h:61
int64_t
int64_t
Definition:
ConstexprMathBenchmark.cpp:188
proxygen::StructuredHeadersEncoder::buf_
string_buf buf_
Definition:
StructuredHeadersEncoder.h:62
proxygen::string_buf
boost::iostreams::stream_buffer< boost::iostreams::back_insert_device< std::string > > string_buf
Definition:
StructuredHeadersEncoder.h:26
proxygen::StructuredHeaders::StructuredHeaderItem
Definition:
StructuredHeadersConstants.h:24
proxygen
lib
http
structuredheaders
StructuredHeadersEncoder.h
Generated by
1.8.11