proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
HeaderPiece.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015-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 <deque>
13
#include <
folly/Range.h
>
14
15
namespace
proxygen
{
namespace
compress {
16
20
class
HeaderPiece
{
21
public
:
25
HeaderPiece
(
const
char
* inData,
26
uint32_t
inLen,
27
bool
inOwner,
28
bool
inMultiValued)
29
:
str
(inData, inLen),
30
owner
(inOwner),
31
multiValued
(inMultiValued) {}
32
33
HeaderPiece
(
HeaderPiece
&& goner)
noexcept
34
:
str
(goner.
str
),
35
owner
(goner.
owner
),
36
multiValued
(goner.
multiValued
){
37
goner.owner =
false
;
38
}
39
40
~HeaderPiece
() {
41
if
(
owner
) {
42
CHECK_NOTNULL(
str
.
data
());
43
delete
[]
str
.
data
();
44
}
45
}
46
47
bool
isMultiValued
()
const
{
48
return
multiValued
;
49
}
50
51
// should be const, but for one use in GzipHeaderCodec
52
folly::StringPiece
str
;
53
54
private
:
55
bool
owner
;
56
bool
multiValued
;
57
};
58
59
using
HeaderPieceList
= std::deque<HeaderPiece>;
60
61
}}
proxygen::compress::HeaderPiece::multiValued
bool multiValued
Definition:
HeaderPiece.h:56
proxygen::compress::HeaderPiece
Definition:
HeaderPiece.h:20
proxygen::compress::HeaderPiece::isMultiValued
bool isMultiValued() const
Definition:
HeaderPiece.h:47
proxygen::compress::HeaderPiece::~HeaderPiece
~HeaderPiece()
Definition:
HeaderPiece.h:40
proxygen::compress::HeaderPiece::HeaderPiece
HeaderPiece(HeaderPiece &&goner) noexcept
Definition:
HeaderPiece.h:33
folly::pushmi::__adl::noexcept
requires E e noexcept(noexcept(s.error(std::move(e))))
Definition:
extension_points.h:40
proxygen::compress::HeaderPiece::str
folly::StringPiece str
Definition:
HeaderPiece.h:52
proxygen::compress::HeaderPiece::HeaderPiece
HeaderPiece(const char *inData, uint32_t inLen, bool inOwner, bool inMultiValued)
Definition:
HeaderPiece.h:25
Range.h
proxygen::compress::HeaderPieceList
std::deque< HeaderPiece > HeaderPieceList
Definition:
HeaderPiece.h:59
folly::Range::data
constexpr Iter data() const
Definition:
Range.h:446
folly::Range< const char * >
proxygen::compress::HeaderPiece::owner
bool owner
Definition:
HeaderPiece.h:55
proxygen
Definition:
ExMessageHandler.h:14
uint32_t
uint32_t
Definition:
ConstexprMathBenchmark.cpp:186
proxygen
lib
http
codec
compress
HeaderPiece.h
Generated by
1.8.11