WPILibC++ 2023.4.3-108-ge5452e3
|
Class for HTTP path matching. More...
#include <wpinet/HttpUtil.h>
Public Member Functions | |
HttpPath ()=default | |
Constructs an empty HTTP path. More... | |
HttpPath (std::string_view path) | |
Constructs a HTTP path from an escaped path string. More... | |
operator bool () const | |
Evaluates to true if the path is not empty. More... | |
bool | empty () const |
Returns true if the path has no elements. More... | |
size_t | size () const |
Returns number of elements in the path. More... | |
bool | equals (std::initializer_list< std::string_view > match) const |
Returns true if the path exactly matches the provided match list. More... | |
bool | equals (std::span< const std::string_view > match) const |
bool | equals (std::string_view match) const |
bool | equals (size_t start, std::initializer_list< std::string_view > match) const |
Returns true if the elements of the path starting at the "start" element match the provided match list, and there are no additional elements. More... | |
bool | equals (size_t start, std::span< const std::string_view > match) const |
bool | equals (size_t start, std::string_view match) const |
bool | startswith (std::initializer_list< std::string_view > match) const |
Returns true if the first elements of the path match the provided match list. More... | |
bool | startswith (std::span< const std::string_view > match) const |
bool | startswith (std::string_view match) const |
bool | startswith (size_t start, std::initializer_list< std::string_view > match) const |
Returns true if the elements of the path starting at the "start" element match the provided match list. More... | |
bool | startswith (size_t start, std::span< const std::string_view > match) const |
bool | startswith (size_t start, std::string_view match) const |
std::string_view | operator[] (size_t n) const |
Gets a single element of the path. More... | |
HttpPathRef | drop_front (size_t n) const |
Returns a path reference with the first N elements of the path removed. More... | |
Class for HTTP path matching.
A root path is represented as a single empty element, otherwise the path consists of each non-empty element between the '/' characters:
All path elements are unescaped.
|
default |
Constructs an empty HTTP path.
|
explicit |
Constructs a HTTP path from an escaped path string.
Makes a copy of the path, so it's safe to be a temporary.
|
inline |
Returns a path reference with the first N elements of the path removed.
|
inline |
Returns true if the path has no elements.
|
inline |
Returns true if the elements of the path starting at the "start" element match the provided match list, and there are no additional elements.
start | element to start matching at |
match | match list |
|
inline |
|
inline |
|
inline |
Returns true if the path exactly matches the provided match list.
match | match list |
|
inline |
|
inline |
|
inlineexplicit |
Evaluates to true if the path is not empty.
std::string_view wpi::HttpPath::operator[] | ( | size_t | n | ) | const |
Gets a single element of the path.
|
inline |
Returns number of elements in the path.
|
inline |
Returns true if the elements of the path starting at the "start" element match the provided match list.
The path may have additional elements.
start | element to start matching at |
match | match list |
bool wpi::HttpPath::startswith | ( | size_t | start, |
std::span< const std::string_view > | match | ||
) | const |
|
inline |
|
inline |
Returns true if the first elements of the path match the provided match list.
The path may have additional elements.
match | match list |
|
inline |
|
inline |