![]() |
Qt 6.x
The Qt SDK
|
#include <QStringList>
#include <QMap>
#include <QtCore/QFile>
#include <QtCore/QDir>
#include <QtCore/QDateTime>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonObject>
#include <QtCore/QJsonDocument>
#include <iostream>
Go to the source code of this file.
Classes | |
class | JsonOutput |
class | NameFilterFileEntryFunction |
Enumerations | |
enum | PlatformFlag { WindowsBased = 0x00001 , UnixBased = 0x00002 , IntelBased = 0x00010 , ArmBased = 0x00020 , Msvc = 0x00100 , MinGW = 0x00200 , ClangMsvc = 0x00400 , ClangMinGW = 0x00800 , WindowsDesktopMsvc = WindowsBased + IntelBased + Msvc , WindowsDesktopMinGW = WindowsBased + IntelBased + MinGW , WindowsDesktopClangMsvc = WindowsBased + IntelBased + ClangMsvc , WindowsDesktopClangMinGW = WindowsBased + IntelBased + ClangMinGW , Unix = UnixBased , UnknownPlatform } |
enum | ListOption { ListNone = 0 , ListSource , ListTarget , ListRelative , ListMapping } |
enum | DebugMatchMode { MatchDebug , MatchRelease , MatchDebugOrRelease } |
enum | UpdateFileFlag { ForceUpdateFile = 0x1 , SkipUpdateFile = 0x2 , RemoveEmptyQmlDirectories = 0x4 , SkipQmlDesignerSpecificsDirectories = 0x8 } |
Functions | |
bool | platformHasDebugSuffix (Platform p) |
std::wostream & | operator<< (std::wostream &str, const QString &s) |
QString | normalizeFileName (const QString &name) |
QString | sharedLibrarySuffix (Platform platform) |
bool | isBuildDirectory (Platform platform, const QString &dirName) |
bool | createSymbolicLink (const QFileInfo &source, const QString &target, QString *errorMessage) |
bool | createDirectory (const QString &directory, QString *errorMessage, bool dryRun) |
QString | findInPath (const QString &file) |
QMap< QString, QString > | queryQtPaths (const QString &qmakeBinary, QString *errorMessage) |
QStringList | findSharedLibraries (const QDir &directory, Platform platform, DebugMatchMode debugMatchMode, const QString &prefix=QString()) |
bool | updateFile (const QString &sourceFileName, const QStringList &nameFilters, const QString &targetDirectory, unsigned flags, JsonOutput *json, QString *errorMessage) |
bool | runProcess (const QString &binary, const QStringList &args, const QString &workingDirectory=QString(), unsigned long *exitCode=0, QByteArray *stdOut=0, QByteArray *stdErr=0, QString *errorMessage=0) |
bool | readPeExecutable (const QString &peExecutableFileName, QString *errorMessage, QStringList *dependentLibraries=0, unsigned *wordSize=0, bool *isDebug=0, bool isMinGW=false, unsigned short *machineArch=nullptr) |
bool | readElfExecutable (const QString &elfExecutableFileName, QString *errorMessage, QStringList *dependentLibraries=0, unsigned *wordSize=0, bool *isDebug=0) |
bool | readExecutable (const QString &executableFileName, Platform platform, QString *errorMessage, QStringList *dependentLibraries=0, unsigned *wordSize=0, bool *isDebug=0, unsigned short *machineArch=nullptr) |
QStringList | findDependentLibraries (const QString &executableFileName, Platform platform, QString *errorMessage) |
QString | findD3dCompiler (Platform platform, const QString &qtBinDir, unsigned wordSize) |
QStringList | findDxc (Platform platform, const QString &qtBinDir, unsigned wordSize) |
bool | patchQtCore (const QString &path, QString *errorMessage) |
template<class DirectoryFileEntryFunction > | |
bool | updateFile (const QString &sourceFileName, DirectoryFileEntryFunction directoryFileEntryFunction, const QString &targetDirectory, unsigned flags, JsonOutput *json, QString *errorMessage) |
bool | updateFile (const QString &sourceFileName, const QString &targetDirectory, unsigned flags, JsonOutput *json, QString *errorMessage) |
Variables | |
static const char | windowsSharedLibrarySuffix [] = ".dll" |
static const char | unixSharedLibrarySuffix [] = ".so" |
const char * | qmakeInfixKey |
int | optVerboseLevel |
enum DebugMatchMode |
enum ListOption |
enum PlatformFlag |
enum UpdateFileFlag |
Definition at line 65 of file utils.cpp.
References QString::arg(), arg, dir, directory, errorMessage(), QFileInfo::exists(), fi, QString::fromLatin1(), QFileInfo::isDir(), optVerboseLevel, and QDir::toNativeSeparators().
Referenced by deploy(), deployWebEngineCore(), and main().
bool createSymbolicLink | ( | const QFileInfo & | source, |
const QString & | target, | ||
QString * | errorMessage | ||
) |
Definition at line 46 of file utils.cpp.
References QString::arg(), QDir::currentPath(), errorMessage(), QIODevice::errorString(), file, QString::fromLatin1(), QFile::link(), QStringLiteral, QDir::setCurrent(), and QDir::toNativeSeparators().
Referenced by updateFile().
|
inline |
Definition at line 196 of file utils.h.
References errorMessage(), platform(), and readExecutable().
Referenced by deploy().
QStringList findDxc | ( | Platform | platform, |
const QString & | qtBinDir, | ||
unsigned | wordSize | ||
) |
Definition at line 2597 of file main.cpp.
References QDir::cleanPath(), QFileInfo::exists(), file, fileName, QStandardPaths::findExecutable(), QString::fromLocal8Bit(), QString::fromWCharArray(), QFileInfo::isExecutable(), QFileInfo::isFile(), MAX_PATH, qgetenv(), and QFile::size().
Referenced by deploy(), findMinGWRuntimePaths(), and signAAB().
QStringList findSharedLibraries | ( | const QDir & | directory, |
Platform | platform, | ||
DebugMatchMode | debugMatchMode, | ||
const QString & | prefix = QString() |
||
) |
Definition at line 89 of file utils.cpp.
References directory, errorMessage(), QDir::Files, QString::isEmpty(), MatchDebug, MatchDebugOrRelease, matches(), platform(), platformHasDebugSuffix(), readPeExecutable(), sharedLibrarySuffix(), QDir::toNativeSeparators(), WindowsBased, and WindowsDesktopMinGW.
Referenced by findFileRecursion(), findQtPlugins(), DllDirectoryFileEntryFunction::operator()(), and parseArguments().
Definition at line 38 of file utils.cpp.
References ClangMsvc, Msvc, and platform().
Referenced by findQmlDirectory(), and qmlDirectoryRecursion().
Definition at line 136 of file utils.h.
Referenced by findDependentQtLibraries().
|
inline |
Definition at line 58 of file utils.h.
References str, and QString::toStdWString().
Definition at line 968 of file utils.cpp.
References QString::arg(), QFileDevice::close(), errorMessage(), QIODevice::errorString(), file, QFileInfo::fileName(), QString::fromLatin1(), QByteArray::indexOf(), QByteArray::isEmpty(), QByteArray::length(), QFile::open(), optVerboseLevel, QIODevice::readAll(), QIODeviceBase::ReadOnly, QByteArray::replace(), QByteArray::size(), QDir::toNativeSeparators(), QIODevice::write(), and QIODeviceBase::WriteOnly.
Referenced by deploy().
|
inline |
Definition at line 45 of file utils.h.
References ClangMsvc, and Msvc.
Referenced by deployWebEngineCore(), findSharedLibraries(), and libraryPath().
Definition at line 424 of file utils.cpp.
References errorMessage(), QIODevice::errorString(), QFile::fileName(), QString::fromLocal8Bit(), QString::fromUtf8(), QString::indexOf(), QString::isEmpty(), line, QString::number(), QFile::open(), output, pos, qmakeInfixKey, QStringLiteral, QIODevice::readLine(), QIODeviceBase::ReadOnly, QString::remove(), QString::right(), runProcess(), QString::size(), QString::startsWith(), QIODeviceBase::Text, QDir::toNativeSeparators(), and QString::trimmed().
Referenced by main().
bool readElfExecutable | ( | const QString & | elfExecutableFileName, |
QString * | errorMessage, | ||
QStringList * | dependentLibraries = 0 , |
||
unsigned * | wordSize = 0 , |
||
bool * | isDebug = 0 |
||
) |
Definition at line 556 of file utils.cpp.
References ElfReader::dependencies(), Elf_ELFCLASS64, errorMessage(), ElfReader::errorString(), QString::fromLocal8Bit(), QList< T >::isEmpty(), NoSymbols, QStringLiteral, ElfReader::readHeaders(), QDir::toNativeSeparators(), and UnknownSymbols.
Referenced by readExecutable().
|
inline |
Definition at line 177 of file utils.h.
References errorMessage(), platform(), readElfExecutable(), readPeExecutable(), Unix, and WindowsDesktopMinGW.
Referenced by findDependentLibraries(), and findDependentQtLibraries().
bool readPeExecutable | ( | const QString & | peExecutableFileName, |
QString * | errorMessage, | ||
QStringList * | dependentLibraries = 0 , |
||
unsigned * | wordSize = 0 , |
||
bool * | isDebug = 0 , |
||
bool | isMinGW = false , |
||
unsigned short * | machineArch = nullptr |
||
) |
Definition at line 948 of file utils.cpp.
References errorMessage(), and QStringLiteral.
Referenced by findSharedLibraries(), and readExecutable().
bool runProcess | ( | const QString & | binary, |
const QStringList & | args, | ||
const QString & | workingDirectory = QString() , |
||
unsigned long * | exitCode = 0 , |
||
QByteArray * | stdOut = 0 , |
||
QByteArray * | stdErr = 0 , |
||
QString * | errorMessage = 0 |
||
) |
Definition at line 312 of file utils.cpp.
References args, QScopedPointer< T, Cleanup >::data(), encodeFileName(), errorMessage(), QString::fromLocal8Bit(), QString::isEmpty(), QStringLiteral, readOutRedirectFile(), QScopedPointer< T, Cleanup >::reset(), QDir::setCurrent(), QList< T >::size(), and tempFilePattern().
Referenced by deployTranslations(), queryQtPaths(), and runQmlImportScanner().
Definition at line 142 of file utils.h.
References platform(), unixSharedLibrarySuffix, WindowsBased, and windowsSharedLibrarySuffix.
Referenced by findMinGWRuntimePaths(), findSharedLibraries(), and libraryPath().
|
inline |
Definition at line 373 of file utils.h.
References errorMessage(), and updateFile().
bool updateFile | ( | const QString & | sourceFileName, |
const QStringList & | nameFilters, | ||
const QString & | targetDirectory, | ||
unsigned | flags, | ||
JsonOutput * | json, | ||
QString * | errorMessage | ||
) |
Definition at line 476 of file utils.cpp.
References JsonOutput::addFile(), QString::arg(), QFile::copy(), d, dir, QDir::Dirs, errorMessage(), QIODevice::errorString(), QFileInfo::exists(), file, QFileInfo::fileName(), QDir::Files, ForceUpdateFile, QString::fromLatin1(), QFileInfo::isDir(), QFileInfo::isSymLink(), QFileInfo::lastModified(), QDir::NoDotAndDotDot, optVerboseLevel, QFile::remove(), SkipUpdateFile, QDir::toNativeSeparators(), and updateFile().
Referenced by updateFile(), updateFile(), and updateFile().
bool updateFile | ( | const QString & | sourceFileName, |
DirectoryFileEntryFunction | directoryFileEntryFunction, | ||
const QString & | targetDirectory, | ||
unsigned | flags, | ||
JsonOutput * | json, | ||
QString * | errorMessage | ||
) |
Definition at line 220 of file utils.h.
References QFileInfo::absolutePath(), JsonOutput::addFile(), QString::arg(), QString::contains(), QFile::copy(), createSymbolicLink(), d, dir, QDir::Dirs, errorMessage(), QIODevice::errorString(), QFileInfo::exists(), file, QFileInfo::fileName(), QDir::Files, ForceUpdateFile, QString::fromLatin1(), QFileInfo::isDir(), QFileInfo::isSymLink(), QFileInfo::lastModified(), QDir::NoDotAndDotDot, optVerboseLevel, QFile::permissions(), QDir::relativeFilePath(), QFile::remove(), RemoveEmptyQmlDirectories, JsonOutput::removeTargetDirectory(), QFile::setPermissions(), SkipQmlDesignerSpecificsDirectories, SkipUpdateFile, QFileInfo::symLinkTarget(), QDir::toNativeSeparators(), updateFile(), and QFileDevice::WriteUser.
|
extern |
Definition at line 36 of file utils.cpp.
Referenced by createDirectory(), deploy(), deployPlugin(), deployTranslations(), deployWebEngineCore(), findQtPlugins(), main(), parseArguments(), parseEarlyArguments(), patchQtCore(), updateFile(), and updateFile().
|
extern |
Definition at line 422 of file utils.cpp.
Referenced by deploy(), and queryQtPaths().
|
static |
Definition at line 140 of file utils.h.
Referenced by sharedLibrarySuffix().
|
static |
Definition at line 139 of file utils.h.
Referenced by deploy(), and sharedLibrarySuffix().