Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtpaths.cpp File Reference

(54ff6027d9e2b32026b801ffa2e952be87bace99)

#include <QCoreApplication>
#include <QCommandLineParser>
#include <QStandardPaths>
#include <QHash>
#include <QLibraryInfo>
#include <algorithm>
#include <stdio.h>
Include dependency graph for qtpaths.cpp:

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 StringEnumparseLocationOrError (const QString &locationString)
static QString searchStringOrError (QCommandLineParser *parser)
int main (int argc, char **argv)
 [48]

Variables

static const StringEnum lookupTableData []

Function Documentation

◆ error()

Q_NORETURN void error ( const QString & message)
static

Writes error message and exits 1

Parameters
messageto write

Definition at line 36 of file qtpaths.cpp.

◆ main()

int main ( int argc,
char ** argv )

[48]

[dynamic_tooltip]

[5]

[2]

[0]

[6]

[48]

[48]

[6]

[0]

[0]

[1]

[1]

[2]

[2]

[3]

[3]

[0]

[0]

[1]

[1]

[0]

[0]

[0]

[0]

[0]

[0]

Definition at line 123 of file qtpaths.cpp.

◆ message()

QT_USE_NAMESPACE void message ( const QString & string)
static

Prints the string on stdout and appends a newline

Parameters
stringprintable string

Definition at line 27 of file qtpaths.cpp.

◆ parseLocationOrError()

const StringEnum & parseLocationOrError ( const QString & locationString)
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 99 of file qtpaths.cpp.

◆ searchStringOrError()

QString searchStringOrError ( QCommandLineParser * parser)
static

searches for exactly one remaining argument and returns it. If not found, error is called with a error message.

Parameters
parserto ask for remaining arguments
Returns
one extra argument

Definition at line 115 of file qtpaths.cpp.

◆ types()

QStringList types ( )
static
Returns
available types as a QStringList.

Definition at line 86 of file qtpaths.cpp.

Variable Documentation

◆ lookupTableData

const StringEnum lookupTableData
static
Initial value:
= {
{ "AppConfigLocation", QStandardPaths::AppConfigLocation, true },
{ "AppDataLocation", QStandardPaths::AppDataLocation, true },
{ "AppLocalDataLocation", QStandardPaths::AppLocalDataLocation, true },
{ "ApplicationsLocation", QStandardPaths::ApplicationsLocation, false },
{ "CacheLocation", QStandardPaths::CacheLocation, true },
{ "ConfigLocation", QStandardPaths::ConfigLocation, false },
{ "DesktopLocation", QStandardPaths::DesktopLocation, false },
{ "DocumentsLocation", QStandardPaths::DocumentsLocation, false },
{ "DownloadLocation", QStandardPaths::DownloadLocation, false },
{ "FontsLocation", QStandardPaths::FontsLocation, false },
{ "GenericCacheLocation", QStandardPaths::GenericCacheLocation, false },
{ "GenericConfigLocation", QStandardPaths::GenericConfigLocation, false },
{ "GenericDataLocation", QStandardPaths::GenericDataLocation, false },
{ "GenericStateLocation", QStandardPaths::GenericStateLocation, false },
{ "HomeLocation", QStandardPaths::HomeLocation, false },
{ "MoviesLocation", QStandardPaths::MoviesLocation, false },
{ "MusicLocation", QStandardPaths::MusicLocation, false },
{ "PicturesLocation", QStandardPaths::PicturesLocation, false },
{ "PublicShareLocation", QStandardPaths::PublicShareLocation, false },
{ "RuntimeLocation", QStandardPaths::RuntimeLocation, false },
{ "StateLocation", QStandardPaths::StateLocation, true },
{ "TemplatesLocation", QStandardPaths::TemplatesLocation, false },
{ "TempLocation", QStandardPaths::TempLocation, false }
}

Definition at line 57 of file qtpaths.cpp.