lib/xiph/VorbisPicture: use std::string_view instead of StringView

This commit is contained in:
Max Kellermann 2022-05-24 14:24:12 +02:00
parent f045cf43e4
commit 3699514d18
2 changed files with 6 additions and 6 deletions

View File

@ -21,20 +21,19 @@
#include "lib/crypto/Base64.hxx" #include "lib/crypto/Base64.hxx"
#include "tag/Id3Picture.hxx" #include "tag/Id3Picture.hxx"
#include "tag/Handler.hxx" #include "tag/Handler.hxx"
#include "util/StringView.hxx"
#include "config.h" #include "config.h"
#include <memory> #include <memory>
void void
ScanVorbisPicture(StringView value, TagHandler &handler) noexcept ScanVorbisPicture(std::string_view value, TagHandler &handler) noexcept
{ {
#ifdef HAVE_BASE64 #ifdef HAVE_BASE64
if (value.size > 1024 * 1024) if (value.size() > 1024 * 1024)
/* ignore image files which are too huge */ /* ignore image files which are too huge */
return; return;
size_t debase64_size = CalculateBase64OutputSize(value.size); size_t debase64_size = CalculateBase64OutputSize(value.size());
auto debase64_buffer = std::make_unique<std::byte[]>(debase64_size); auto debase64_buffer = std::make_unique<std::byte[]>(debase64_size);
try { try {

View File

@ -20,10 +20,11 @@
#ifndef MPD_VORBIS_PICTURE_HXX #ifndef MPD_VORBIS_PICTURE_HXX
#define MPD_VORBIS_PICTURE_HXX #define MPD_VORBIS_PICTURE_HXX
struct StringView; #include <string_view>
class TagHandler; class TagHandler;
void void
ScanVorbisPicture(StringView value, TagHandler &handler) noexcept; ScanVorbisPicture(std::string_view value, TagHandler &handler) noexcept;
#endif #endif