![]() |
Qt 6.x
The Qt SDK
|
#include <QCoreApplication>
#include <QCommandLineParser>
#include <QStandardPaths>
#include <QHash>
#include <QLibraryInfo>
#include <algorithm>
#include <stdio.h>
Go to the source code of this file.
Classes | |
class | StringEnum |
Functions | |
static QT_USE_NAMESPACE void | message (const QString &string) |
static Q_NORETURN void | error (const QString &message) |
static QStringList | types () |
static const StringEnum & | parseLocationOrError (const QString &locationString) |
static QString | searchStringOrError (QCommandLineParser *parser) |
int | main (int argc, char **argv) |
[0] | |
Variables | |
static const StringEnum | lookupTableData [] |
|
static |
Writes error message and exits 1
message | to write |
Definition at line 36 of file qtpaths.cpp.
References qPrintable.
int main | ( | int | argc, |
char ** | argv | ||
) |
[0]
[0]
[0]
[6]
[0]
[0]
[1]
[1]
[2]
[2]
[3]
[3]
[0]
[0]
[1]
[1]
[0]
[0]
[0]
[0]
Definition at line 124 of file qtpaths.cpp.
References QCommandLineParser::addHelpOption(), QCommandLineParser::addOption(), QCommandLineParser::addPositionalArgument(), QCommandLineParser::addVersionOption(), app, QLibraryInfo::BinariesPath, QStandardPaths::displayName(), error, errorMessage(), QStandardPaths::findExecutable(), QList< T >::first(), QString::fromLatin1(), QCommandLineOption::HiddenFromHelp, QList< T >::isEmpty(), QCommandLineParser::isSet(), item, QStandardPaths::locate(), QStandardPaths::locateAll(), QStandardPaths::LocateDirectory, QStandardPaths::LocateFile, QCommandLineParser::ParseAsLongOptions, parseLocationOrError(), QLibraryInfo::path(), QLibraryInfo::PluginsPath, QCommandLineParser::positionalArguments(), QLibraryInfo::PrefixPath, QCommandLineParser::process(), QStringLiteral, QT_WARNING_DISABLE_GCC, QT_WARNING_POP, QT_WARNING_PUSH, results, searchStringOrError(), QCommandLineParser::setApplicationDescription(), QCoreApplication::setApplicationVersion(), QCommandLineOption::setDefaultValue(), QCommandLineOption::setFlags(), QCommandLineParser::setSingleDashWordOptionMode(), QStandardPaths::setTestModeEnabled(), QCommandLineParser::showHelp(), QList< T >::size(), QStandardPaths::standardLocations(), text, types(), QCommandLineParser::value(), and QStandardPaths::writableLocation().
|
static |
Prints the string on stdout and appends a newline
string | printable string |
Definition at line 27 of file qtpaths.cpp.
References qPrintable.
|
static |
Tries to parse the location string into a reference to a StringEnum entry or alternatively calls error with a error message
Definition at line 100 of file qtpaths.cpp.
References error, lookupTableData, and QStringLiteral.
Referenced by main().
|
static |
searches for exactly one remaining argument and returns it. If not found, error is called with a error message.
parser | to ask for remaining arguments |
Definition at line 116 of file qtpaths.cpp.
References error, QCommandLineParser::positionalArguments(), and QStringLiteral.
Referenced by main().
|
static |
Definition at line 87 of file qtpaths.cpp.
References QString::fromLatin1(), and lookupTableData.
Referenced by main().
|
static |
Definition at line 57 of file qtpaths.cpp.
Referenced by parseLocationOrError(), and types().