From be933ef2241d79558f91796cc5b3a161f72ebf9c Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 19 Oct 2020 00:52:24 +0200 Subject: sync with upstream --- xbmc/utils/EmbeddedArt.h | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 xbmc/utils/EmbeddedArt.h (limited to 'xbmc/utils/EmbeddedArt.h') diff --git a/xbmc/utils/EmbeddedArt.h b/xbmc/utils/EmbeddedArt.h new file mode 100644 index 0000000..b752bac --- /dev/null +++ b/xbmc/utils/EmbeddedArt.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2015-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "IArchivable.h" + +#include +#include +#include + +class EmbeddedArtInfo : public IArchivable +{ +public: + EmbeddedArtInfo() = default; + EmbeddedArtInfo(size_t size, const std::string &mime, const std::string& type = ""); + virtual ~EmbeddedArtInfo() = default; + + // implementation of IArchivable + void Archive(CArchive& ar) override; + + void Set(size_t size, const std::string &mime, const std::string& type = ""); + void Clear(); + bool Empty() const; + bool Matches(const EmbeddedArtInfo &right) const; + void SetType(const std::string& type) { m_type = type; } + + size_t m_size = 0; + std::string m_mime; + std::string m_type; +}; + +class EmbeddedArt : public EmbeddedArtInfo +{ +public: + EmbeddedArt() = default; + EmbeddedArt(const uint8_t *data, size_t size, + const std::string &mime, const std::string& type = ""); + + void Set(const uint8_t *data, size_t size, + const std::string &mime, const std::string& type = ""); + + std::vector m_data; +}; -- cgit v1.2.3