playlist/cue/CueParser: use std::string_view in public API

This commit is contained in:
Max Kellermann 2022-06-30 10:39:42 +02:00
parent 2ba092711f
commit 232084c2f9
2 changed files with 8 additions and 7 deletions

View File

@ -19,8 +19,8 @@
#include "CueParser.hxx"
#include "tag/ParseName.hxx"
#include "util/StringView.hxx"
#include "util/CharUtil.hxx"
#include "util/StringView.hxx"
#include <algorithm>
#include <cassert>
@ -110,7 +110,7 @@ CueParser::GetCurrentTag() noexcept
}
static bool
IsDigit(StringView s) noexcept
IsDigit(std::string_view s) noexcept
{
return !s.empty() && IsDigitASCII(s.front());
}
@ -174,10 +174,12 @@ CueParser::Commit() noexcept
}
void
CueParser::Feed(StringView src) noexcept
CueParser::Feed(std::string_view _src) noexcept
{
assert(!end);
StringView src{_src};
auto command = cue_next_token(src);
if (command == nullptr)
return;

View File

@ -24,10 +24,9 @@
#include "tag/Builder.hxx"
#include "util/Compiler.h"
#include <string>
#include <memory>
struct StringView;
#include <string>
#include <string_view>
class CueParser {
enum {
@ -106,7 +105,7 @@ public:
* Feed a text line from the CUE file into the parser. Call
* Get() after this to see if a song has been finished.
*/
void Feed(StringView line) noexcept;
void Feed(std::string_view line) noexcept;
/**
* Tell the parser that the end of the file has been reached. Call