![]() |
Qt 6.x
The Qt SDK
|
#include "utils.h"
#include "elfreader.h"
#include <QtCore/QString>
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
#include <QtCore/QTemporaryFile>
#include <QtCore/QScopedPointer>
#include <QtCore/QScopedArrayPointer>
#include <QtCore/QStandardPaths>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
Go to the source code of this file.
Variables | |
int | optVerboseLevel = 1 |
const char * | qmakeInfixKey = "QT_INFIX" |
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().
|
inlinestatic |
Definition at line 275 of file utils.cpp.
References QByteArray::constData(), encoded, QFile::encodeName(), and QByteArray::size().
Referenced by runProcess(), and tempFilePattern().
QStringList findDxc | ( | Platform | platform, |
const QString & | qtBinDir, | ||
unsigned | wordSize | ||
) |
Definition at line 406 of file utils.cpp.
References QDir::cleanPath(), file, QStandardPaths::findExecutable(), QString::fromWCharArray(), MAX_PATH, and QFile::size().
QStringList findSharedLibraries | ( | const QDir & | directory, |
Platform | platform, | ||
DebugMatchMode | debugMatchMode, | ||
const QString & | prefix | ||
) |
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 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().
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, | ||
unsigned * | wordSize, | ||
bool * | isDebug | ||
) |
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().
|
inlinestatic |
Definition at line 292 of file utils.cpp.
References read().
Referenced by runProcess().
bool readPeExecutable | ( | const QString & | peExecutableFileName, |
QString * | errorMessage, | ||
QStringList * | dependentLibraries, | ||
unsigned * | wordSize, | ||
bool * | isDebug, | ||
bool | isMinGW, | ||
unsigned short * | machineArch | ||
) |
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, | ||
unsigned long * | exitCode, | ||
QByteArray * | stdOut, | ||
QByteArray * | stdErr, | ||
QString * | errorMessage | ||
) |
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().
|
inlinestatic |
Definition at line 283 of file utils.cpp.
References encodeFileName(), QStringLiteral, and QDir::tempPath().
Referenced by createTemporaryItemCopy(), and runProcess().
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().
int optVerboseLevel = 1 |
Definition at line 36 of file utils.cpp.
Referenced by createDirectory(), deploy(), deployPlugin(), deployTranslations(), deployWebEngineCore(), findQtPlugins(), main(), parseArguments(), parseEarlyArguments(), patchQtCore(), updateFile(), and updateFile().
const char* qmakeInfixKey = "QT_INFIX" |
Definition at line 422 of file utils.cpp.
Referenced by deploy(), and queryQtPaths().