lib/curl/Escape: add CurlUnescape()
This commit is contained in:
parent
a8f4d2b6fc
commit
364acc8949
@ -53,3 +53,19 @@ CurlEscapeUriPath(StringView src) noexcept
|
|||||||
CurlEasy easy;
|
CurlEasy easy;
|
||||||
return CurlEscapeUriPath(easy.Get(), src);
|
return CurlEscapeUriPath(easy.Get(), src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
CurlUnescape(CURL *curl, StringView src) noexcept
|
||||||
|
{
|
||||||
|
int outlength;
|
||||||
|
CurlString tmp(curl_easy_unescape(curl, src.data, src.size,
|
||||||
|
&outlength));
|
||||||
|
return std::string(tmp.c_str(), outlength);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
CurlUnescape(StringView src) noexcept
|
||||||
|
{
|
||||||
|
CurlEasy easy;
|
||||||
|
return CurlUnescape(easy.Get(), src);
|
||||||
|
}
|
||||||
|
@ -42,4 +42,10 @@ CurlEscapeUriPath(CURL *curl, StringView src) noexcept;
|
|||||||
std::string
|
std::string
|
||||||
CurlEscapeUriPath(StringView src) noexcept;
|
CurlEscapeUriPath(StringView src) noexcept;
|
||||||
|
|
||||||
|
std::string
|
||||||
|
CurlUnescape(CURL *curl, StringView src) noexcept;
|
||||||
|
|
||||||
|
std::string
|
||||||
|
CurlUnescape(StringView src) noexcept;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user