ESP32 HTTPS Server: /home/frank/Projekte/esp32/https_server/esp32_https_server/src/ResourceParameters.hpp Source File

1 #ifndef SRC_RESOURCEPARAMETERS_HPP_

2 #define SRC_RESOURCEPARAMETERS_HPP_

3 

4 #include <Arduino.h>

5 

6 #include <string>

7 

8 #undef min

9 #undef max

10 #include <vector>

11 #include <utility>

12 

13 #include "util.hpp"

14 

16 

17 class ResourceResolver;

18 

32 public:

35 

37  bool getQueryParameter(std::string const &name, std::string &value);

38  std::vector<std::pair<std::string,std::string>>::iterator beginQueryParameters();

39  std::vector<std::pair<std::string,std::string>>::iterator endQueryParameters();

43 

44 protected:

46  void setQueryParameter(std::string const &name, std::string const &value);

47  void resetPathParameters();

48  void setPathParameter(size_t idx, std::string const &val);

49 

50 private:

52  std::vector<std::string> _pathParams;

54  std::vector<std::pair<std::string, std::string>> _queryParams;

55 };

56 

57 }

58 

59 #endif

bool getQueryParameter(std::string const &name, std::string &value)

Returns an HTTP query parameter.

Definition: ResourceParameters.cpp:48

The ResourceParameters provide access to the parameters passed in the URI.

Definition: ResourceParameters.hpp:31

size_t getQueryParameterCount(bool unique=false)

Returns the number of query parameters.

Definition: ResourceParameters.cpp:67

std::vector< std::pair< std::string, std::string > >::iterator beginQueryParameters()

Provides iterator access to the query parameters.

Definition: ResourceParameters.cpp:98

This class is used internally to resolve a string URL to the corresponding HTTPNode.

Definition: ResourceResolver.hpp:22

bool getPathParameter(size_t const idx, std::string &value)

Checks for the existence of a path parameter and returns it as string.

Definition: ResourceParameters.cpp:129

bool isQueryParameterSet(std::string const &name)

Checks whether a specific HTTPS query parameter is set.

Definition: ResourceParameters.cpp:24

std::vector< std::pair< std::string, std::string > >::iterator endQueryParameters()

Counterpart to beginQueryParameters() for iterating over query parameters.

Definition: ResourceParameters.cpp:105

Definition: ConnectionContext.cpp:3