10#ifndef QT_BOOTSTRAPPED
15#if __has_include(<paths.h>)
23#ifndef QT_NO_STANDARDPATHS
384 for (QStringList::const_iterator
dir = dirs.constBegin();
dir != dirs.constEnd(); ++
dir) {
399 for (QStringList::const_iterator
dir = dirs.constBegin();
dir != dirs.constEnd(); ++
dir) {
413 pathExt :
QStringList{
".exe"_L1,
".com"_L1,
".bat"_L1,
".cmd"_L1};
431 for (
const QString &searchPath : searchPaths) {
445 searchExecutableAppendSuffix(
const QStringList &searchPaths,
450 for (
const QString &searchPath : searchPaths) {
452 for (
const QString &suffix : suffixes) {
468 if (
QFileInfo(executableName).isAbsolute())
472 if (
paths.isEmpty()) {
478#if defined(_PATH_DEFPATH)
480 pEnv = _PATH_DEFPATH;
481#elif defined(_CS_PATH)
483 size_t n = confstr(_CS_PATH,
nullptr, 0);
487 confstr(_CS_PATH, pEnv.
data(), pEnv.
size() + 1);
498 searchPaths.reserve(rawPaths.size());
499 for (
const QString &rawPath : rawPaths) {
510 static const QStringList executable_extensions = executableExtensions();
511 if (executableName.
contains(u
'.')) {
514 return searchExecutableAppendSuffix(searchPaths, executableName, executable_extensions);
516 return searchExecutableAppendSuffix(searchPaths, executableName, executable_extensions);
526#if !defined(Q_OS_DARWIN) && !defined(QT_BOOTSTRAPPED)
607#include "moc_qstandardpaths.cpp"
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
bool isNull() const noexcept
Returns true if this byte array is null; otherwise returns false.
static QString translate(const char *context, const char *key, const char *disambiguation=nullptr, int n=-1)
\threadsafe
static QDir current()
Returns the application's current directory.
bool exists() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString cleanPath(const QString &path)
Returns path with directory separators normalized (that is, platform-native separators converted to "...
QString absoluteFilePath(const QString &fileName) const
Returns the absolute path name of a file in the directory.
static constexpr QChar listSeparator() noexcept
\inmodule QtCore \reentrant
QString suffix() const
Returns the suffix (extension) of the file.
QString bundleName() const
bool isExecutable() const
Returns true if the file is executable; otherwise returns false.
bool isFile() const
Returns true if this object points to a file or to a symbolic link to a file.
static QStringList locateAll(StandardLocation type, const QString &fileName, LocateOptions options=LocateFile)
[0]
static bool isTestModeEnabled()
static void setTestModeEnabled(bool testMode)
static QStringList standardLocations(StandardLocation type)
static QString displayName(StandardLocation type)
static QString findExecutable(const QString &executableName, const QStringList &paths=QStringList())
static QString locate(StandardLocation type, const QString &fileName, LocateOptions options=LocateFile)
StandardLocation
This enum describes the different locations that can be queried using methods such as QStandardPaths:...
\macro QT_RESTRICTED_CAST_FROM_ASCII
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
void truncate(qsizetype pos)
Truncates the string at the given position index.
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
qsizetype size() const
Returns the number of characters in this string.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString toLower() const &
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Combined button and popup list for selecting options.
GLsizei const GLuint * paths
GLsizei const GLchar *const * path
static QString cleanPath(const QString &_path)
static bool existsAsSpecified(const QString &path, QStandardPaths::LocateOptions options)
static QString searchExecutable(const QStringList &searchPaths, const QString &executableName)
static Q_CONSTINIT bool qsp_testMode
static QString checkExecutable(const QString &path)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
QFileInfo info(fileName)
[8]