Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QFileSystemEngine Class Reference

#include <qfilesystemengine_p.h>

+ Collaboration diagram for QFileSystemEngine:

Static Public Member Functions

static bool isCaseSensitive ()
 
static QFileSystemEntry getLinkTarget (const QFileSystemEntry &link, QFileSystemMetaData &data)
 
static QFileSystemEntry getRawLinkPath (const QFileSystemEntry &link, QFileSystemMetaData &data)
 
static QFileSystemEntry getJunctionTarget (const QFileSystemEntry &link, QFileSystemMetaData &data)
 
static QFileSystemEntry canonicalName (const QFileSystemEntry &entry, QFileSystemMetaData &data)
 
static QFileSystemEntry absoluteName (const QFileSystemEntry &entry)
 
static QByteArray id (const QFileSystemEntry &entry)
 
static QString resolveUserName (const QFileSystemEntry &entry, QFileSystemMetaData &data)
 
static QString resolveGroupName (const QFileSystemEntry &entry, QFileSystemMetaData &data)
 
static QString bundleName (const QFileSystemEntry &)
 
static bool fillMetaData (const QFileSystemEntry &entry, QFileSystemMetaData &data, QFileSystemMetaData::MetaDataFlags what)
 
static QString homePath ()
 
static QString rootPath ()
 
static QString tempPath ()
 
static bool createDirectory (const QFileSystemEntry &entry, bool createParents, std::optional< QFile::Permissions > permissions=std::nullopt)
 
static bool removeDirectory (const QFileSystemEntry &entry, bool removeEmptyParents)
 
