21 QString dirPath = QFileInfo(resourceFile).path();
22 QXmlStreamReader reader(content);
23 bool isFileTag =
false;
25 tagStack << QLatin1String(
"RCC") << QLatin1String(
"qresource") << QLatin1String(
"file");
27 while (!reader.atEnd()) {
28 QXmlStreamReader::TokenType t = reader.readNext();
30 case QXmlStreamReader::StartElement:
31 if (curDepth >= tagStack.size() || reader.name() != tagStack.at(curDepth)) {
32 result.errorString = FMT::tr(
"unexpected <%1> tag\n")
33 .arg(reader.name().toString());
34 result.line = reader.lineNumber();
37 if (++curDepth == tagStack.size())
41 case QXmlStreamReader::EndElement:
43 if (curDepth == 0 || reader.name() != tagStack.at(curDepth - 1)) {
44 result.errorString = FMT::tr(
"unexpected closing <%1> tag\n")
45 .arg(reader.name().toString());
46 result.line = reader.lineNumber();
52 case QXmlStreamReader::Characters:
54 QString fn = reader.text().toString();
55 if (!QFileInfo(fn).isAbsolute())
56 fn = dirPath + QLatin1Char(
'/') + fn;
58 if (isSupportedExtension(cfi.suffix()))
59 result.files << cfi.filePath();
67 if (reader.error() != QXmlStreamReader::NoError) {
68 result.errorString = reader.errorString();
69 result.line = reader.lineNumber();