MCPcopy Create free account
hub / github.com/QNapi/qnapi / listArchiveFiles

Method listArchiveFiles

libqnapi/src/utils/p7zipdecoder.cpp:22–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20 : p7zipPath(p7zipPath), operationTimeoutMsecs(operationTimeoutMsecs) {}
21
22QStringList P7ZipDecoder::listArchiveFiles(const QString& archivePath) const {
23 QString stdoutBuff = readP7ZipOutput({"l", "-slt", archivePath});
24
25#ifdef Q_OS_WIN
26 QRegExp r("\r\nPath = ([^\r\n]*)\r\n");
27#else
28 QRegExp r("\nPath = ([^\n]*)\n");
29#endif
30 r.setPatternSyntax(QRegExp::RegExp2);
31
32 QStringList files;
33 int offset = 0;
34
35 while ((offset = r.indexIn(stdoutBuff, offset)) != -1) {
36 files << r.cap(1);
37 offset += r.matchedLength();
38 }
39
40 return files;
41}
42
43bool P7ZipDecoder::unpackArchiveFile(const QString& archivePath,
44 const QString& filename,

Callers 1

unpackMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected