lib/xiph/ScanVorbisComment: use std::string_view
This commit is contained in:
parent
96f99aeb8f
commit
9d50306e2f
@ -22,7 +22,7 @@
|
||||
#include "tag/Table.hxx"
|
||||
#include "tag/Handler.hxx"
|
||||
#include "tag/VorbisComment.hxx"
|
||||
#include "util/StringView.hxx"
|
||||
#include "util/StringSplit.hxx"
|
||||
|
||||
/**
|
||||
* Check if the comment's name equals the passed name, and if so, copy
|
||||
@ -43,11 +43,11 @@ vorbis_copy_comment(std::string_view comment,
|
||||
}
|
||||
|
||||
void
|
||||
ScanVorbisComment(StringView comment, TagHandler &handler) noexcept
|
||||
ScanVorbisComment(std::string_view comment, TagHandler &handler) noexcept
|
||||
{
|
||||
if (handler.WantPair()) {
|
||||
const auto split = comment.Split('=');
|
||||
if (!split.first.empty() && !split.second.IsNull())
|
||||
const auto split = Split(comment, '=');
|
||||
if (!split.first.empty() && split.second.data() != nullptr)
|
||||
handler.OnPair(split.first, split.second);
|
||||
}
|
||||
|
||||
|
@ -20,10 +20,11 @@
|
||||
#ifndef MPD_SCAN_VORBIS_COMMENT_HXX
|
||||
#define MPD_SCAN_VORBIS_COMMENT_HXX
|
||||
|
||||
struct StringView;
|
||||
#include <string_view>
|
||||
|
||||
class TagHandler;
|
||||
|
||||
void
|
||||
ScanVorbisComment(StringView comment, TagHandler &handler) noexcept;
|
||||
ScanVorbisComment(std::string_view comment, TagHandler &handler) noexcept;
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user