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)
623 if (++transactionDepth == 1) {
652 if (--transactionDepth == 0) {
655 if (q_status == ReadPastEnd) {
661 return q_status ==
Ok;
692 if (--transactionDepth != 0)
696 if (q_status == ReadPastEnd)
725 q_status = ReadCorruptData;
728 if (--transactionDepth != 0)
758 if (readResult !=
len)
792 if (readBlock(&
c, 1) == 1)
817 if (readBlock(
reinterpret_cast<char *
>(&
i), 2) != 2) {
847 if (readBlock(
reinterpret_cast<char *
>(&
i), 4) != 4) {
881 if (readBlock(
reinterpret_cast<char *
>(&
i), 8) != 8) {
916 if (
version() >= QDataStream::Qt_4_6
926 if (readBlock(
reinterpret_cast<char *
>(&
f), 4) != 4) {
953 if (
version() >= QDataStream::Qt_4_6
963 if (readBlock(
reinterpret_cast<char *
>(&
f), 8) != 8) {
1030#if QT_DEPRECATED_SINCE(6, 11)
1091 std::unique_ptr<char[]> curBuf =
nullptr;
1093 constexpr qsizetype StepIncreaseThreshold = std::numeric_limits<qsizetype>::max() / 2;
1097 if (
const auto prevBuf = std::exchange(curBuf, std::make_unique<
char[]>(
n)))
1098 memcpy(curBuf.get(), prevBuf.get(), allocated);
1102 if (step <= StepIncreaseThreshold)
1104 }
while (allocated <
len);
1106 s = curBuf.release();
1124 return readBlock(
s,
len);
1169 q_status = WriteFailed;
1196 q_status = WriteFailed;
1214 q_status = WriteFailed;
1245 q_status = WriteFailed;
1277 if (
version() >= QDataStream::Qt_4_6
1293 if (dev->
write((
char *)&
x.val2,
sizeof(
float)) !=
sizeof(
float))
1294 q_status = WriteFailed;
1298 if (dev->
write((
char *)&
g,
sizeof(
float)) !=
sizeof(
float))
1299 q_status = WriteFailed;
1315 if (
version() >= QDataStream::Qt_4_6
1323 if (dev->
write((
char *)&
f,
sizeof(
double)) !=
sizeof(
double))
1324 q_status = WriteFailed;
1332 if (dev->
write((
char *)&
x.val2,
sizeof(
double)) !=
sizeof(
double))
1333 q_status = WriteFailed;
1396 q_status = WriteFailed;
1401 if (writeQSizeType(*
this,
len) &&
len > 0)
1419 q_status = WriteFailed;
1441 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)
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