static bool createLink (const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
 
static bool copyFile (const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
 
static bool moveFileToTrash (const QFileSystemEntry &source, QFileSystemEntry &newLocation, QSystemError &error)
 
static bool renameFile (const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
 
static bool renameOverwriteFile (const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
 
static bool removeFile (const QFileSystemEntry &entry, QSystemError &error)
 
static bool setPermissions (const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error, QFileSystemMetaData *data=nullptr)
 
static bool setFileTime (const QFileSystemEntry &entry, const QDateTime &newDate, QAbstractFileEngine::FileTime whatTime, QSystemError &error)
 
static bool setCurrentPath (const QFileSystemEntry &entry)
 
static QFileSystemEntry currentPath ()
 
static QAbstractFileEngineresolveEntryAndCreateLegacyEngine (QFileSystemEntry &entry, QFileSystemMetaData &data)
 

Detailed Description

Definition at line 57 of file qfilesystemengine_p.h.

Member Function Documentation

◆ absoluteName()

QFileSystemEntry QFileSystemEngine::absoluteName ( const QFileSystemEntry entry)
static

Definition at line 698 of file qfilesystemengine_unix.cpp.

References QByteArray::append(), QString::append(), QDir::cleanPath(), currentPath(), QFileSystemEntry::filePath(), QByteArray::isEmpty(), QFileSystemEntry::nativeFilePath(), Q_CHECK_FILE_NAME, QByteArray::size(), and QByteArray::startsWith().

Referenced by QTemporaryFileName::QTemporaryFileName(), canonicalName(), QFSFileEngine::fileName(), QFileInfoPrivate::getFileName(), getLinkTarget(), and QDirPrivate::resolveAbsoluteEntry().

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

◆ bundleName()

static QString QFileSystemEngine::bundleName ( const QFileSystemEntry )
inlinestatic

Definition at line 87 of file qfilesystemengine_p.h.

Referenced by QFSFileEngine::fileName(), and QFileInfoPrivate::getFileName().

+ Here is the caller graph for this function:

◆ canonicalName()

QFileSystemEntry QFileSystemEngine::canonicalName ( const QFileSystemEntry entry,
QFileSystemMetaData data 
)
static

Definition at line 643 of file qfilesystemengine_unix.cpp.

References absoluteName(), canonicalPath(), QDir::cleanPath(), QFile::decodeName(), QFileSystemMetaData::ExistsAttribute, fillMetaData(), PATH_MAX, ptr(), Q_ASSERT, Q_CHECK_FILE_NAME, and Q_UNUSED.

Referenced by QDir::canonicalPath(), QFSFileEngine::fileName(), and QFileInfoPrivate::getFileName().

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

◆ copyFile()

bool QFileSystemEngine::copyFile ( const QFileSystemEntry source,
const QFileSystemEntry target,
QSystemError error 
)
static

Definition at line 1401 of file qfilesystemengine_unix.cpp.

References error, Q_UNUSED, and QSystemError::StandardLibraryError.

Referenced by QFSFileEngine::copy().

+ Here is the caller graph for this function:

◆ createDirectory()

bool QFileSystemEngine::createDirectory ( const QFileSystemEntry entry,
bool  createParents,
std::optional< QFile::Permissions >  permissions = std::nullopt 
)
static

Definition at line 1122 of file qfilesystemengine_unix.cpp.

References QString::chop(), createDirectoryWithParents(), QFile::encodeName(), QString::endsWith(), Q_CHECK_FILE_NAME, and QString::size().

Referenced by QTemporaryDirPrivate::create(), QDir::mkdir(), QFSFileEngine::mkdir(), QDir::mkdir(), and QDir::mkpath().

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

◆ createLink()

bool QFileSystemEngine::createLink ( const QFileSystemEntry source,
const QFileSystemEntry target,
QSystemError error 
)
static

Definition at line 1169 of file qfilesystemengine_unix.cpp.

References error, Q_CHECK_FILE_NAME, and QSystemError::StandardLibraryError.

Referenced by QFSFileEngine::link().

+ Here is the caller graph for this function:

◆ currentPath()

QFileSystemEntry QFileSystemEngine::currentPath ( )
static

Definition at line 1617 of file qfilesystemengine_unix.cpp.

References QString::constData(), dir, QString::indexOf(), PATH_MAX, qstrncpy(), qWarning, and QString::remove().

Referenced by absoluteName(), QDir::currentPath(), and QFSFileEngine::currentPath().

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

◆ fillMetaData()

bool QFileSystemEngine::fillMetaData ( const QFileSystemEntry entry,
QFileSystemMetaData data,
QFileSystemMetaData::MetaDataFlags  what 
)
static

Definition at line 356 of file qfilesystemengine_unix.cpp.

References QFileSystemMetaData::PosixStatFlags, qt_fstatx(), and ret.

Referenced by _q_checkEntry(), canonicalName(), QFileInfoPrivate::checkAttribute(), checkXdgRuntimeDir(), QFSFileEnginePrivate::doStat(), QDirPrivate::exists(), QFileInfo::exists(), QFileInfo::exists(), getLinkTarget(), QDir::isReadable(), QFileInfo::isRoot(), QFSFileEnginePrivate::isSymlink(), resolveGroupName(), resolveUserName(), and QFileInfo::stat().

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

◆ getJunctionTarget()

QFileSystemEntry QFileSystemEngine::getJunctionTarget ( const QFileSystemEntry link,
QFileSystemMetaData data 
)
static

Definition at line 201 of file qfilesystemengine.cpp.

References Q_UNUSED.

Referenced by QFileInfoPrivate::getFileName().

+ Here is the caller graph for this function:

◆ getLinkTarget()

QFileSystemEntry QFileSystemEngine::getLinkTarget ( const QFileSystemEntry link,
QFileSystemMetaData data 
)
static

Definition at line 574 of file qfilesystemengine_unix.cpp.

References absoluteName(), QDir::cleanPath(), QByteArray::constData(), QByteArray::data(), QFile::decodeName(), QFileSystemMetaData::DirectoryType, QFile::encodeName(), QFileSystemEntry::filePath(), fillMetaData(), QFileSystemEntry::nativeFilePath(), parent, Q_CHECK_FILE_NAME, qt_readlink(), resolvedUrl(), ret, and url.

Referenced by QFSFileEngine::fileName(), and QFileInfoPrivate::getFileName().

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

◆ getRawLinkPath()

QFileSystemEntry QFileSystemEngine::getRawLinkPath ( const QFileSystemEntry link,
QFileSystemMetaData data 
)
static

Definition at line 633 of file qfilesystemengine_unix.cpp.

References QByteArray::constData(), QFile::decodeName(), QFileSystemEntry::nativeFilePath(), Q_UNUSED, qt_readlink(), and ret.

Referenced by QFSFileEngine::fileName(), and QFileInfoPrivate::getFileName().

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

◆ homePath()

QString QFileSystemEngine::homePath ( )
static

Definition at line 1577 of file qfilesystemengine_unix.cpp.

References QDir::cleanPath(), QFile::decodeName(), QString::isEmpty(), qgetenv(), and rootPath().

Referenced by QDir::homePath(), and QFSFileEngine::homePath().

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

◆ id()

QByteArray QFileSystemEngine::id ( const QFileSystemEntry entry)
static

Definition at line 733 of file qfilesystemengine_unix.cpp.

References QByteArray::number(), Q_CHECK_FILE_NAME, and qErrnoWarning().

Referenced by QFSFileEngine::id(), and QFile::rename().

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

◆ isCaseSensitive()

static bool QFileSystemEngine::isCaseSensitive ( )
inlinestatic

Definition at line 60 of file qfilesystemengine_p.h.

Referenced by QExtendedInformation::isCaseSensitive(), QDir::operator==(), and QFileInfo::operator==().

+ Here is the caller graph for this function:

◆ moveFileToTrash()

bool QFileSystemEngine::moveFileToTrash ( const QFileSystemEntry source,
QFileSystemEntry newLocation,
QSystemError error 
)
static

Definition at line 24 of file qfilesystemengine_mac.mm.

References error, QFileInfo::filePath(), info, QFileInfo::isDir(), QSystemError::NativeError, pool, and Q_UNUSED.

Referenced by QFile::moveToTrash().

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

◆ removeDirectory()

bool QFileSystemEngine::removeDirectory ( const QFileSystemEntry entry,
bool  removeEmptyParents 
)
static

Definition at line 1144 of file qfilesystemengine_unix.cpp.

References QDir::cleanPath(), QByteArray::constData(), QFile::encodeName(), QString::lastIndexOf(), QString::left(), Q_CHECK_FILE_NAME, QDir::separator(), and QString::size().

Referenced by QDir::rmdir(), QFSFileEngine::rmdir(), and QDir::rmpath().

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

◆ removeFile()

bool QFileSystemEngine::removeFile ( const QFileSystemEntry entry,
QSystemError error 
)
static

Definition at line 1502 of file qfilesystemengine_unix.cpp.

References error, Q_CHECK_FILE_NAME, and QSystemError::StandardLibraryError.

Referenced by QFSFileEngine::remove().

+ Here is the caller graph for this function:

◆ renameFile()

bool QFileSystemEngine::renameFile ( const QFileSystemEntry source,
const QFileSystemEntry target,
QSystemError error 
)
static

Definition at line 1418 of file qfilesystemengine_unix.cpp.

References error, Q_CHECK_FILE_NAME, QSystemError::StandardLibraryError, and SupportsHardlinking.

Referenced by QFile::rename(), and QFSFileEngine::rename().

+ Here is the caller graph for this function:

◆ renameOverwriteFile()

bool QFileSystemEngine::renameOverwriteFile ( const QFileSystemEntry source,
const QFileSystemEntry target,
QSystemError error 
)
static

Definition at line 1490 of file qfilesystemengine_unix.cpp.

References error, Q_CHECK_FILE_NAME, and QSystemError::StandardLibraryError.

Referenced by QFSFileEngine::renameOverwrite().

+ Here is the caller graph for this function:

◆ resolveEntryAndCreateLegacyEngine()

QAbstractFileEngine * QFileSystemEngine::resolveEntryAndCreateLegacyEngine ( QFileSystemEntry entry,
QFileSystemMetaData data 
)
static

Resolves the entry (see QDir::searchPaths) and returns an engine for it, but never a QFSFileEngine.

Returns a file engine that can be used to access the entry. Returns 0 if QFileSystemEngine API should be used to query and interact with the file system object.

Definition at line 156 of file qfilesystemengine.cpp.

References _q_resolveEntryAndCreateLegacyEngine_recursive(), copy(), and engine.

Referenced by QDirIteratorPrivate::QDirIteratorPrivate(), QDirPrivate::clearCache(), QAbstractFileEngine::create(), and QFileInfo::exists().

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

◆ resolveGroupName()

QString QFileSystemEngine::resolveGroupName ( const QFileSystemEntry entry,
QFileSystemMetaData data 
)
static

Definition at line 186 of file qfilesystemengine.cpp.

References QFileSystemMetaData::exists(), fillMetaData(), QFileSystemMetaData::GroupId, QFileSystemMetaData::groupId(), QFileSystemMetaData::hasFlags(), QAbstractFileEngine::OwnerGroup, Q_UNUSED, and resolveGroupName().

Referenced by QFileInfoPrivate::getFileOwner(), QFSFileEngine::owner(), and resolveGroupName().

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

◆ resolveUserName()

QString QFileSystemEngine::resolveUserName ( const QFileSystemEntry entry,
QFileSystemMetaData data 
)
static

Definition at line 171 of file qfilesystemengine.cpp.

References QFileSystemMetaData::exists(), fillMetaData(), QFileSystemMetaData::hasFlags(), QAbstractFileEngine::OwnerUser, Q_UNUSED, resolveUserName(), QFileSystemMetaData::UserId, and QFileSystemMetaData::userId().

Referenced by QFileInfoPrivate::getFileOwner(), QFSFileEngine::owner(), and resolveUserName().

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

◆ rootPath()

QString QFileSystemEngine::rootPath ( )
static

Definition at line 1585 of file qfilesystemengine_unix.cpp.

Referenced by homePath(), QDir::rootPath(), and QFSFileEngine::rootPath().

+ Here is the caller graph for this function:

◆ setCurrentPath()

bool QFileSystemEngine::setCurrentPath ( const QFileSystemEntry entry)
static

Definition at line 1610 of file qfilesystemengine_unix.cpp.

Referenced by QDir::setCurrent(), and QFSFileEngine::setCurrentPath().

+ Here is the caller graph for this function:

◆ setFileTime()

bool QFileSystemEngine::setFileTime ( const QFileSystemEntry entry,
const QDateTime newDate,
QAbstractFileEngine::FileTime  whatTime,
QSystemError error 
)
static

Definition at line 1546 of file qfilesystemengine_unix.cpp.

References QAbstractFileEngine::AccessTime, QAbstractFileEngine::BirthTime, durationToTimespec(), error, QDateTime::isValid(), QAbstractFileEngine::MetadataChangeTime, QAbstractFileEngine::ModificationTime, Q_UNUSED, QSystemError::StandardLibraryError, time, and QDateTime::toMSecsSinceEpoch().

Referenced by QFSFileEngine::setFileTime().

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

◆ setPermissions()

bool QFileSystemEngine::setPermissions ( const QFileSystemEntry entry,
QFile::Permissions  permissions,
QSystemError error,
QFileSystemMetaData data = nullptr 
)
static

Definition at line 1513 of file qfilesystemengine_unix.cpp.

References error, QFileSystemMetaData::Permissions, Q_CHECK_FILE_NAME, and QSystemError::StandardLibraryError.

Referenced by QFSFileEngine::setPermissions().

+ Here is the caller graph for this function:

◆ tempPath()

QString QFileSystemEngine::tempPath ( )
static

Definition at line 1590 of file qfilesystemengine_unix.cpp.

References _PATH_TMP, QDir::canonicalPath(), QDir::cleanPath(), QFile::decodeName(), QString::isEmpty(), and qgetenv().

Referenced by QDir::tempPath(), and QFSFileEngine::tempPath().

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

The documentation for this class was generated from the following files: