7#if !defined(QT_NO_DATASTREAM) || defined(QT_BOOTSTRAPPED)
212#undef CHECK_STREAM_PRECOND
214#define CHECK_STREAM_PRECOND(retVal) \
216 qWarning("QDataStream: No device"); \
220#define CHECK_STREAM_PRECOND(retVal) \
226#define CHECK_STREAM_WRITE_PRECOND(retVal) \
227 CHECK_STREAM_PRECOND(retVal) \
228 if (q_status != Ok) \
231#define CHECK_STREAM_TRANSACTION_PRECOND(retVal) \
232 if (!d || d->transactionDepth == 0) { \
233 qWarning("QDataStream: No transaction in progress"); \
286 buf->blockSignals(
true);
376 return dev ? dev->
atEnd() :
true;
644 return q_status ==
Ok;
734int QDataStream::readBlock(
char *
data,
int len)
741 if (readResult !=
len)
775 if (readBlock(&
c, 1) == 1)
800 if (readBlock(
reinterpret_cast<char *
>(&
i), 2) != 2) {
830 if (readBlock(
reinterpret_cast<char *
>(&
i), 4) != 4) {
864 if (readBlock(
reinterpret_cast<char *
>(&
i), 8) != 8) {
909 if (readBlock(
reinterpret_cast<char *
>(&
f), 4) != 4) {
946 if (readBlock(
reinterpret_cast<char *
>(&
f), 8) != 8) {
1039 const quint32 Step = 1024 * 1024;
1041 char *prevBuf =
nullptr;
1042 char *curBuf =
nullptr;
1047 curBuf =
new char[allocated +
blockSize + 1];
1049 memcpy(curBuf, prevBuf, allocated);
1057 }
while (allocated <
len);
1077 return readBlock(
s,
len);
1251 if (dev->
write((
char *)&
x.val2,
sizeof(
float)) !=
sizeof(
float))
1256 if (dev->
write((
char *)&
g,
sizeof(
float)) !=
sizeof(
float))
1281 if (dev->
write((
char *)&
f,
sizeof(
double)) !=
sizeof(
double))
1290 if (dev->
write((
char *)&
x.val2,
sizeof(
double)) !=
sizeof(
double))
1398 const int skipResult = dev->
skip(
len);
1399 if (skipResult !=
len)
\inmodule QtCore \reentrant
QDataStream::FloatingPointPrecision floatingPointPrecision
\inmodule QtCore\reentrant
QDataStream & operator>>(char &i)
void setFloatingPointPrecision(FloatingPointPrecision precision)
Sets the floating point precision of the data stream to precision.
ByteOrder
The byte order used for reading/writing the data.
int readRawData(char *, int len)
Reads at most len bytes from the stream into s and returns the number of bytes read.
@ Qt_DefaultCompiledVersion
QDataStream & readBytes(char *&, uint &len)
Reads the buffer s from the stream and returns a reference to the stream.
bool isDeviceTransactionStarted() const
Status
This enum describes the current status of the data stream.
int writeRawData(const char *, int len)
Writes len bytes from s to the stream.
~QDataStream()
Destroys the data stream.
void rollbackTransaction()
QDataStream & writeBytes(const char *, uint len)
Writes the length specifier len and the buffer s to the stream and returns a reference to the stream.
void resetStatus()
Resets the status of the data stream.
void setDevice(QIODevice *)
void QDataStream::setDevice(QIODevice *d)
Status status() const
Returns the status of the data stream.
FloatingPointPrecision floatingPointPrecision() const
Returns the floating point precision of the data stream.
FloatingPointPrecision
The precision of floating point numbers used for reading/writing the data.
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...
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.
QDataStream & operator<<(char i)
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.
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...
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
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)
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 const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLint GLint * precision
unsigned long long quint64
QT_BEGIN_NAMESPACE typedef signed char qint8