Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inheaderfile QIODevice \inmodule QtCore More...
#include <qiodevicebase.h>
Public Types | |
enum | OpenModeFlag { NotOpen = 0x0000 , ReadOnly = 0x0001 , WriteOnly = 0x0002 , ReadWrite = ReadOnly | WriteOnly , Append = 0x0004 , Truncate = 0x0008 , Text = 0x0010 , Unbuffered = 0x0020 , NewOnly = 0x0040 , ExistingOnly = 0x0080 } |
This enum is used with QIODevice::open() to describe the mode in which a device is opened. More... | |
Protected Member Functions | |
~QIODeviceBase ()=default | |
\inheaderfile QIODevice \inmodule QtCore
Base class for QIODevice that provides flags describing the mode in which a device is opened.
Definition at line 11 of file qiodevicebase.h.
This enum is used with QIODevice::open() to describe the mode in which a device is opened.
It is also returned by QIODevice::openMode().
\value NotOpen The device is not open. \value ReadOnly The device is open for reading. \value WriteOnly The device is open for writing. Note that, for file-system subclasses (e.g. QFile), this mode implies Truncate unless combined with ReadOnly, Append or NewOnly. \value ReadWrite The device is open for reading and writing. \value Append The device is opened in append mode so that all data is written to the end of the file. \value Truncate If possible, the device is truncated before it is opened. All earlier contents of the device are lost. \value Text When reading, the end-of-line terminators are translated to '\n'. When writing, the end-of-line terminators are translated to the local encoding, for example '\r\n' for Win32. \value Unbuffered Any buffer in the device is bypassed. \value NewOnly Fail if the file to be opened already exists. Create and open the file only if it does not exist. There is a guarantee from the operating system that you are the only one creating and opening the file. Note that this mode implies WriteOnly, and combining it with ReadWrite is allowed. This flag currently only affects QFile. Other classes might use this flag in the future, but until then using this flag with any classes other than QFile may result in undefined behavior. (since Qt 5.11) \value ExistingOnly Fail if the file to be opened does not exist. This flag must be specified alongside ReadOnly, WriteOnly, or ReadWrite. Note that using this flag with ReadOnly alone is redundant, as ReadOnly already fails when the file does not exist. This flag currently only affects QFile. Other classes might use this flag in the future, but until then using this flag with any classes other than QFile may result in undefined behavior. (since Qt 5.11)
Certain flags, such as Unbuffered
and Truncate
, are meaningless when used with some subclasses. Some of these restrictions are implied by the type of device that is represented by a subclass. In other cases, the restriction may be due to the implementation, or may be imposed by the underlying platform; for example, QTcpSocket does not support Unbuffered
mode, and limitations in the native API prevent QFile from supporting Unbuffered
on Windows.
Enumerator | |
---|---|
NotOpen | |
ReadOnly | |
WriteOnly | |
ReadWrite | |
Append | |
Truncate | |
Text | |
Unbuffered | |
NewOnly | |
ExistingOnly |
Definition at line 16 of file qiodevicebase.h.
|
protecteddefault |