util/IterableSplitString: return std::string_view
This commit is contained in:
parent
ea3f044cd8
commit
02fe857755
@ -38,7 +38,7 @@ CurlEscapeUriPath(CURL *curl, std::string_view src) noexcept
|
||||
std::string dest;
|
||||
|
||||
for (const auto i : IterableSplitString(src, '/')) {
|
||||
CurlString escaped(curl_easy_escape(curl, i.data, i.size));
|
||||
CurlString escaped(curl_easy_escape(curl, i.data(), i.size()));
|
||||
if (!dest.empty())
|
||||
dest.push_back('/');
|
||||
dest += escaped.c_str();
|
||||
|
@ -30,9 +30,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "StringSplit.hxx"
|
||||
#include "StringView.hxx"
|
||||
|
||||
#include <iterator>
|
||||
#include <string_view>
|
||||
|
||||
/**
|
||||
* Split a string at a certain separator character into sub strings
|
||||
@ -47,8 +47,6 @@ class BasicIterableSplitString {
|
||||
using string_view = std::basic_string_view<T>;
|
||||
using value_type = typename string_view::value_type;
|
||||
|
||||
using StringView = BasicStringView<T>;
|
||||
|
||||
string_view s;
|
||||
value_type separator;
|
||||
|
||||
@ -100,11 +98,11 @@ public:
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
constexpr StringView operator*() const noexcept {
|
||||
constexpr string_view operator*() const noexcept {
|
||||
return current;
|
||||
}
|
||||
|
||||
constexpr const StringView *operator->() const noexcept {
|
||||
constexpr const string_view *operator->() const noexcept {
|
||||
return ¤t;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user