38void RCCResourceLibrary::write(
const char *
str,
int len)
47 if (m_format ==
Pass2) {
83 int compressThreshold,
bool noZstd,
bool isEmpty);
120 int compressThreshold,
bool noZstd,
bool isEmpty)
123 m_territory(territory),
125 m_fileInfo(fileInfo),
126 m_compressAlgo(compressAlgo),
127 m_compressLevel(compressLevel),
128 m_compressThreshold(compressThreshold),
143 resource = resource.
prepend(
p->m_name + u
'/');
156 lib.writeString(
" // ");
158 lib.writeString(
" [");
160 lib.writeString(
"::");
162 lib.writeString(
"[\n ");
164 lib.writeString(
" // ");
166 lib.writeString(
"\n ");
200 lib.writeString(
"\\\n");
206 static const quint64 sourceDate = 1000 *
qgetenv(
"QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong();
208 lastmod = sourceDate;
209 static const quint64 sourceDate2 = 1000 *
qgetenv(
"SOURCE_DATE_EPOCH").toULongLong();
210 if (sourceDate2 != 0)
211 lastmod = sourceDate2;
212 lib.writeNumber8(lastmod);
216 lib.writeString(
"\\\n");
245 if (
data.size() != 0) {
252 if (lib.m_zstdCCtx ==
nullptr)
253 lib.m_zstdCCtx = ZSTD_createCCtx();
258 if (compressLevel < 0)
263 size_t n = ZSTD_compressCCtx(lib.m_zstdCCtx,
dst,
size,
270 n = ZSTD_compressCCtx(lib.m_zstdCCtx,
dst,
size,
274 if (ZSTD_isError(
n)) {
294#ifndef QT_NO_COMPRESS
323 lib.writeString(
" // ");
325 lib.writeString(
"\n ");
330 lib.writeNumber4(
data.size());
332 lib.writeString(
"\n ");
334 lib.writeString(
"\\\n");
338 const char *
p =
data.constData();
339 if (
text || python) {
340 for (
int i =
data.size(),
j = 0; --
i >= 0; --
j) {
344 lib.writeString(
"\n ");
346 lib.writeString(
"\\\n");
350 }
else if (
binary || pass2) {
351 lib.writeByteArray(
data);
357 lib.writeString(
"\n ");
359 lib.writeString(
"\\\n");
375 lib.writeString(
" // ");
377 lib.writeString(
"\n ");
383 lib.writeString(
"\n ");
385 lib.writeString(
"\\\n");
391 lib.writeString(
"\n ");
393 lib.writeString(
"\\\n");
399 lib.writeNumber2(unicode[
i].unicode());
400 if ((
text || pass1) &&
i % 16 == 0)
401 lib.writeString(
"\n ");
402 else if (python &&
i % 16 == 0)
403 lib.writeString(
"\\\n");
409 lib.writeString(
"\n ");
411 lib.writeString(
"\\\n");
423RCCResourceLibrary::Strings::Strings() :
425 TAG_RESOURCE(
"qresource"_L1),
427 ATTRIBUTE_LANG(
"lang"_L1),
428 ATTRIBUTE_PREFIX(
"prefix"_L1),
429 ATTRIBUTE_ALIAS(
"alias"_L1),
430 ATTRIBUTE_EMPTY(
"empty"_L1),
431 ATTRIBUTE_THRESHOLD(
"threshold"_L1),
432 ATTRIBUTE_COMPRESS(
"compress"_L1),
437RCCResourceLibrary::RCCResourceLibrary(
quint8 formatVersion)
451 m_formatVersion(formatVersion),
454 m_out.
reserve(30 * 1000 * 1000);
456 m_zstdCCtx =
nullptr;
464 ZSTD_freeCCtx(m_zstdCCtx);
486bool RCCResourceLibrary::interpretResourceFile(
QIODevice *inputDevice,
490 const QChar slash = u
'/';
492 currentPath += slash;
494 QXmlStreamReader
reader(inputDevice);
495 QStack<RCCXmlTag> tokens;
502 auto compressAlgo = m_compressionAlgo;
507 QXmlStreamReader::TokenType
t =
reader.readNext();
509 case QXmlStreamReader::StartElement:
510 if (
reader.name() == m_strings.TAG_RCC) {
511 if (!tokens.isEmpty())
512 reader.raiseError(
"expected <RCC> tag"_L1);
515 }
else if (
reader.name() == m_strings.TAG_RESOURCE) {
516 if (tokens.isEmpty() || tokens.top() !=
RccTag) {
517 reader.raiseError(
"unexpected <RESOURCE> tag"_L1);
521 QXmlStreamAttributes attributes =
reader.attributes();
525 if (attributes.hasAttribute(m_strings.ATTRIBUTE_LANG)) {
538 if (attributes.hasAttribute(m_strings.ATTRIBUTE_PREFIX))
539 prefix = attributes.value(m_strings.ATTRIBUTE_PREFIX).toString();
545 }
else if (
reader.name() == m_strings.TAG_FILE) {
546 if (tokens.isEmpty() || tokens.top() !=
ResourceTag) {
547 reader.raiseError(
"unexpected <FILE> tag"_L1);
551 QXmlStreamAttributes attributes =
reader.attributes();
553 if (attributes.hasAttribute(m_strings.ATTRIBUTE_ALIAS))
554 alias = attributes.value(m_strings.ATTRIBUTE_ALIAS).toString();
556 compressAlgo = m_compressionAlgo;
561 if (attributes.hasAttribute(m_strings.ATTRIBUTE_EMPTY))
562 empty =
parseBoolean(attributes.value(m_strings.ATTRIBUTE_EMPTY), &errorString);
566 if (attributes.hasAttribute(m_strings.ATTRIBUTE_COMPRESSALGO))
568 if (
errorString.isEmpty() && attributes.hasAttribute(m_strings.ATTRIBUTE_COMPRESS)) {
569 QString value = attributes.value(m_strings.ATTRIBUTE_COMPRESS).toString();
574 if (m_compressLevel == -2)
577 if (attributes.hasAttribute(m_strings.ATTRIBUTE_THRESHOLD))
578 compressThreshold = attributes.value(m_strings.ATTRIBUTE_THRESHOLD).toString().toInt();
581 reader.raiseError(errorString);
584 reader.raiseError(
"unexpected tag: %1"_L1.arg(
reader.name().toString()));
588 case QXmlStreamReader::EndElement:
589 if (
reader.name() == m_strings.TAG_RCC) {
590 if (!tokens.isEmpty() && tokens.top() ==
RccTag)
593 reader.raiseError(
"unexpected closing tag"_L1);
594 }
else if (
reader.name() == m_strings.TAG_RESOURCE) {
595 if (!tokens.isEmpty() && tokens.top() ==
ResourceTag)
598 reader.raiseError(
"unexpected closing tag"_L1);
599 }
else if (
reader.name() == m_strings.TAG_FILE) {
600 if (!tokens.isEmpty() && tokens.top() ==
FileTag)
603 reader.raiseError(
"unexpected closing tag"_L1);
607 case QXmlStreamReader::Characters:
608 if (
reader.isWhitespace())
610 if (tokens.isEmpty() || tokens.top() !=
FileTag) {
611 reader.raiseError(
"unexpected text"_L1);
629 absFileName.
prepend(currentPath);
633 if (!alias.endsWith(slash))
642 filePaths.emplace_back(
entry.filePath());
646 std::sort(filePaths.begin(), filePaths.end());
648 for (
const QString &filePath : filePaths) {
651 addFile(alias +
child.fileName(),
658 m_failedResources.push_back(
child.fileName());
660 }
else if (listMode ||
file.isFile()) {
674 m_failedResources.push_back(absFileName);
676 m_failedResources.push_back(absFileName);
682 m_failedResources.push_back(absFileName);
697 int errorLine =
reader.lineNumber();
698 int errorColumn =
reader.columnNumber();
705 if (m_root ==
nullptr) {
708 if (!listMode && m_format ==
Binary) {
721 if (
file.m_fileInfo.
size() > 0xffffffff) {
733 for (
int i = 1;
i < nodes.size()-1; ++
i) {
741 s->m_parent = parent;
749 const QString filename = nodes.at(nodes.size()-1);
751 s->m_parent = parent;
755 if (
it.key() == filename &&
it.value()->m_language ==
s->m_language &&
756 it.value()->m_territory ==
s->m_territory) {
758 qWarning(
"%s: Warning: potential duplicate alias detected: '%s'",
768void RCCResourceLibrary::reset()
774 m_errorDevice =
nullptr;
775 m_failedResources.clear();
782 m_errorDevice = &errorDevice;
786 .arg(m_fileNames.size()).arg(
static_cast<int>(listMode));
789 for (
int i = 0;
i < m_fileNames.size(); ++
i) {
793 if (fname ==
"-"_L1) {
794 fname =
"(stdin)"_L1;
796 fileIn.setFileName(fname);
803 fileIn.setFileName(fname);
814 if (!interpretResourceFile(&fileIn, fname, pwd, listMode))
830 for (
auto it =
file->m_children.begin();
831 it !=
file->m_children.end(); ++
it) {
836 ret.append(
child->m_fileInfo.filePath());
845 const QChar slash = u
'/';
853 m.insert(childName,
child->m_fileInfo.filePath());
868 if (
value ==
"best"_L1)
870 if (
value ==
"zlib"_L1) {
872 *errorMsg =
"zlib support not compiled in"_L1;
876 }
else if (
value ==
"zstd"_L1) {
880 *errorMsg =
"Zstandard support not compiled in"_L1;
882 }
else if (
value !=
"none"_L1) {
899 if (
c >= 1 &&
c <= 9)
904 if (
c >= 0 &&
c <= ZSTD_maxCLevel())
917 m_errorDevice = &errorDevice;
919 if (m_format ==
Pass2) {
920 const char pattern[] = {
'Q',
'R',
'C',
'_',
'D',
'A',
'T',
'A' };
921 bool foundSignature =
false;
925 for (
int i = 0;
i < 8; ) {
926 if (!tempDevice.getChar(&
c)) {
929 m_errorDevice->
write(
"No data signature found\n");
934 for (
int k = 0; k <
i; ++k)
946 m_outDevice = &outDevice;
951 tempDevice.seek(tempDevice.pos() +
len - 8);
952 foundSignature =
true;
958 m_errorDevice->
write(
"Outputting code\n");
959 if (!writeHeader()) {
960 m_errorDevice->
write(
"Could not write header\n");
964 if (!writeDataBlobs()) {
965 m_errorDevice->
write(
"Could not write data blobs.\n");
968 if (!writeDataNames()) {
969 m_errorDevice->
write(
"Could not write file names\n");
972 if (!writeDataStructure()) {
973 m_errorDevice->
write(
"Could not write data tree\n");
977 if (!writeInitializer()) {
978 m_errorDevice->
write(
"Could not write footer\n");
985void RCCResourceLibrary::writeDecimal(
int value)
988 char buf[std::numeric_limits<int>::digits10 + 2];
995inline void RCCResourceLibrary::write2HexDigits(
quint8 number)
1001void RCCResourceLibrary::writeHex(
quint8 tmp)
1005 if (tmp >= 32 && tmp < 127 && tmp !=
'"' && tmp !=
'\\') {
1006 writeChar(
char(tmp));
1010 write2HexDigits(tmp);
1019 write2HexDigits(tmp);
1088bool RCCResourceLibrary::writeHeader()
1093 writeString(
"/****************************************************************************\n");
1094 writeString(
"** Resource object code\n");
1095 writeString(
"**\n");
1096 writeString(
"** Created by: The Resource Compiler for Qt version ");
1097 writeByteArray(QT_VERSION_STR);
1098 writeString(
"\n**\n");
1099 writeString(
"** WARNING! All changes made in this file will be lost!\n");
1100 writeString(
"*****************************************************************************/\n\n");
1101 writeString(
"#ifdef _MSC_VER\n"
1102 "// disable informational message \"function ... selected for automatic inline expansion\"\n"
1103 "#pragma warning (disable: 4711)\n"
1107 writeString(
"# Resource object code (Python 3)\n");
1108 writeString(
"# Created by: object code\n");
1109 writeString(
"# Created by: The Resource Compiler for Qt version ");
1110 writeByteArray(QT_VERSION_STR);
1112 writeString(
"# WARNING! All changes made in this file will be lost!\n\n");
1113 writeString(
"from PySide");
1115 writeString(
" import QtCore\n\n");
1118 writeString(
"qres");
1123 if (m_formatVersion >= 3)
1124 writeNumber4(m_overallFlags);
1132bool RCCResourceLibrary::writeDataBlobs()
1137 writeString(
"static const unsigned char qt_resource_data[] = {\n");
1140 writeString(
"qt_resource_data = b\"\\\n");
1143 m_dataOffset = m_out.
size();
1158 for (
auto it =
file->m_children.cbegin();
it !=
file->m_children.cend(); ++
it) {
1173 writeString(
"\n};\n\n");
1176 writeString(
"\"\n\n");
1181 writeString(
"\nstatic const unsigned char qt_resource_data[");
1183 writeString(
"] = { 'Q', 'R', 'C', '_', 'D', 'A', 'T', 'A' };\n\n");
1191bool RCCResourceLibrary::writeDataNames()
1196 writeString(
"static const unsigned char qt_resource_name[] = {\n");
1199 writeString(
"qt_resource_name = b\"\\\n");
1202 m_namesOffset = m_out.
size();
1208 QHash<QString, int>
names;
1218 for (
auto it =
file->m_children.cbegin();
it !=
file->m_children.cend(); ++
it) {
1233 writeString(
"\n};\n\n");
1236 writeString(
"\"\n\n");
1253bool RCCResourceLibrary::writeDataStructure()
1258 writeString(
"static const unsigned char qt_resource_struct[] = {\n");
1261 writeString(
"qt_resource_struct = b\"\\\n");
1264 m_treeOffset = m_out.
size();
1283 QList<RCCFileInfo*> m_children =
file->m_children.values();
1287 for (
int i = 0;
i < m_children.size(); ++
i) {
1302 QList<RCCFileInfo*> m_children =
file->m_children.values();
1306 for (
int i = 0;
i < m_children.size(); ++
i) {
1308 child->writeDataInfo(*
this);
1316 writeString(
"\n};\n\n");
1319 writeString(
"\"\n\n");
1328void RCCResourceLibrary::writeMangleNamespaceFunction(
const QByteArray &
name)
1330 if (m_useNameSpace) {
1331 writeString(
"QT_RCC_MANGLE_NAMESPACE(");
1332 writeByteArray(
name);
1335 writeByteArray(
name);
1339void RCCResourceLibrary::writeAddNamespaceFunction(
const QByteArray &
name)
1341 if (m_useNameSpace) {
1342 writeString(
"QT_RCC_PREPEND_NAMESPACE(");
1343 writeByteArray(
name);
1346 writeByteArray(
name);
1350bool RCCResourceLibrary::writeInitializer()
1354 QString initNameStr = m_initName;
1355 if (!initNameStr.isEmpty()) {
1359 return (
ch >=
'0' &&
ch <=
'9') ||
1360 (
ch >=
'A' &&
ch <=
'Z') ||
1361 (
ch >=
'a' &&
ch <=
'z') ||
1364 for (
QChar &
c : initNameStr) {
1372 if (m_useNameSpace) {
1373 writeString(
"#ifdef QT_NAMESPACE\n"
1374 "# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name\n"
1375 "# define QT_RCC_MANGLE_NAMESPACE0(x) x\n"
1376 "# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b\n"
1377 "# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b)\n"
1378 "# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \\\n"
1379 " QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE))\n"
1381 "# define QT_RCC_PREPEND_NAMESPACE(name) name\n"
1382 "# define QT_RCC_MANGLE_NAMESPACE(name) name\n"
1385 writeString(
"#if defined(QT_INLINE_NAMESPACE)\n"
1386 "inline namespace QT_NAMESPACE {\n"
1387 "#elif defined(QT_NAMESPACE)\n"
1388 "namespace QT_NAMESPACE {\n"
1393 writeString(
"bool qRegisterResourceData"
1394 "(int, const unsigned char *, "
1395 "const unsigned char *, const unsigned char *);\n");
1396 writeString(
"bool qUnregisterResourceData"
1397 "(int, const unsigned char *, "
1398 "const unsigned char *, const unsigned char *);\n\n");
1402 writeString(
"#if defined(__ELF__) || defined(__APPLE__)\n");
1404 writeString(
"static inline unsigned char qResourceFeatureZlib()\n"
1406 " extern const unsigned char qt_resourceFeatureZlib;\n"
1407 " return qt_resourceFeatureZlib;\n"
1411 writeString(
"static inline unsigned char qResourceFeatureZstd()\n"
1413 " extern const unsigned char qt_resourceFeatureZstd;\n"
1414 " return qt_resourceFeatureZstd;\n"
1417 writeString(
"#else\n");
1419 writeString(
"unsigned char qResourceFeatureZlib();\n");
1421 writeString(
"unsigned char qResourceFeatureZstd();\n");
1422 writeString(
"#endif\n\n");
1427 writeString(
"#ifdef QT_NAMESPACE\n}\n#endif\n\n");
1433 writeString(
"int ");
1435 writeString(
"();\n");
1437 writeString(
"int ");
1439 writeString(
"()\n{\n");
1442 writeString(
" int version = ");
1443 writeDecimal(m_formatVersion);
1444 writeString(
";\n ");
1445 writeAddNamespaceFunction(
"qRegisterResourceData");
1446 writeString(
"\n (version, qt_resource_struct, "
1447 "qt_resource_name, qt_resource_data);\n");
1449 writeString(
" return 1;\n");
1450 writeString(
"}\n\n");
1453 QByteArray cleanResources =
"qCleanupResources";
1457 writeString(
"int ");
1458 writeMangleNamespaceFunction(cleanResources);
1459 writeString(
"();\n");
1461 writeString(
"int ");
1462 writeMangleNamespaceFunction(cleanResources);
1463 writeString(
"()\n{\n");
1465 writeString(
" int version = ");
1466 writeDecimal(m_formatVersion);
1467 writeString(
";\n ");
1471 writeString(
"version += ");
1472 writeAddNamespaceFunction(
"qResourceFeatureZlib()");
1473 writeString(
";\n ");
1476 writeString(
"version += ");
1477 writeAddNamespaceFunction(
"qResourceFeatureZstd()");
1478 writeString(
";\n ");
1481 writeAddNamespaceFunction(
"qUnregisterResourceData");
1482 writeString(
"\n (version, qt_resource_struct, "
1483 "qt_resource_name, qt_resource_data);\n");
1485 writeString(
" return 1;\n");
1486 writeString(
"}\n\n");
1489 writeString(
"#ifdef __clang__\n"
1490 "# pragma clang diagnostic push\n"
1491 "# pragma clang diagnostic ignored \"-Wexit-time-destructors\"\n"
1494 writeString(
"namespace {\n"
1495 " struct initializer {\n");
1497 if (m_useNameSpace) {
1498 writeByteArray(
" initializer() { QT_RCC_MANGLE_NAMESPACE(" +
initResources +
")(); }\n"
1499 " ~initializer() { QT_RCC_MANGLE_NAMESPACE(" + cleanResources +
")(); }\n");
1501 writeByteArray(
" initializer() { " +
initResources +
"(); }\n"
1502 " ~initializer() { " + cleanResources +
"(); }\n");
1504 writeString(
" } dummy;\n"
1507 writeString(
"#ifdef __clang__\n"
1508 "# pragma clang diagnostic pop\n"
1512 }
else if (m_format ==
Binary) {
1514 char *
p = m_out.
data();
1518 p[
i++] = m_formatVersion;
1520 p[
i++] = (m_treeOffset >> 24) & 0xff;
1521 p[
i++] = (m_treeOffset >> 16) & 0xff;
1522 p[
i++] = (m_treeOffset >> 8) & 0xff;
1523 p[
i++] = (m_treeOffset >> 0) & 0xff;
1525 p[
i++] = (m_dataOffset >> 24) & 0xff;
1526 p[
i++] = (m_dataOffset >> 16) & 0xff;
1527 p[
i++] = (m_dataOffset >> 8) & 0xff;
1528 p[
i++] = (m_dataOffset >> 0) & 0xff;
1530 p[
i++] = (m_namesOffset >> 24) & 0xff;
1531 p[
i++] = (m_namesOffset >> 16) & 0xff;
1532 p[
i++] = (m_namesOffset >> 8) & 0xff;
1533 p[
i++] = (m_namesOffset >> 0) & 0xff;
1535 if (m_formatVersion >= 3) {
1536 p[
i++] = (m_overallFlags >> 24) & 0xff;
1537 p[
i++] = (m_overallFlags >> 16) & 0xff;
1538 p[
i++] = (m_overallFlags >> 8) & 0xff;
1539 p[
i++] = (m_overallFlags >> 0) & 0xff;
1542 writeString(
"def qInitResources():\n");
1543 writeString(
" QtCore.qRegisterResourceData(0x");
1544 write2HexDigits(m_formatVersion);
1545 writeString(
", qt_resource_struct, qt_resource_name, qt_resource_data)\n\n");
1546 writeString(
"def qCleanupResources():\n");
1547 writeString(
" QtCore.qUnregisterResourceData(0x");
1548 write2HexDigits(m_formatVersion);
1549 writeString(
", qt_resource_struct, qt_resource_name, qt_resource_data)\n\n");
1550 writeString(
"qInitResources()\n");
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
void reserve(qsizetype size)
Attempts to allocate memory for at least size bytes.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
QByteArray & append(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
\inmodule QtCore\reentrant
qint64 toMSecsSinceEpoch() const
bool isValid() const
Returns true if this datetime represents a definite moment, otherwise false.
The QDirListing class provides an STL-style iterator for directory entries.
IteratorFlag
This enum class describes flags can be used to configure the behavior of QDirListing.
static bool isRelativePath(const QString &path)
Returns true if path is relative; returns false if it is absolute.
static QString cleanPath(const QString &path)
Returns path with directory separators normalized (that is, platform-native separators converted to "...
static QString currentPath()
Returns the absolute path of the application's current directory.
QDateTime lastModified() const
Returns the date and time when the file was last modified.
QString absoluteFilePath() const
QString path() const
Returns the path of the file system entry this QFileInfo refers to, excluding the entry's name.
QFILE_MAYBE_NODISCARD bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
bool exists() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
qint64 size() const override
\reimp
\inmodule QtCore \reentrant
virtual qint64 pos() const
For random-access devices, this function returns the position that data is written to or read from.
bool putChar(char c)
Writes the character c to the device.
QByteArray readAll()
Reads all remaining data from the device, and returns it as a byte array.
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
QString errorString() const
Returns a human-readable description of the last device error that occurred.
QString errorString() const
Returns a human readable description of the last error that occurred.
QString text(const QString &key) const
Language language() const
Returns the language of this locale.
static QLocale c()
Returns a QLocale object initialized to the "C" locale.
Territory territory() const
const_iterator constBegin() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
bool contains(const Key &key) const noexcept
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
qsizetype size() const noexcept
const_iterator constFind(const Key &key) const noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toLatin1() const &
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
void clear()
Clears the contents of the string and makes it null.
bool isNull() const
Returns true if this string is null; otherwise returns false.
qsizetype size() const noexcept
Returns the number of characters in this string.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
QByteArray toLocal8Bit() const &
QString & remove(qsizetype i, qsizetype len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
QByteArray toUtf8() const &
QString & prepend(QChar c)
const QChar * unicode() const
Returns a Unicode representation of the string.
RCCFileInfo & operator=(RCCFileInfo &&other)=delete
RCCFileInfo & operator=(const RCCFileInfo &)=delete
RCCResourceLibrary::CompressionAlgorithm m_compressAlgo
qint64 writeDataName(RCCResourceLibrary &, qint64 offset)
RCCFileInfo(RCCFileInfo &&)=default
QLocale::Language m_language
qint64 writeDataBlob(RCCResourceLibrary &lib, qint64 offset, QString *errorMessage)
QString resourceName() const
QMultiHash< QString, RCCFileInfo * > m_children
void writeDataInfo(RCCResourceLibrary &lib)
RCCFileInfo(const RCCFileInfo &)=delete
QLocale::Territory m_territory
ResourceDataFileMap resourceDataFileMap() const
bool readFiles(bool listMode, QIODevice &errorDevice)
QStringList dataFiles() const
int formatVersion() const
static int parseCompressionLevel(CompressionAlgorithm algo, const QString &level, QString *errorMsg)
int compressLevel() const
bool output(QIODevice &outDevice, QIODevice &tempDevice, QIODevice &errorDevice)
int compressThreshold() const
static CompressionAlgorithm parseCompressionAlgorithm(QStringView algo, QString *errorMsg)
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
const PluginKeyMapConstIterator cend
Combined button and popup list for selecting options.
constexpr bool isAsciiLetterOrNumber(char32_t c) noexcept
constexpr Initialization Uninitialized
QImageReader reader("image.png")
[1]
QByteArray qCompress(const uchar *data, qsizetype nbytes, int compressionLevel)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage return DBusPendingCall * pending
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
EGLOutputLayerEXT EGLint attribute
uint qt_hash(QStringView key, uint chained) noexcept
GLsizei GLsizei GLenum void * binary
GLenum GLuint GLint level
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLuint GLintptr offset
GLsizei const GLchar *const * path
static void initResources()
#define qPrintable(string)
static char * toLocal8Bit(char *out, QStringView in, QStringConverter::State *state)
#define QStringLiteral(str)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
unsigned long long quint64
static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &errorSource, qsizetype errorPosition)
static bool parseBoolean(QStringView value, QString *errorMsg)
@ CONSTANT_COMPRESSLEVEL_DEFAULT
@ CONSTANT_ZSTDCOMPRESSLEVEL_STORE
@ CONSTANT_COMPRESSTHRESHOLD_DEFAULT
@ CONSTANT_ZSTDCOMPRESSLEVEL_CHECK
static QString msgOpenReadFailed(const QString &fname, const QString &why)
static const char hexDigits[]
static void resourceDataFileMapRecursion(const RCCFileInfo *m_root, const QString &path, RCCResourceLibrary::ResourceDataFileMap &m)
result_type operator()(const RCCFileInfo *left, const RCCFileInfo *right) const