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

#include <qfsfileengine_p.h>

+ Inheritance diagram for QFSFileEnginePrivate:
+ Collaboration diagram for QFSFileEnginePrivate:

Classes

struct  StartAndLength
 

Public Types

enum  LastIOCommand { IOFlushCommand , IOReadCommand , IOWriteCommand }
 

Public Member Functions

bool nativeOpen (QIODevice::OpenMode openMode, std::optional< QFile::Permissions > permissions)
 
bool openFh (QIODevice::OpenMode flags, FILE *fh)
 Opens the file handle fh using the open mode flags.
 
bool openFd (QIODevice::OpenMode flags, int fd)
 Opens the file descriptor fd to the file engine, using the open mode flags.
 
bool nativeClose ()
 
bool closeFdFh ()
 
bool nativeFlush ()
 
bool nativeSyncToDisk ()
 
bool flushFh ()
 
qint64 nativeSize () const
 
qint64 sizeFdFh () const
 
qint64 nativePos () const
 
qint64 posFdFh () const
 
bool nativeSeek (qint64)
 
bool seekFdFh (qint64)
 
qint64 nativeRead (char *data, qint64 maxlen)
 
qint64 readFdFh (char *data, qint64 maxlen)
 
qint64 nativeReadLine (char *data, qint64 maxlen)
 
qint64 readLineFdFh (char *data, qint64 maxlen)
 
qint64 nativeWrite (const char *data, qint64 len)
 
qint64 writeFdFh (const char *data, qint64 len)
 
int nativeHandle () const
 
bool nativeIsSequential () const
 
bool isSequentialFdFh () const
 
ucharmap (qint64 offset, qint64 size, QFile::MemoryMapFlags flags)
 
bool unmap (uchar *ptr)
 
void unmapAll ()
 
bool doStat (QFileSystemMetaData::MetaDataFlags flags=QFileSystemMetaData::PosixStatFlags) const
 
bool isSymlink () const
 
- Public Member Functions inherited from QAbstractFileEnginePrivate
 QAbstractFileEnginePrivate ()
 
virtual ~QAbstractFileEnginePrivate ()
 

Static Public Member Functions

static bool openModeCanCreate (QIODevice::OpenMode openMode)
 

Public Attributes

QFileSystemEntry fileEntry
 
QIODevice::OpenMode openMode
 
QFileSystemMetaData metaData
 
FILE * fh
 
QHash< uchar *, StartAndLengthmaps
 
int fd
 
LastIOCommand lastIOCommand
 
bool lastFlushFailed
 
bool closeFileHandle
 
uint is_sequential: 2
 
uint tried_stat: 1
 
uint need_lstat: 1
 
uint is_link: 1
 
- Public Attributes inherited from QAbstractFileEnginePrivate
QFile::FileError fileError
 
QString errorString
 
QAbstractFileEngineq_ptr
 

Protected Member Functions

 QFSFileEnginePrivate ()
 
void init ()
 
QAbstractFileEngine::FileFlags getPermissions (QAbstractFileEngine::FileFlags type) const
 

Detailed Description

Definition at line 115 of file qfsfileengine_p.h.

Member Enumeration Documentation

◆ LastIOCommand

Enumerator
IOFlushCommand 
IOReadCommand 
IOWriteCommand 

Definition at line 179 of file qfsfileengine_p.h.

Constructor & Destructor Documentation

◆ QFSFileEnginePrivate()

QFSFileEnginePrivate::QFSFileEnginePrivate ( )
protected

Definition at line 80 of file qfsfileengine.cpp.

References init().

+ Here is the call graph for this function:

Member Function Documentation

◆ closeFdFh()

bool QFSFileEnginePrivate::closeFdFh ( )

Definition at line 363 of file qfsfileengine.cpp.

References closeFileHandle, fh, lastFlushFailed, QT_CLOSE, ret, QSystemError::stdString(), tried_stat, and QFileDevice::UnspecifiedError.

