diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index 9fc1710d5..60d3df8c1 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -36,6 +36,7 @@ #include "event/Loop.hxx" #include "util/ASCII.hxx" #include "util/StringFormat.hxx" +#include "util/StringView.hxx" #include "util/NumberParser.hxx" #include "util/Domain.hxx" #include "Log.hxx" diff --git a/src/tag/ReplayGain.cxx b/src/tag/ReplayGain.cxx index bd8d65fda..72fbd54d4 100644 --- a/src/tag/ReplayGain.cxx +++ b/src/tag/ReplayGain.cxx @@ -22,6 +22,7 @@ #include "ReplayGainInfo.hxx" #include "util/ASCII.hxx" #include "util/NumberParser.hxx" +#include "util/StringView.hxx" #include diff --git a/src/tag/Table.cxx b/src/tag/Table.cxx index 4e1bd4958..188cd58bc 100644 --- a/src/tag/Table.cxx +++ b/src/tag/Table.cxx @@ -19,6 +19,7 @@ #include "Table.hxx" #include "util/ASCII.hxx" +#include "util/StringView.hxx" #include diff --git a/src/util/ASCII.hxx b/src/util/ASCII.hxx index ad063db77..df51d8650 100644 --- a/src/util/ASCII.hxx +++ b/src/util/ASCII.hxx @@ -30,10 +30,10 @@ #ifndef ASCII_HXX #define ASCII_HXX -#include "StringView.hxx" #include "Compiler.h" #include +#include #include @@ -73,17 +73,19 @@ StringEqualsCaseASCII(const char *a, const char *b, size_t n) noexcept gcc_pure gcc_nonnull_all static inline bool -StringStartsWithCaseASCII(const char *haystack, StringView needle) noexcept +StringStartsWithCaseASCII(const char *haystack, + std::string_view needle) noexcept { - return StringEqualsCaseASCII(haystack, needle.data, needle.size); + return StringEqualsCaseASCII(haystack, needle.data(), needle.length()); } gcc_pure gcc_nonnull_all static inline const char * -StringAfterPrefixCaseASCII(const char *haystack, StringView needle) noexcept +StringAfterPrefixCaseASCII(const char *haystack, + std::string_view needle) noexcept { return StringStartsWithCaseASCII(haystack, needle) - ? haystack + needle.size + ? haystack + needle.length() : nullptr; }