Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qdir.cpp File Reference
#include "qplatformdefs.h"
#include "qdir.h"
#include "qdir_p.h"
#include "qabstractfileengine_p.h"
#include "qfsfileengine_p.h"
#include "qdebug.h"
#include "qdiriterator.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 <algorithm>
#include <memory>
#include <stdlib.h>
+ Include dependency graph for qdir.cpp:

Go to the source code of this file.

Classes

struct  QDirSortItem
 
class  QDirSortItemComparator
 

Enumerations

enum  { OSSupportsUncPaths = false }
 

Functions

static qsizetype rootLength (QStringView name, bool allowUncPaths)
 
static bool treatAsAbsolute (const QString &path)
 
static QString qt_cleanPath (const QString &path, bool *ok=nullptr)
 
QString qt_normalizePathSegments (const QString &name, QDirPrivate::PathNormalizations flags, bool *ok)
 
QDebug operator<< (QDebug debug, QDir::Filters filters)
 
static QDebug operator<< (QDebug debug, QDir::SortFlags sorting)
 
QDebug operator<< (QDebug debug, const QDir &dir)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
OSSupportsUncPaths 

Definition at line 52 of file qdir.cpp.

Function Documentation

◆ operator<<() [1/3]

QDebug operator<< ( QDebug  debug,
const QDir dir 
)

Definition at line 2496 of file qdir.cpp.

References debug, and dir.

◆ operator<<() [2/3]

◆ operator<<() [3/3]

static QDebug operator<< ( QDebug  debug,
QDir::SortFlags  sorting 
)
static

◆ qt_cleanPath()

static QString qt_cleanPath ( const QString path,
bool *  ok = nullptr 
)
static

Definition at line 2362 of file qdir.cpp.

References QDirPrivate::AllowUncPaths, QDirPrivate::DefaultNormalization, QDir::fromNativeSeparators(), ok, OSSupportsUncPaths, Q_ASSERT, qt_normalizePathSegments(), and ret.

Referenced by QDir::cd(), and QDir::cleanPath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_normalizePathSegments()

QString qt_normalizePathSegments ( const QString name,
QDirPrivate::PathNormalizations  flags,
bool *  ok 
)

Returns path with redundant directory separators removed, and "."s and ".."s resolved (as far as possible).

This method is shared with QUrl, so it doesn't deal with QDir::separator(), nor does it remove the trailing slash, if any.

Definition at line 2204 of file qdir.cpp.

References QDirPrivate::AllowUncPaths, QVarLengthArray< T, Prealloc >::data(), QString::fromUtf16(), i, ok, out, QDirPrivate::RemotePath, rootLength(), and QString::size().

Referenced by QUrlPrivate::appendPath(), and qt_cleanPath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rootLength()

static qsizetype rootLength ( QStringView  name,
bool  allowUncPaths 
)
static

Definition at line 61 of file qdir.cpp.

Referenced by qt_normalizePathSegments().

+ Here is the caller graph for this function:

◆ treatAsAbsolute()

static bool treatAsAbsolute ( const QString path)
static

Definition at line 754 of file qdir.cpp.

References QFileSystemEntry::isAbsolute().

Referenced by QDir::absoluteFilePath(), and QDir::filePath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: