File indexing completed on 2024-05-12 15:59:54
0001 /* 0002 * SPDX-FileCopyrightText: 2021 Dmitry Kazakov <dimula73@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #ifndef KOEMBEDDEDRESOURCE_H 0007 #define KOEMBEDDEDRESOURCE_H 0008 0009 #include <KoResourceSignature.h> 0010 0011 0012 /** 0013 * A simple srapper class for a resource that has been embedded into 0014 * another resource. It stores the buffer with the raw resource data, 0015 * so that it could be imported into Krita database without any 0016 * conversions and/or changing MD5 signature of it. 0017 */ 0018 class KRITARESOURCES_EXPORT KoEmbeddedResource 0019 { 0020 public: 0021 KoEmbeddedResource(); 0022 KoEmbeddedResource(const KoResourceSignature &sig, const QByteArray &data); 0023 0024 const KoResourceSignature &signature() const; 0025 QByteArray data() const; 0026 0027 bool sanityCheckMd5() const; 0028 0029 bool isValid() const; 0030 0031 private: 0032 KoResourceSignature m_sig; 0033 QByteArray m_data; 0034 }; 0035 0036 #endif // KOEMBEDDEDRESOURCE_H