proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
Header.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 <
proxygen/lib/http/HTTPHeaders.h
>
13
#include <string>
14
15
namespace
proxygen
{
namespace
compress {
16
21
struct
Header
{
22
HTTPHeaderCode
code
;
23
const
std::string
*
name
;
24
const
std::string
*
value
;
25
26
Header
(
HTTPHeaderCode
c
,
27
const
std::string
&
v
)
28
: code(c), name(
HTTPCommonHeaders
::getPointerToHeaderName(c)), value(&v) {}
29
30
Header
(
HTTPHeaderCode
c
,
31
const
std::string
& n,
32
const
std::string
&
v
)
33
: code(c), name(&n), value(&v) {}
34
35
bool
operator<
(
const
Header
&
h
)
const
{
36
return
(code < h.
code
) ||
37
((code == h.
code
) && (*name < *h.
name
));
38
}
39
40
// For use by tests
41
static
Header
makeHeaderForTest
(
const
std::string
& n,
const
std::string
&
v
) {
42
return
Header
(n, v);
43
}
44
45
private
:
46
// This constructor ideally should not be used in production code
47
// This is because in prod the common header code is likely already known and
48
// an above constructor could be used; this exists for test purposes
49
Header
(
const
std::string
& n,
const
std::string
&
v
)
50
: code(
HTTPCommonHeaders
::hash(n)), name(&n), value(&v) {}
51
};
52
53
}}
proxygen::compress::Header::value
const std::string * value
Definition:
Header.h:24
h
*than *hazptr_holder h
Definition:
Hazptr.h:116
folly::pushmi
Definition:
boosters.h:30
HTTPHeaders.h
proxygen::compress::Header::name
const std::string * name
Definition:
Header.h:23
proxygen::HTTPCommonHeaders
Definition:
HTTPCommonHeaders.h:142
proxygen::compress::Header::Header
Header(const std::string &n, const std::string &v)
Definition:
Header.h:49
proxygen::compress::Header::Header
Header(HTTPHeaderCode c, const std::string &n, const std::string &v)
Definition:
Header.h:30
proxygen::compress::Header::code
HTTPHeaderCode code
Definition:
Header.h:22
proxygen::compress::Header
Definition:
Header.h:21
proxygen::compress::Header::Header
Header(HTTPHeaderCode c, const std::string &v)
Definition:
Header.h:26
string
const char * string
Definition:
Conv.cpp:212
proxygen
Definition:
ExMessageHandler.h:14
proxygen::HTTPHeaderCode
HTTPHeaderCode
Definition:
HTTPCommonHeaders.h:22
c
char c
Definition:
OptionalTest.cpp:53
proxygen::compress::Header::makeHeaderForTest
static Header makeHeaderForTest(const std::string &n, const std::string &v)
Definition:
Header.h:41
proxygen::compress::Header::operator<
bool operator<(const Header &h) const
Definition:
Header.h:35
proxygen
lib
http
codec
compress
Header.h
Generated by
1.8.11