File indexing completed on 2025-01-05 04:26:48
0001 /* 0002 * Replacement fot QT Bindings that were removed from QT5 0003 * Copyright (C) 2020 Pedro de Carvalho Gomes <pedrogomes81@gmail.com> 0004 * 0005 * This program is free software: you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation, either version 3 of the License, or 0008 * (at your option) any later version. 0009 * 0010 * This program is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0013 * GNU General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU General Public License 0016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0017 */ 0018 0019 #include "CoreResource.h" 0020 0021 #include <QDateTime> 0022 0023 using namespace QtBindings::Core; 0024 0025 0026 Resource::Resource(const QString &file, const QLocale &locale) : QResource(file, locale) 0027 { 0028 } 0029 0030 Resource::Resource(const Resource &resource) : Resource(resource.fileName(), resource.locale()) 0031 { 0032 } 0033 0034 QString Resource::absoluteFilePath() const 0035 { 0036 return QResource::absoluteFilePath(); 0037 } 0038 0039 const uchar *Resource::data() const 0040 { 0041 return QResource::data(); 0042 } 0043 0044 QString Resource::fileName() const 0045 { 0046 return QResource::fileName(); 0047 } 0048 0049 QResource::Compression Resource::compressionAlgorithm() const 0050 { 0051 return QResource::compressionAlgorithm(); 0052 } 0053 0054 bool Resource::isValid() const 0055 { 0056 return QResource::isValid(); 0057 } 0058 0059 QDateTime Resource::lastModified() const 0060 { 0061 return QResource::lastModified(); 0062 } 0063 0064 QLocale Resource::locale() const 0065 { 0066 return QResource::locale(); 0067 } 0068 0069 void Resource::setFileName(const QString &file) 0070 { 0071 QResource::setFileName(file); 0072 } 0073 0074 void Resource::setLocale(const QLocale &locale) 0075 { 0076 QResource::setLocale(locale); 0077 } 0078 0079 qint64 Resource::size() const 0080 { 0081 return QResource::size(); 0082 } 0083 0084 bool Resource::registerResource(const QString &rccFilename, const QString &resourceRoot) 0085 { 0086 return QResource::registerResource(rccFilename,resourceRoot); 0087 } 0088 0089 bool Resource::registerResource(const uchar *rccData, const QString &resourceRoot) 0090 { 0091 return QResource::registerResource(rccData,resourceRoot); 0092 } 0093 0094 bool Resource::unregisterResource(const QString &rccFilename, const QString &resourceRoot) 0095 { 0096 return QResource::unregisterResource(rccFilename,resourceRoot); 0097 } 0098 0099 bool Resource::unregisterResource(const uchar *rccData, const QString &resourceRoot) 0100 { 0101 return QResource::unregisterResource(rccData,resourceRoot); 0102 } 0103 0104 Resource &Resource::operator=(const Resource &other) 0105 { 0106 if (this != &other) { 0107 this->setFileName( other.fileName() ); 0108 this->setLocale( other.locale() ); 0109 } 0110 0111 return *this; 0112 }