lib/curl/Escape: use std::string_view instead of StringView
This commit is contained in:
parent
c074338f4c
commit
759da033fc
@ -33,7 +33,7 @@
|
|||||||
#include "util/IterableSplitString.hxx"
|
#include "util/IterableSplitString.hxx"
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
CurlEscapeUriPath(CURL *curl, StringView src) noexcept
|
CurlEscapeUriPath(CURL *curl, std::string_view src) noexcept
|
||||||
{
|
{
|
||||||
std::string dest;
|
std::string dest;
|
||||||
|
|
||||||
@ -48,23 +48,23 @@ CurlEscapeUriPath(CURL *curl, StringView src) noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
CurlEscapeUriPath(StringView src) noexcept
|
CurlEscapeUriPath(std::string_view src) noexcept
|
||||||
{
|
{
|
||||||
CurlEasy easy;
|
CurlEasy easy;
|
||||||
return CurlEscapeUriPath(easy.Get(), src);
|
return CurlEscapeUriPath(easy.Get(), src);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
CurlUnescape(CURL *curl, StringView src) noexcept
|
CurlUnescape(CURL *curl, std::string_view src) noexcept
|
||||||
{
|
{
|
||||||
int outlength;
|
int outlength;
|
||||||
CurlString tmp(curl_easy_unescape(curl, src.data, src.size,
|
CurlString tmp(curl_easy_unescape(curl, src.data(), src.size(),
|
||||||
&outlength));
|
&outlength));
|
||||||
return {tmp.c_str(), size_t(outlength)};
|
return {tmp.c_str(), size_t(outlength)};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
CurlUnescape(StringView src) noexcept
|
CurlUnescape(std::string_view src) noexcept
|
||||||
{
|
{
|
||||||
CurlEasy easy;
|
CurlEasy easy;
|
||||||
return CurlUnescape(easy.Get(), src);
|
return CurlUnescape(easy.Get(), src);
|
||||||
|
@ -33,19 +33,18 @@
|
|||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
struct StringView;
|
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
CurlEscapeUriPath(CURL *curl, StringView src) noexcept;
|
CurlEscapeUriPath(CURL *curl, std::string_view src) noexcept;
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
CurlEscapeUriPath(StringView src) noexcept;
|
CurlEscapeUriPath(std::string_view src) noexcept;
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
CurlUnescape(CURL *curl, StringView src) noexcept;
|
CurlUnescape(CURL *curl, std::string_view src) noexcept;
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
CurlUnescape(StringView src) noexcept;
|
CurlUnescape(std::string_view src) noexcept;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user