|
| static size_t | get_split_str (const std::string_view &ori_str, std::string_view &str, const std::string_view &a, const std::string_view &b, const size_t &pos=0) |
| | 从原始字符串中提取两个标记之间的子串。
|
| |
| static std::string_view & | get_value_str (const std::string_view &ori_str, std::string_view &str, const std::string &name) |
| | 从 URL 查询参数中提取指定 key 的值。
|
| |
| static std::string_view & | get_value_header (const std::string_view &ori_str, std::string_view &str, const std::string &name) |
| | 从 HTTP 请求头中提取指定字段的值。
|
| |
| static std::string_view & | get_location_str (const std::string_view &ori_str, std::string_view &str) |
| | 提取 URL 中 path 和 query 部分。
|
| |
| static std::string_view & | getLocPara (const std::string_view &url, std::string_view &locPara) |
| | 提取 URL 的 path 部分(不含 query)。
|
| |
| static std::string_view & | getPara (const std::string_view &url, std::string_view ¶) |
| | 获取 URL 中的查询参数字符串(包括 ?)。
|
| |
| static size_t | get_split_str (const std::string_view &ori_str, std::string &str, const std::string_view &a, const std::string_view &b, const size_t &pos=0) |
| | 从原始字符串中提取两个标记之间的子串。
|
| |
| static std::string & | get_value_str (const std::string &ori_str, std::string &str, const std::string &name) |
| | 从 URL 查询参数中提取指定 key 的值。
|
| |
| static std::string & | get_value_header (const std::string &ori_str, std::string &str, const std::string &name) |
| | 从 HTTP 请求头中提取指定字段的值。
|
| |
| static std::string & | get_location_str (const std::string &ori_str, std::string &str) |
| | 提取 URL 中 path 和 query 部分。
|
| |
| static std::string & | getLocPara (const std::string &url, std::string &locPara) |
| | 提取 URL 的 path 部分(不含 query)。
|
| |
| static std::string & | getPara (const std::string &url, std::string ¶) |
| | 获取 URL 中的查询参数字符串(包括 ?)。
|
| |
| static std::string & | getIP (const std::string &url, std::string &IP) |
| | 从 URL 中提取主机 IP 或域名。
|
| |
| static int & | getPort (const std::string &url, int &port) |
| | 从 URL 中提取端口号。
|
| |
| static std::string | createHeader (const std::string &first, const std::string &second) |
| | 创建一个 HTTP 请求头字段字符串。
|
| |
| template<class... Args> |
| static std::string | createHeader (const std::string &first, const std::string &second, Args... args) |
| | 递归构造多个 HTTP 请求头字段。
|
| |
Lightweight HTTP-string and URL extraction helpers.
Boundaries:- These functions are not a complete URI/HTTP parser and do not URL-decode.
- Query keys are matched on field boundaries, so
id does not match userid. - Header-name matching is case-insensitive.
- The
string_view overloads return non-owning views that must not outlive the input string.