12#ifndef OPENVPN_HTTP_URLENCODE_H
13#define OPENVPN_HTTP_URLENCODE_H
31 ret.reserve(
str.length() * 2);
45inline std::string
decode(
const std::string &encoded)
57 ret.reserve(encoded.size());
59 for (
auto &c : encoded)
75 throw url_error(std::string(
"decode error after %: ") + encoded);
84 throw url_error(std::string(
"decode error after %: ") + encoded);
85 ret +=
static_cast<unsigned char>((value * 16) + v);
91 throw url_error(std::string(
"decode error: %-encoding item not closed out: ") + encoded);
93 throw url_error(std::string(
"not UTF-8: ") + encoded);
99 std::vector<std::string> list;
100 if (!path.empty() && path[0] ==
'/')
101 path = path.substr(1);
102 Split::by_char_void<decltype(list), NullLex, Split::NullLimit>(list, path,
'/');
#define OPENVPN_EXCEPTION(C)
bool is_escaped(const unsigned char c)
std::string decode(const std::string &encoded)
std::string encode(const std::string &str)
std::vector< std::string > decode_path(std::string path)
bool is_valid_utf8(const STRING &str, const size_t max_len_flags=0)
int parse_hex_char(const int c)
std::string render_hex_number(T value, const bool caps=false)
os<< "Session Name: "<< tbc-> session_name<< '\n';os<< "Layer: "<< tbc-> layer str()<< '\n'