![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include "qplatformdefs.h"
#include "qdir.h"
#include "qdir_p.h"
#include "qabstractfileengine_p.h"
#include "qfsfileengine_p.h"
#include "qdebug.h"
#include "qdirlisting.h"
#include "qdatetime.h"
#include "qstring.h"
#include "qvarlengtharray.h"
#include "qfilesystementry_p.h"
#include "qfilesystemmetadata_p.h"
#include "qfilesystemengine_p.h"
#include <qstringbuilder.h>
#include <qcollator.h>
#include "qreadwritelock.h"
#include "qmutex.h"
#include <private/qorderedmutexlocker_p.h>
#include <algorithm>
#include <memory>
#include <stdlib.h>
Go to the source code of this file.
Classes | |
struct | QDirSortItem |
class | QDirSortItemComparator |
Functions | |
static qsizetype | rootLength (QStringView name, QDirPrivate::PathNormalizations flags) |
static bool | treatAsAbsolute (const QString &path) |
static bool | qt_cleanPath (QString *path) |
bool | comparesEqual (const QDir &lhs, const QDir &rhs) |
bool | qt_normalizePathSegments (QString *path, QDirPrivate::PathNormalizations flags) |
QDebug | operator<< (QDebug debug, QDir::Filters filters) |
static QDebug | operator<< (QDebug debug, QDir::SortFlags sorting) |
QDebug | operator<< (QDebug debug, const QDir &dir) |
Definition at line 2462 of file qdir.cpp.
Referenced by checkWarnMessage(), formatQDebug(), and QSGBatchRenderer::qsg_dumpShadowRoots().
bool qt_normalizePathSegments | ( | QString * | path, |
QDirPrivate::PathNormalizations | flags ) |
Updates path with redundant directory separators removed, and "."s and ".."s resolved (as far as possible). It returns false
if there were ".." segments left over, attempt to go up past the root (only applies to absolute paths), or true
otherwise.
This method is shared with QUrl, so it doesn't deal with QDir::separator(), nor does it remove the trailing slash, if any.
When dealing with URLs, we are following the "Remove dot segments" algorithm from https://www.ietf.org/rfc/rfc3986.html#section-5.2.4 URL mode differs from local path mode in these ways: 1) it can set *path to empty ("." becomes "") 2) directory path outputs end in / ("a/.." becomes "a/" instead of "a") 3) a sequence of "//" is treated as multiple path levels ("a/b//.." becomes "a/b/" and "a/b//../.." becomes "a/"), which matches the behavior observed in web browsers.
As a Qt extension, for local URLs we treat multiple slashes as one slash.
Definition at line 2240 of file qdir.cpp.
References QDirPrivate::RemotePath.
|
static |
Definition at line 55 of file qdir.cpp.
References QDirPrivate::UrlNormalizationMode.