FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
esp32_https_server/src/ResourceParameters.hpp at master · open-morphs/esp32_https_server · GitHub
This repository was archived by the owner on Dec 29, 2023. It is now read-only.
open-morphs
esp32_https_server
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
esp32_https_server
/
src
/
ResourceParameters.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
59 lines (48 loc) · 1.87 KB
Breadcrumbs
esp32_https_server
/
src
/
ResourceParameters.hpp
Copy path
File metadata and controls
59 lines (48 loc) · 1.87 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
ifndef
SRC_RESOURCEPARAMETERS_HPP_
#
define
SRC_RESOURCEPARAMETERS_HPP_
#
include
<
Arduino.h
>
#
include
<
string
>
//
Arduino declares it's own min max, incompatible with the stl...
#
undef
min
#
undef
max
#
include
<
vector
>
#
include
<
utility
>
#
include
"
util.hpp
"
namespace
httpsserver
{
class
ResourceResolver
;
/*
*
* @brief The ResourceParameters provide access to the parameters passed in the URI.
*
* There are two types of parameters: Path parameters and query parameters.
*
* Path parameters are the values that fill the asterisk placeholders in the route
* definition of a ResourceNode.
*
* Query parameters are the key-value pairs after a question mark which can be added
* to each request, either by specifying them manually or as result of submitting an
* HTML form with a GET as method property.
*/
class
ResourceParameters
{
public:
ResourceParameters
();
virtual
~ResourceParameters
();
bool
isQueryParameterSet
(std::string
const
&name);
bool
getQueryParameter
(std::string
const
&name, std::string &value);
std::vector<std::pair<std::string,std::string>>::iterator
beginQueryParameters
();
std::vector<std::pair<std::string,std::string>>::iterator
endQueryParameters
();
size_t
getQueryParameterCount
(
bool
unique=
false
);
bool
getPathParameter
(
size_t
const
idx, std::string &value);
std::string
getPathParameter
(
size_t
const
idx);
protected:
friend
class
ResourceResolver
;
void
setQueryParameter
(std::string
const
&name, std::string
const
&value);
void
resetPathParameters
();
void
setPathParameter
(
size_t
idx, std::string
const
&val);
private:
/*
* Parameters in the path of the URL, the actual values for asterisk placeholders
*/
std::vector<std::string> _pathParams;
/*
* HTTP Query parameters, as key-value pairs
*/
std::vector<std::pair<std::string, std::string>> _queryParams;
};
}
/*
namespace httpsserver
*/
#
endif
/*
SRC_RESOURCEPARAMETERS_HPP_
*/
Back
|
FazBrowse Home
|
New Git URL