Referenced by nativeClose().

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

◆ doStat()

bool QFSFileEnginePrivate::doStat ( QFileSystemMetaData::MetaDataFlags  flags = QFileSystemMetaData::PosixStatFlags) const

Definition at line 315 of file qfsfileengine_unix.cpp.

References QFileSystemMetaData::exists(), fd, fh, fileEntry, QFileSystemEngine::fillMetaData(), QFileSystemMetaData::hasFlags(), QFileSystemEntry::isEmpty(), metaData, QFileSystemMetaData::missingFlags(), and tried_stat.

Referenced by map(), and sizeFdFh().

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

◆ flushFh()

bool QFSFileEnginePrivate::flushFh ( )

Definition at line 433 of file qfsfileengine.cpp.

References fh, IOFlushCommand, lastFlushFailed, lastIOCommand, QFileDevice::ResourceError, ret, QSystemError::stdString(), and QFileDevice::WriteError.

Referenced by nativeFlush().

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

◆ getPermissions()

QAbstractFileEngine::FileFlags QFSFileEnginePrivate::getPermissions ( QAbstractFileEngine::FileFlags  type) const
protected

◆ init()

void QFSFileEnginePrivate::init ( )
protected

Definition at line 88 of file qfsfileengine.cpp.

References closeFileHandle, fh, INVALID_FILE_ATTRIBUTES, IOFlushCommand, is_link, is_sequential, lastFlushFailed, lastIOCommand, need_lstat, QIODeviceBase::NotOpen, openMode, and tried_stat.

Referenced by QFSFileEnginePrivate().

+ Here is the caller graph for this function:

◆ isSequentialFdFh()

bool QFSFileEnginePrivate::isSequentialFdFh ( ) const

Referenced by nativeIsSequential().

+ Here is the caller graph for this function:

◆ isSymlink()

bool QFSFileEnginePrivate::isSymlink ( ) const

Definition at line 333 of file qfsfileengine_unix.cpp.

References fileEntry, QFileSystemEngine::fillMetaData(), QFileSystemMetaData::hasFlags(), QFileSystemMetaData::isLink(), QFileSystemMetaData::LinkType, and metaData.

+ Here is the call graph for this function:

◆ map()

uchar * QFSFileEnginePrivate::map ( qint64  offset,
qint64  size,
QFile::MemoryMapFlags  flags 
)

◆ nativeClose()

bool QFSFileEnginePrivate::nativeClose ( )

Definition at line 140 of file qfsfileengine_unix.cpp.

References closeFdFh().

+ Here is the call graph for this function:

◆ nativeFlush()

bool QFSFileEnginePrivate::nativeFlush ( )

Definition at line 149 of file qfsfileengine_unix.cpp.

References fh, and flushFh().

+ Here is the call graph for this function:

◆ nativeHandle()

int QFSFileEnginePrivate::nativeHandle ( ) const

Definition at line 268 of file qfsfileengine_unix.cpp.

References fd, and fh.

Referenced by map(), and nativeSyncToDisk().

+ Here is the caller graph for this function:

◆ nativeIsSequential()

bool QFSFileEnginePrivate::nativeIsSequential ( ) const

Definition at line 276 of file qfsfileengine_unix.cpp.

References isSequentialFdFh().

Referenced by nativeRead().

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

◆ nativeOpen()

bool QFSFileEnginePrivate::nativeOpen ( QIODevice::OpenMode  openMode,
std::optional< QFile::Permissions >  permissions 
)

Definition at line 75 of file qfsfileengine_unix.cpp.

References openMode.

◆ nativePos()

qint64 QFSFileEnginePrivate::nativePos ( ) const

Definition at line 252 of file qfsfileengine_unix.cpp.

References posFdFh().

+ Here is the call graph for this function:

◆ nativeRead()

qint64 QFSFileEnginePrivate::nativeRead ( char *  data,
qint64  len 
)

Definition at line 175 of file qfsfileengine_unix.cpp.

References fh, i, nativeIsSequential(), qt_error_string(), read(), QFileDevice::ReadError, and readFdFh().

+ Here is the call graph for this function:

◆ nativeReadLine()

qint64 QFSFileEnginePrivate::nativeReadLine ( char *  data,
qint64  maxlen 
)

Definition at line 236 of file qfsfileengine_unix.cpp.

References readLineFdFh().

+ Here is the call graph for this function:

◆ nativeSeek()

bool QFSFileEnginePrivate::nativeSeek ( qint64  pos)

Definition at line 260 of file qfsfileengine_unix.cpp.

References pos, and seekFdFh().

+ Here is the call graph for this function:

◆ nativeSize()

qint64 QFSFileEnginePrivate::nativeSize ( ) const

Definition at line 292 of file qfsfileengine_unix.cpp.

References sizeFdFh().

+ Here is the call graph for this function:

◆ nativeSyncToDisk()

bool QFSFileEnginePrivate::nativeSyncToDisk ( )
Since
5.1

Definition at line 158 of file qfsfileengine_unix.cpp.

References EINTR_LOOP, nativeHandle(), qt_error_string(), ret, and QFileDevice::WriteError.

+ Here is the call graph for this function:

◆ nativeWrite()

qint64 QFSFileEnginePrivate::nativeWrite ( const char *  data,
qint64  len 
)

Definition at line 244 of file qfsfileengine_unix.cpp.

References writeFdFh().

+ Here is the call graph for this function:

◆ openFd()

bool QFSFileEnginePrivate::openFd ( QIODevice::OpenMode  flags,
int  fd 
)

Opens the file descriptor fd to the file engine, using the open mode flags.

Definition at line 323 of file qfsfileengine.cpp.

References QIODeviceBase::Append, fd, fh, QIODeviceBase::NotOpen, QFileDevice::OpenError, openMode, QFileDevice::ResourceError, ret, and QSystemError::stdString().

+ Here is the call graph for this function:

◆ openFh()

bool QFSFileEnginePrivate::openFh ( QIODevice::OpenMode  flags,
FILE *  fh 
)

Opens the file handle fh using the open mode flags.

Definition at line 258 of file qfsfileengine.cpp.

References QIODeviceBase::Append, fh, QIODeviceBase::NotOpen, QFileDevice::OpenError, openMode, Q_ASSERT_X, QFileDevice::ResourceError, ret, QSystemError::stdString(), and QIODeviceBase::Unbuffered.

+ Here is the call graph for this function:

◆ openModeCanCreate()

static bool QFSFileEnginePrivate::openModeCanCreate ( QIODevice::OpenMode  openMode)
inlinestatic

Definition at line 205 of file qfsfileengine_p.h.

References QIODeviceBase::ExistingOnly, and QIODeviceBase::WriteOnly.

Referenced by openModeToOpenFlags().

+ Here is the caller graph for this function:

◆ posFdFh()

qint64 QFSFileEnginePrivate::posFdFh ( ) const

Definition at line 505 of file qfsfileengine.cpp.

References fh.

Referenced by nativePos().

+ Here is the caller graph for this function:

◆ readFdFh()

qint64 QFSFileEnginePrivate::readFdFh ( char *  data,
qint64  len 
)

Definition at line 608 of file qfsfileengine.cpp.

References fh, QT_READ, QFileDevice::ReadError, and QSystemError::stdString().

Referenced by nativeRead().

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

◆ readLineFdFh()

qint64 QFSFileEnginePrivate::readLineFdFh ( char *  data,
qint64  maxlen 
)

Definition at line 686 of file qfsfileengine.cpp.

References fh, qstrlen(), QFileDevice::ReadError, and QSystemError::stdString().

Referenced by nativeReadLine().

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

◆ seekFdFh()

bool QFSFileEnginePrivate::seekFdFh ( qint64  pos)

Definition at line 543 of file qfsfileengine.cpp.

References fh, IOFlushCommand, lastIOCommand, pos, QFileDevice::PositionError, qWarning, QFileDevice::ReadError, ret, and QSystemError::stdString().

Referenced by nativeSeek().

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

◆ sizeFdFh()

qint64 QFSFileEnginePrivate::sizeFdFh ( ) const

Definition at line 480 of file qfsfileengine.cpp.

References QFileSystemMetaData::clearFlags(), doStat(), metaData, QFileSystemMetaData::size(), QFileSystemMetaData::SizeAttribute, and tried_stat.

Referenced by nativeSize().

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

◆ unmap()

bool QFSFileEnginePrivate::unmap ( uchar ptr)

Definition at line 630 of file qfsfileengine_unix.cpp.

References QSet< T >::find(), it, maps, QFileDevice::PermissionsError, ptr(), qt_error_string(), and QFileDevice::UnspecifiedError.

Referenced by unmapAll().

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

◆ unmapAll()

void QFSFileEnginePrivate::unmapAll ( )

Definition at line 467 of file qfsfileengine.cpp.

References i, keys, maps, and unmap().

+ Here is the call graph for this function:

◆ writeFdFh()

qint64 QFSFileEnginePrivate::writeFdFh ( const char *  data,
qint64  len 
)

Definition at line 740 of file qfsfileengine.cpp.

References QFileSystemMetaData::clearFlags(), fh, metaData, QT_WRITE, QFileDevice::ResourceError, QFileSystemMetaData::SizeAttribute, QSystemError::stdString(), and QFileDevice::WriteError.

Referenced by nativeWrite().

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

Member Data Documentation

◆ closeFileHandle

bool QFSFileEnginePrivate::closeFileHandle

Definition at line 187 of file qfsfileengine_p.h.

Referenced by closeFdFh(), and init().

◆ fd

int QFSFileEnginePrivate::fd

Definition at line 177 of file qfsfileengine_p.h.

Referenced by doStat(), nativeHandle(), and openFd().

◆ fh

◆ fileEntry

QFileSystemEntry QFSFileEnginePrivate::fileEntry

Definition at line 124 of file qfsfileengine_p.h.

Referenced by doStat(), and isSymlink().

◆ is_link

uint QFSFileEnginePrivate::is_link
mutable

Definition at line 192 of file qfsfileengine_p.h.

Referenced by init().

◆ is_sequential

uint QFSFileEnginePrivate::is_sequential
mutable

Definition at line 189 of file qfsfileengine_p.h.

Referenced by init().

◆ lastFlushFailed

bool QFSFileEnginePrivate::lastFlushFailed

Definition at line 186 of file qfsfileengine_p.h.

Referenced by closeFdFh(), flushFh(), and init().

◆ lastIOCommand

LastIOCommand QFSFileEnginePrivate::lastIOCommand

Definition at line 185 of file qfsfileengine_p.h.

Referenced by flushFh(), init(), and seekFdFh().

◆ maps

QHash<uchar *, StartAndLength> QFSFileEnginePrivate::maps

Definition at line 175 of file qfsfileengine_p.h.

Referenced by map(), unmap(), and unmapAll().

◆ metaData

QFileSystemMetaData QFSFileEnginePrivate::metaData
mutable

Definition at line 159 of file qfsfileengine_p.h.

Referenced by doStat(), isSymlink(), map(), sizeFdFh(), and writeFdFh().

◆ need_lstat

uint QFSFileEnginePrivate::need_lstat
mutable

Definition at line 191 of file qfsfileengine_p.h.

Referenced by init().

◆ openMode

QIODevice::OpenMode QFSFileEnginePrivate::openMode

Definition at line 125 of file qfsfileengine_p.h.

Referenced by init(), map(), nativeOpen(), openFd(), and openFh().

◆ tried_stat

uint QFSFileEnginePrivate::tried_stat
mutable

Definition at line 190 of file qfsfileengine_p.h.

Referenced by closeFdFh(), doStat(), init(), and sizeFdFh().


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