Qt 4.8
Macros | Functions
qiodevice.cpp File Reference
#include "qbytearray.h"
#include "qdebug.h"
#include "qiodevice_p.h"
#include "qfile.h"
#include "qstringlist.h"
#include <limits.h>

Go to the source code of this file.

Macros

#define CHECK_MAXLEN(function, returnType)
 
#define CHECK_READABLE(function, returnType)
 
#define CHECK_WRITABLE(function, returnType)
 
#define Q_VOID
 

Functions

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

Macro Definition Documentation

◆ CHECK_MAXLEN

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

Definition at line 89 of file qiodevice.cpp.

Referenced by QIODevice::read(), QIODevice::readLine(), and QIODevice::write().

◆ CHECK_READABLE

#define CHECK_READABLE (   function,
  returnType 
)
Value:
do { \
if ((d->openMode & ReadOnly) == 0) { \
if (d->openMode == NotOpen) \
return returnType; \
qWarning("QIODevice::"#function": WriteOnly device"); \
return returnType; \
} \
} while (0)
double d
Definition: qnumeric_p.h:62

Definition at line 107 of file qiodevice.cpp.

Referenced by QIODevice::read(), and QIODevice::ungetChar().

◆ CHECK_WRITABLE

#define CHECK_WRITABLE (   function,
  returnType 
)
Value:
do { \
if ((d->openMode & WriteOnly) == 0) { \
if (d->openMode == NotOpen) \
return returnType; \
qWarning("QIODevice::"#function": ReadOnly device"); \
return returnType; \
} \
} while (0)
double d
Definition: qnumeric_p.h:62

Definition at line 97 of file qiodevice.cpp.

Referenced by QIODevice::write().

◆ Q_VOID

#define Q_VOID

Definition at line 87 of file qiodevice.cpp.

Referenced by QIODevice::ungetChar().

Function Documentation

◆ operator<<()

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

Definition at line 1933 of file qiodevice.cpp.

Referenced by QIODevice::write().

1934 {
1935  debug << "OpenMode(";
1936  QStringList modeList;
1937  if (modes == QIODevice::NotOpen) {
1938  modeList << QLatin1String("NotOpen");
1939  } else {
1940  if (modes & QIODevice::ReadOnly)
1941  modeList << QLatin1String("ReadOnly");
1942  if (modes & QIODevice::WriteOnly)
1943  modeList << QLatin1String("WriteOnly");
1944  if (modes & QIODevice::Append)
1945  modeList << QLatin1String("Append");
1946  if (modes & QIODevice::Truncate)
1947  modeList << QLatin1String("Truncate");
1948  if (modes & QIODevice::Text)
1949  modeList << QLatin1String("Text");
1950  if (modes & QIODevice::Unbuffered)
1951  modeList << QLatin1String("Unbuffered");
1952  }
1953  qSort(modeList);
1954  debug << modeList.join(QLatin1String("|"));
1955  debug << ')';
1956  return debug;
1957 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
void qSort(RandomAccessIterator start, RandomAccessIterator end)
Definition: qalgorithms.h:177
QString join(const QString &sep) const
Joins all the string list&#39;s strings into a single string with each element separated by the given sep...
Definition: qstringlist.h:162