![]() |
Qt 6.x
The Qt SDK
|
#include <qfsfileengine_p.h>
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 |
uchar * | map (qint64 offset, qint64 size, QFile::MemoryMapFlags flags) |
bool | unmap (uchar *ptr) |
void | unmapAll () |
bool | doStat (QFileSystemMetaData::MetaDataFlags flags=QFileSystemMetaData::PosixStatFlags) const |
bool | isSymlink () const |
![]() | |
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 *, StartAndLength > | maps |
int | fd |
LastIOCommand | lastIOCommand |
bool | lastFlushFailed |
bool | closeFileHandle |
uint | is_sequential: 2 |
uint | tried_stat: 1 |
uint | need_lstat: 1 |
uint | is_link: 1 |
![]() | |
QFile::FileError | fileError |
QString | errorString |
QAbstractFileEngine * | q_ptr |
Protected Member Functions | |
QFSFileEnginePrivate () | |
void | init () |
QAbstractFileEngine::FileFlags | getPermissions (QAbstractFileEngine::FileFlags type) const |
Definition at line 115 of file qfsfileengine_p.h.
Enumerator | |
---|---|
IOFlushCommand | |
IOReadCommand | |
IOWriteCommand |
Definition at line 179 of file qfsfileengine_p.h.
|
protected |
Definition at line 80 of file qfsfileengine.cpp.
References init().
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().
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().
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().
|
protected |
|
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().
bool QFSFileEnginePrivate::isSequentialFdFh | ( | ) | const |
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.
Definition at line 547 of file qfsfileengine_unix.cpp.
References doStat(), MAP_FAILED, QFileDevice::MapPrivateOption, maps, metaData, nativeHandle(), QIODeviceBase::NotOpen, openMode, QFileDevice::PermissionsError, Q_INT64_C, qMin(), qt_error_string(), qWarning, QIODeviceBase::ReadOnly, QFileDevice::ResourceError, QFileSystemMetaData::size(), QFileSystemMetaData::SizeAttribute, QFileDevice::UnspecifiedError, and QIODeviceBase::WriteOnly.
bool QFSFileEnginePrivate::nativeClose | ( | ) |
Definition at line 140 of file qfsfileengine_unix.cpp.
References closeFdFh().
bool QFSFileEnginePrivate::nativeFlush | ( | ) |
int QFSFileEnginePrivate::nativeHandle | ( | ) | const |
Definition at line 268 of file qfsfileengine_unix.cpp.
Referenced by map(), and nativeSyncToDisk().
bool QFSFileEnginePrivate::nativeIsSequential | ( | ) | const |
Definition at line 276 of file qfsfileengine_unix.cpp.
References isSequentialFdFh().
Referenced by nativeRead().
bool QFSFileEnginePrivate::nativeOpen | ( | QIODevice::OpenMode | openMode, |
std::optional< QFile::Permissions > | permissions | ||
) |
Definition at line 75 of file qfsfileengine_unix.cpp.
References openMode.
qint64 QFSFileEnginePrivate::nativePos | ( | ) | const |
Definition at line 252 of file qfsfileengine_unix.cpp.
References posFdFh().
Definition at line 175 of file qfsfileengine_unix.cpp.
References fh, i, nativeIsSequential(), qt_error_string(), read(), QFileDevice::ReadError, and readFdFh().
Definition at line 236 of file qfsfileengine_unix.cpp.
References readLineFdFh().
bool QFSFileEnginePrivate::nativeSeek | ( | qint64 | pos | ) |
Definition at line 260 of file qfsfileengine_unix.cpp.
References pos, and seekFdFh().
qint64 QFSFileEnginePrivate::nativeSize | ( | ) | const |
Definition at line 292 of file qfsfileengine_unix.cpp.
References sizeFdFh().
bool QFSFileEnginePrivate::nativeSyncToDisk | ( | ) |
Definition at line 158 of file qfsfileengine_unix.cpp.
References EINTR_LOOP, nativeHandle(), qt_error_string(), ret, and QFileDevice::WriteError.
Definition at line 244 of file qfsfileengine_unix.cpp.
References writeFdFh().
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().
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.
|
inlinestatic |
Definition at line 205 of file qfsfileengine_p.h.
References QIODeviceBase::ExistingOnly, and QIODeviceBase::WriteOnly.
Referenced by openModeToOpenFlags().
qint64 QFSFileEnginePrivate::posFdFh | ( | ) | const |
Definition at line 505 of file qfsfileengine.cpp.
References fh.
Referenced by nativePos().
Definition at line 608 of file qfsfileengine.cpp.
References fh, QT_READ, QFileDevice::ReadError, and QSystemError::stdString().
Referenced by nativeRead().
Definition at line 686 of file qfsfileengine.cpp.
References fh, qstrlen(), QFileDevice::ReadError, and QSystemError::stdString().
Referenced by nativeReadLine().
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().
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().
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().
void QFSFileEnginePrivate::unmapAll | ( | ) |
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().
bool QFSFileEnginePrivate::closeFileHandle |
Definition at line 187 of file qfsfileengine_p.h.
Referenced by closeFdFh(), and init().
int QFSFileEnginePrivate::fd |
Definition at line 177 of file qfsfileengine_p.h.
Referenced by doStat(), nativeHandle(), and openFd().
FILE* QFSFileEnginePrivate::fh |
Definition at line 161 of file qfsfileengine_p.h.
Referenced by closeFdFh(), doStat(), flushFh(), init(), nativeFlush(), nativeHandle(), nativeRead(), openFd(), openFh(), posFdFh(), readFdFh(), readLineFdFh(), seekFdFh(), and writeFdFh().
QFileSystemEntry QFSFileEnginePrivate::fileEntry |
Definition at line 124 of file qfsfileengine_p.h.
Referenced by doStat(), and isSymlink().
|
mutable |
Definition at line 192 of file qfsfileengine_p.h.
Referenced by init().
|
mutable |
Definition at line 189 of file qfsfileengine_p.h.
Referenced by init().
bool QFSFileEnginePrivate::lastFlushFailed |
Definition at line 186 of file qfsfileengine_p.h.
Referenced by closeFdFh(), flushFh(), and init().
LastIOCommand QFSFileEnginePrivate::lastIOCommand |
Definition at line 185 of file qfsfileengine_p.h.
Referenced by flushFh(), init(), and seekFdFh().
QHash<uchar *, StartAndLength> QFSFileEnginePrivate::maps |
Definition at line 175 of file qfsfileengine_p.h.
Referenced by map(), unmap(), and unmapAll().
|
mutable |
Definition at line 159 of file qfsfileengine_p.h.
Referenced by doStat(), isSymlink(), map(), sizeFdFh(), and writeFdFh().
|
mutable |
Definition at line 191 of file qfsfileengine_p.h.
Referenced by init().
QIODevice::OpenMode QFSFileEnginePrivate::openMode |
Definition at line 125 of file qfsfileengine_p.h.
Referenced by init(), map(), nativeOpen(), openFd(), and openFh().
|
mutable |
Definition at line 190 of file qfsfileengine_p.h.
Referenced by closeFdFh(), doStat(), init(), and sizeFdFh().