Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qdir.cpp File Reference

(81a0753299fb8cc3e6b4b5e41a0292024ccea9e5)

#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 <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)
 
bool comparesEqual (const QDir &lhs, const QDir &rhs)
 
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

◆ comparesEqual()

bool comparesEqual ( const QDir & lhs,
const QDir & rhs )

◆ operator<<() [1/3]

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

Definition at line 2499 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 2365 of file qdir.cpp.

References QDirPrivate::AllowUncPaths, QString::chop(), 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 2207 of file qdir.cpp.

References QDirPrivate::AllowUncPaths, i, ok, out, QDirPrivate::RemotePath, rootLength(), QString::size(), and QStringView::toString().

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: