forked from YahooArchive/http-filters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathts.h
73 lines (55 loc) · 1.88 KB
/
ts.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* Copyright (c) 2015, Yahoo Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
#ifndef TS_H
#define TS_H
#include <map>
#include <ostream>
#include <string>
#include <vector>
#include "my-assert.h"
#include <ts/ts.h>
#include "string-view.h"
namespace http {
namespace filters {
util::StringView getHeader(const TSMBuffer, const TSMLoc, const char * const);
struct Headers {
typedef std::vector< util::StringView > Values;
typedef std::map< util::StringView, Values, util::StringViewLess > Map;
typedef std::pair< const Values *, bool > Result;
Map map_;
Headers(void) { }
Headers(const TSMBuffer &, const TSMLoc &);
inline bool empty(void) const { return map_.empty(); }
Result operator [] (const char * const) const;
void print(std::ostream &) const;
};
struct Cookies {
typedef std::vector< util::StringView > Values;
typedef std::map< util::StringView, Values, util::StringViewLess > Map;
typedef std::pair< const Values *, bool > Result;
Map map_;
Cookies(void) { }
Cookies(const util::StringView &);
void parse(const util::StringView &);
inline bool empty(void) const { return map_.empty(); }
Result operator [] (const char * const) const;
void push(const char * const, const char * &, const char * const);
};
struct QueryParameters {
typedef std::vector< util::StringView > Values;
typedef std::map< util::StringView, Values, util::StringViewLess > Map;
typedef std::pair< const Values * , bool > Result;
Map map_;
QueryParameters(void) { }
QueryParameters(const util::StringView &);
void parse(const util::StringView &);
inline bool empty(void) const { return map_.empty(); }
Result operator [] (const char * const) const;
void push(const char * const, const char * &, const char * const);
};
} //end of filters namespace
} //end of http namespace
#endif //TS_H