Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qiodevice.cpp File Reference

(3e1dffd5ddfeeb19f33abca4e3087211401126f3)

#include "qbytearray.h"
#include "qdebug.h"
#include "qiodevice_p.h"
#include "qfile.h"
#include "qstringlist.h"
#include "qdir.h"
#include "private/qtools_p.h"
#include <algorithm>
#include "moc_qiodevice.cpp"
+ Include dependency graph for qiodevice.cpp:

Go to the source code of this file.

Macros

#define Q_VOID
 
#define CHECK_MAXLEN(function, returnType)
 
#define CHECK_LINEMAXLEN(function, returnType)
 
#define CHECK_LINEMAXLEN_1(function, returnType)
 
#define CHECK_MAXBYTEARRAYSIZE(function)
 
#define CHECK_WRITABLE(function, returnType)
 
#define CHECK_READABLE(function, returnType)
 

Functions

static void debugBinaryString (const char *input, qint64 maxlen)
 
static Q_DECL_COLD_FUNCTION void checkWarnMessage (const QIODevice *device, const char *function, const char *what)
 
int qt_subtract_from_timeout (int timeout, int elapsed)
 
QDebug operator<< (QDebug debug, QIODevice::OpenMode modes)
 

Macro Definition Documentation

◆ CHECK_LINEMAXLEN

#define CHECK_LINEMAXLEN ( function,
returnType )
Value:
do { \
if (maxSize < 2) { \
checkWarnMessage(this, #function, "Called with maxSize < 2"); \
return returnType; \
} \
} while (0)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
[0]

Definition at line 81 of file qiodevice.cpp.

◆ CHECK_LINEMAXLEN_1

#define CHECK_LINEMAXLEN_1 ( function,
returnType )
Value:
do { \
if (maxSize < 1) { \
checkWarnMessage(this, #function, "Called with maxSize < 1"); \
return returnType; \
} \
} while (0)

Definition at line 89 of file qiodevice.cpp.

◆ CHECK_MAXBYTEARRAYSIZE

#define CHECK_MAXBYTEARRAYSIZE ( function)
Value:
do { \
if (maxSize >= QByteArray::maxSize()) { \
checkWarnMessage(this, #function, "maxSize argument exceeds QByteArray size limit"); \
maxSize = QByteArray::maxSize() - 1; \
} \
} while (0)
static constexpr qsizetype maxSize() noexcept
Definition qbytearray.h:493

Definition at line 97 of file qiodevice.cpp.

◆ CHECK_MAXLEN

#define CHECK_MAXLEN ( function,
returnType )
Value:
do { \
if (maxSize < 0) { \
checkWarnMessage(this, #function, "Called with maxSize < 0"); \
return returnType; \
} \
} while (0)

Definition at line 73 of file qiodevice.cpp.

◆ CHECK_READABLE

#define CHECK_READABLE ( function,
returnType )
Value:
do { \
if ((d->openMode & ReadOnly) == 0) { \
if (d->openMode == NotOpen) { \
checkWarnMessage(this, #function, "device not open"); \
return returnType; \
} \
checkWarnMessage(this, #function, "WriteOnly device"); \
return returnType; \
} \
} while (0)
double d
[1]

Definition at line 117 of file qiodevice.cpp.

◆ CHECK_WRITABLE

#define CHECK_WRITABLE ( function,
returnType )
Value:
do { \
if ((d->openMode & WriteOnly) == 0) { \
if (d->openMode == NotOpen) { \
checkWarnMessage(this, #function, "device not open"); \
return returnType; \
} \
checkWarnMessage(this, #function, "ReadOnly device"); \
return returnType; \
} \
} while (0)

Definition at line 105 of file qiodevice.cpp.

◆ Q_VOID

#define Q_VOID

Definition at line 45 of file qiodevice.cpp.

Function Documentation

◆ checkWarnMessage()

static Q_DECL_COLD_FUNCTION void checkWarnMessage ( const QIODevice * device,
const char * function,
const char * what )
static

Definition at line 48 of file qiodevice.cpp.

References operator<<().

+ Here is the call graph for this function:

◆ debugBinaryString()

static void debugBinaryString ( const char * input,
qint64 maxlen )
static

Definition at line 22 of file qiodevice.cpp.

◆ operator<<()

QDebug operator<< ( QDebug debug,
QIODevice::OpenMode modes )

Definition at line 2366 of file qiodevice.cpp.

◆ qt_subtract_from_timeout()

int qt_subtract_from_timeout ( int timeout,
int elapsed )

Reduces the timeout by elapsed, taking into account that -1 is a special value for timeouts.

Definition at line 2355 of file qiodevice.cpp.