From ca9dd74fbfd7fc56e5688a099235d75dbdc140a1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 29 Jun 2022 16:48:49 +0200 Subject: [PATCH] tag/Builder: use std::string_view instead of StringView --- src/tag/Builder.cxx | 9 ++++----- src/tag/Builder.hxx | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/tag/Builder.cxx b/src/tag/Builder.cxx index 28241d3ef..6b431196e 100644 --- a/src/tag/Builder.cxx +++ b/src/tag/Builder.cxx @@ -23,7 +23,6 @@ #include "FixString.hxx" #include "Tag.hxx" #include "util/AllocatedArray.hxx" -#include "util/StringView.hxx" #include #include @@ -198,7 +197,7 @@ TagBuilder::Complement(const Tag &other) noexcept } void -TagBuilder::AddItemUnchecked(TagType type, StringView value) noexcept +TagBuilder::AddItemUnchecked(TagType type, std::string_view value) noexcept { TagItem *i; @@ -211,7 +210,7 @@ TagBuilder::AddItemUnchecked(TagType type, StringView value) noexcept } inline void -TagBuilder::AddItemInternal(TagType type, StringView value) noexcept +TagBuilder::AddItemInternal(TagType type, std::string_view value) noexcept { assert(!value.empty()); @@ -223,7 +222,7 @@ TagBuilder::AddItemInternal(TagType type, StringView value) noexcept } void -TagBuilder::AddItem(TagType type, StringView value) noexcept +TagBuilder::AddItem(TagType type, std::string_view value) noexcept { if (value.empty() || !IsTagEnabled(type)) return; @@ -234,7 +233,7 @@ TagBuilder::AddItem(TagType type, StringView value) noexcept void TagBuilder::AddItem(TagType type, const char *value) noexcept { - AddItem(type, StringView(value)); + AddItem(type, std::string_view(value)); } void diff --git a/src/tag/Builder.hxx b/src/tag/Builder.hxx index 3920ec76e..9ab4ea6db 100644 --- a/src/tag/Builder.hxx +++ b/src/tag/Builder.hxx @@ -23,10 +23,10 @@ #include "Type.h" #include "Chrono.hxx" -#include #include +#include +#include -struct StringView; struct TagItem; struct Tag; @@ -137,7 +137,7 @@ public: * A variant of AddItem() which does not attempt to fix up the * value and does not check whether the tag type is disabled. */ - void AddItemUnchecked(TagType type, StringView value) noexcept; + void AddItemUnchecked(TagType type, std::string_view value) noexcept; /** * Appends a new tag item. @@ -146,7 +146,7 @@ public: * @param value the value of the tag item (not null-terminated) * @param length the length of #value */ - void AddItem(TagType type, StringView value) noexcept; + void AddItem(TagType type, std::string_view value) noexcept; /** * Appends a new tag item. @@ -175,7 +175,7 @@ public: void RemoveType(TagType type) noexcept; private: - void AddItemInternal(TagType type, StringView value) noexcept; + void AddItemInternal(TagType type, std::string_view value) noexcept; }; #endif