summaryrefslogtreecommitdiffstats
path: root/xbmc/utils/EmbeddedArt.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/utils/EmbeddedArt.h')
-rw-r--r--xbmc/utils/EmbeddedArt.h49
1 files changed, 49 insertions, 0 deletions
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 @@
1/*
2 * Copyright (C) 2015-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#include "IArchivable.h"
12
13#include <stdint.h>
14#include <string>
15#include <vector>
16
17class EmbeddedArtInfo : public IArchivable
18{
19public:
20 EmbeddedArtInfo() = default;
21 EmbeddedArtInfo(size_t size, const std::string &mime, const std::string& type = "");
22 virtual ~EmbeddedArtInfo() = default;
23
24 // implementation of IArchivable
25 void Archive(CArchive& ar) override;
26
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; }
32
33 size_t m_size = 0;
34 std::string m_mime;
35 std::string m_type;
36};
37
38class EmbeddedArt : public EmbeddedArtInfo
39{
40public:
41 EmbeddedArt() = default;
42 EmbeddedArt(const uint8_t *data, size_t size,
43 const std::string &mime, const std::string& type = "");
44
45 void Set(const uint8_t *data, size_t size,
46 const std::string &mime, const std::string& type = "");
47
48 std::vector<uint8_t> m_data;
49};