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
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, QFile::FileTime whatTime, QSystemError &error)
 
static bool setCurrentPath (const QFileSystemEntry &entry)
 
static QFileSystemEntry currentPath ()
 
static std::unique_ptr< QAbstractFileEnginecreateLegacyEngine (QFileSystemEntry &entry, QFileSystemMetaData &data)
 

Detailed Description

Definition at line 58 of file qfilesystemengine_p.h.

Member Function Documentation

◆ absoluteName()

QFileSystemEntry QFileSystemEngine::absoluteName ( const QFileSystemEntry & entry)
static

Definition at line 696 of file qfilesystemengine_unix.cpp.

References QDir::cleanPath(), currentPath(), QByteArray::isEmpty(), Q_CHECK_FILE_NAME, QByteArray::size(), and QByteArray::startsWith().

Referenced by 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 88 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 641 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 1541 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 1120 of file qfilesystemengine_unix.cpp.

References QByteArray::chop(), createDirectoryWithParents(), QByteArray::endsWith(), Q_CHECK_FILE_NAME, and QByteArray::size().

Referenced by 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:

◆ createLegacyEngine()

std::unique_ptr< QAbstractFileEngine > QFileSystemEngine::createLegacyEngine ( 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 157 of file qfilesystemengine.cpp.

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

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

+ 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 1166 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 1757 of file qfilesystemengine_unix.cpp.

References QString::constData(), dir, QString::indexOf(), PATH_MAX, QByteArray(), 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 354 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 202 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 572 of file qfilesystemengine_unix.cpp.

References absoluteName(), QDir::cdUp(), QDir::cleanPath(), QByteArray::constData(), QFile::decodeName(), QFileSystemMetaData::DirectoryType, QFile::encodeName(), QFileSystemEntry::filePath(), fillMetaData(), QFileSystemEntry::nativeFilePath(), QDir::path(), 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 631 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 1717 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 731 of file qfilesystemengine_unix.cpp.

References QByteArray::number(), Q_CHECK_FILE_NAME, QByteArray(), 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 61 of file qfilesystemengine_p.h.

Referenced by QExtendedInformation::isCaseSensitive().

+ 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, info, QSystemError::NativeError, pool, and Q_UNUSED.

Referenced by QFile::moveToTrash().

+ Here is the caller graph for this function:

◆ removeDirectory()

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

Definition at line 1141 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 1642 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 1558 of file qfilesystemengine_unix.cpp.

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

Referenced by QFile::rename().

+ Here is the caller graph for this function:

◆ renameOverwriteFile()

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

◆ resolveGroupName()

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

Definition at line 187 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 172 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 1725 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 1750 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,
QFile::FileTime whatTime,
QSystemError & error )
static

Definition at line 1686 of file qfilesystemengine_unix.cpp.

References durationToTimespec(), error, QFileDevice::FileAccessTime, QFileDevice::FileBirthTime, QFileDevice::FileMetadataChangeTime, QFileDevice::FileModificationTime, Q_UNUSED, QSystemError::StandardLibraryError, and time.

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 1653 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 1730 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: