Merge pull request #26220 from 78andyp/blurayfixes
[xbmc.git] / xbmc / utils / EmbeddedArt.h
blobb752bacb6a860bf3086d6e7517bd481d82cca37a
1 /*
2 * Copyright (C) 2015-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "IArchivable.h"
13 #include <stdint.h>
14 #include <string>
15 #include <vector>
17 class EmbeddedArtInfo : public IArchivable
19 public:
20 EmbeddedArtInfo() = default;
21 EmbeddedArtInfo(size_t size, const std::string &mime, const std::string& type = "");
22 virtual ~EmbeddedArtInfo() = default;
24 // implementation of IArchivable
25 void Archive(CArchive& ar) override;
27 void Set(size_t size, const std::string &mime, const std::string& type = "");
28 void Clear();
29 bool Empty() const;
30 bool Matches(const EmbeddedArtInfo &right) const;
31 void SetType(const std::string& type) { m_type = type; }
33 size_t m_size = 0;
34 std::string m_mime;
35 std::string m_type;
38 class EmbeddedArt : public EmbeddedArtInfo
40 public:
41 EmbeddedArt() = default;
42 EmbeddedArt(const uint8_t *data, size_t size,
43 const std::string &mime, const std::string& type = "");
45 void Set(const uint8_t *data, size_t size,
46 const std::string &mime, const std::string& type = "");
48 std::vector<uint8_t> m_data;