]>
Commit | Line | Data |
---|---|---|
b8151fa1 | 1 | /* |
b8ae064d | 2 | * Copyright (C) 1996-2023 The Squid Software Foundation and contributors |
b8151fa1 | 3 | * |
bbc27441 AJ |
4 | * Squid software is distributed under GPLv2+ license and includes |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
b8151fa1 CT |
7 | */ |
8 | ||
bbc27441 AJ |
9 | /* DEBUG: section 16 Cache Manager API */ |
10 | ||
b8151fa1 CT |
11 | #ifndef SQUID_MGR_QUERY_PARAMS_H |
12 | #define SQUID_MGR_QUERY_PARAMS_H | |
13 | ||
14 | #include "ipc/forward.h" | |
15 | #include "mgr/QueryParam.h" | |
26e65059 | 16 | #include "parser/forward.h" |
b8151fa1 | 17 | #include "SquidString.h" |
26e65059 | 18 | |
b8151fa1 | 19 | #include <utility> |
26e65059 | 20 | #include <vector> |
b8151fa1 | 21 | |
b8151fa1 CT |
22 | namespace Mgr |
23 | { | |
24 | ||
25 | class QueryParams | |
26 | { | |
27 | public: | |
28 | typedef std::pair<String, QueryParam::Pointer> Param; | |
29 | typedef std::vector<Param> Params; | |
30 | ||
31 | public: | |
32 | /// returns query parameter by name | |
22b5be72 | 33 | QueryParam::Pointer get(const String& name) const; |
b8151fa1 CT |
34 | void pack(Ipc::TypedMsgHdr& msg) const; ///< store params into msg |
35 | void unpack(const Ipc::TypedMsgHdr& msg); ///< load params from msg | |
36 | /// parses the query string parameters | |
26e65059 | 37 | static void Parse(Parser::Tokenizer &, QueryParams &); |
b8151fa1 CT |
38 | |
39 | private: | |
40 | /// find query parameter by name | |
22b5be72 | 41 | Params::const_iterator find(const String& name) const; |
b8151fa1 CT |
42 | /// creates a parameter of the specified type |
43 | static QueryParam::Pointer CreateParam(QueryParam::Type aType); | |
b8151fa1 CT |
44 | |
45 | private: | |
46 | Params params; | |
47 | }; | |
48 | ||
49 | } // namespace Mgr | |
50 | ||
51 | #endif /* SQUID_MGR_QUERY_PARAMS_H */ | |
f53969cc | 52 |