[PVR][Estuary] Timer settings dialog: Show client name in timer type selection dialog...
[xbmc.git] / xbmc / utils / EmbeddedArt.cpp
blob3af2259daaee179d3ab189786a2a091fc4bc6b8f
1 /*
2 * Copyright (C) 2005-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 #include "EmbeddedArt.h"
11 #include "Archive.h"
13 EmbeddedArtInfo::EmbeddedArtInfo(size_t size,
14 const std::string &mime, const std::string& type)
16 Set(size, mime, type);
19 void EmbeddedArtInfo::Set(size_t size, const std::string &mime, const std::string& type)
21 m_size = size;
22 m_mime = mime;
23 m_type = type;
26 void EmbeddedArtInfo::Clear()
28 m_mime.clear();
29 m_size = 0;
32 bool EmbeddedArtInfo::Empty() const
34 return m_size == 0;
37 bool EmbeddedArtInfo::Matches(const EmbeddedArtInfo &right) const
39 return (m_size == right.m_size &&
40 m_mime == right.m_mime &&
41 m_type == right.m_type);
44 void EmbeddedArtInfo::Archive(CArchive &ar)
46 if (ar.IsStoring())
48 ar << m_size;
49 ar << m_mime;
50 ar << m_type;
52 else
54 ar >> m_size;
55 ar >> m_mime;
56 ar >> m_type;
60 EmbeddedArt::EmbeddedArt(const uint8_t *data, size_t size,
61 const std::string &mime, const std::string& type)
63 Set(data, size, mime, type);
66 void EmbeddedArt::Set(const uint8_t *data, size_t size,
67 const std::string &mime, const std::string& type)
69 EmbeddedArtInfo::Set(size, mime, type);
70 m_data.resize(size);
71 m_data.assign(data, data+size);