7#if !defined(QT_NO_DATASTREAM) || defined(QT_BOOTSTRAPPED)
18constexpr quint32 QDataStream::NullCode;
19constexpr quint32 QDataStream::ExtendedSize;
254#undef CHECK_STREAM_PRECOND
256#define CHECK_STREAM_PRECOND(retVal) \
258 qWarning("QDataStream: No device"); \
262#define CHECK_STREAM_PRECOND(retVal) \
268#define CHECK_STREAM_WRITE_PRECOND(retVal) \
269 CHECK_STREAM_PRECOND(retVal) \
270 if (q_status != Ok) \
273#define CHECK_STREAM_TRANSACTION_PRECOND(retVal) \
274 if (transactionDepth == 0) { \
275 qWarning("QDataStream: No transaction in progress"); \
317 buf->blockSignals(
true);
399 return dev ? dev->
atEnd() :
true;
492#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED)
624 if (++transactionDepth == 1) {
653 if (--transactionDepth == 0) {
656 if (q_status == ReadPastEnd) {
662 return q_status ==
Ok;
693 if (--transactionDepth != 0)
697 if (q_status == ReadPastEnd)
726 q_status = ReadCorruptData;
729 if (--transactionDepth != 0)
759 if (readResult !=
len)
793 if (readBlock(&
c, 1) == 1)
818 if (readBlock(
reinterpret_cast<char *
>(&
i), 2) != 2) {
848 if (readBlock(
reinterpret_cast<char *
>(&
i), 4) != 4) {
882 if (readBlock(
reinterpret_cast<char *
>(&
i), 8) != 8) {
917 if (
version() >= QDataStream::Qt_4_6
927 if (readBlock(
reinterpret_cast<char *
>(&
f), 4) != 4) {
954 if (
version() >= QDataStream::Qt_4_6
964 if (readBlock(
reinterpret_cast<char *
>(&
f), 8) != 8) {
1031#if QT_DEPRECATED_SINCE(6, 11)
1092 std::unique_ptr<char[]> curBuf =
nullptr;
1094 constexpr qsizetype StepIncreaseThreshold = std::numeric_limits<qsizetype>::max() / 2;
1098 if (
const auto prevBuf = std::exchange(curBuf, std::make_unique<
char[]>(
n)))
1099 memcpy(curBuf.get(), prevBuf.get(), allocated);
1103 if (step <= StepIncreaseThreshold)
1105 }
while (allocated <
len);
1107 s = curBuf.release();
1125 return readBlock(
s,
len);
1170 q_status = WriteFailed;
1197 q_status = WriteFailed;
1215 q_status = WriteFailed;
1246 q_status = WriteFailed;
1278 if (
version() >= QDataStream::Qt_4_6
1294 if (dev->
write((
char *)&
x.val2,
sizeof(
float)) !=
sizeof(
float))
1295 q_status = WriteFailed;
1299 if (dev->
write((
char *)&
g,
sizeof(
float)) !=
sizeof(
float))
1300 q_status = WriteFailed;
1316 if (
version() >= QDataStream::Qt_4_6
1324 if (dev->
write((
char *)&
f,
sizeof(
double)) !=
sizeof(
double))
1325 q_status = WriteFailed;
1333 if (dev->
write((
char *)&
x.val2,
sizeof(
double)) !=
sizeof(
double))
1334 q_status = WriteFailed;
1397 q_status = WriteFailed;
1402 if (writeQSizeType(*
this,
len) &&
len > 0)
1420 q_status = WriteFailed;
1442 if (skipResult !=
len)
\inmodule QtCore \reentrant
\inmodule QtCore\reentrant
void setFloatingPointPrecision(FloatingPointPrecision precision)
Sets the floating point precision of the data stream to precision.
Status status() const
Returns the status of the data stream.
ByteOrder
The byte order used for reading/writing the data.
qint64 readRawData(char *, qint64 len)
Reads at most len bytes from the stream into s and returns the number of bytes read.
Q_CORE_EXPORT friend QDataStream & operator>>(QDataStream &in, QString &str)
bool isDeviceTransactionStarted() const
QDataStream & readBytes(char *&, qint64 &len)
~QDataStream()
Destroys the data stream.
void rollbackTransaction()
void resetStatus()
Resets the status of the data stream.
void setDevice(QIODevice *)
void QDataStream::setDevice(QIODevice *d)
FloatingPointPrecision floatingPointPrecision() const
Returns the floating point precision of the data stream.
qint64 skipRawData(qint64 len)
qint64 writeRawData(const char *, qint64 len)
Writes len bytes from s to the stream.
QDataStream & writeBytes(const char *, qint64 len)
Writes the length specifier len and the buffer s to the stream and returns a reference to the stream.
QDataStream()
Constructs a data stream that has no I/O device.
bool atEnd() const
Returns true if the I/O device has reached the end position (end of the stream or file) or if there i...
Q_CORE_EXPORT friend QDataStream & operator<<(QDataStream &out, const QString &str)
int version() const
Returns the version number of the data serialization format.
void setStatus(Status status)
Sets the status of the data stream to the status given.
void setByteOrder(ByteOrder)
Sets the serialization byte order to bo.
\inmodule QtCore \reentrant
bool putChar(char c)
Writes the character c to the device.
void rollbackTransaction()
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
virtual qint64 bytesAvailable() const
Returns the number of bytes that are available for reading.
qint64 skip(qint64 maxSize)
bool isTransactionStarted() const
virtual bool atEnd() const
Returns true if the current read and write position is at the end of the device (i....
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read.
bool blockSignals(bool b) noexcept
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke...
Combined button and popup list for selecting options.
size_t qstrlen(const char *str)
#define CHECK_STREAM_WRITE_PRECOND(retVal)
#define CHECK_STREAM_PRECOND(retVal)
#define CHECK_STREAM_TRANSACTION_PRECOND(retVal)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
constexpr T qbswap(T source)
QT_BEGIN_NAMESPACE constexpr const T & qMin(const T &a, const T &b)
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLint GLint * precision
unsigned long long quint64
QT_BEGIN_NAMESPACE typedef signed char qint8