45 #include <QtCore/qscopedpointer.h> 46 #include <QtCore/qiodevice.h> 47 #include <QtCore/qglobal.h> 50 #error qdatastream.h must be included before any header file that defines Status 62 template <
typename T>
class QList;
65 template <
typename T>
class QSet;
66 template <
class Key,
class T>
class QHash;
67 template <
class Key,
class T>
class QMap;
69 #if !defined(QT_NO_DATASTREAM) || defined(QT_BOOTSTRAPPED) 90 #if QT_VERSION >= 0x040900 91 #error Add the datastream version for this Qt version 97 BigEndian = QSysInfo::BigEndian,
98 LittleEndian = QSysInfo::LittleEndian
128 inline QT3_SUPPORT
bool eof()
const {
return atEnd(); }
142 void setVersion(
int);
172 int readRawData(
char *,
int len);
175 int writeRawData(
const char *,
int len);
177 int skipRawData(
int len);
181 { readRawData(str, static_cast<int>(len));
return *
this; }
182 inline QT3_SUPPORT
QDataStream &writeRawBytes(
const char *str,
uint len)
183 { writeRawData(str, static_cast<int>(len));
return *
this; }
184 inline QT3_SUPPORT
bool isPrintableData()
const {
return false; }
185 inline QT3_SUPPORT
void setPrintableData(
bool) {}
210 {
return byteorder; }
219 {
return *
this >>
reinterpret_cast<qint8&
>(i); }
222 {
return *
this >>
reinterpret_cast<qint16&
>(i); }
225 {
return *
this >>
reinterpret_cast<qint32&
>(i); }
228 {
return *
this >>
reinterpret_cast<qint64&
>(i); }
231 {
return *
this <<
qint8(i); }
234 {
return *
this <<
qint16(i); }
237 {
return *
this <<
qint32(i); }
240 {
return *
this <<
qint64(i); }
242 template <
typename T>
260 template <
typename T>
264 for (
int i = 0; i <
l.size(); ++i)
269 template <
typename T>
286 template <
typename T>
291 for(; it !=
l.constEnd(); ++
it)
320 template <
typename T>
336 template <
typename T>
341 while (i !=
set.constEnd()) {
348 template <
class Key,
class T>
358 for (
quint32 i = 0; i < n; ++i) {
375 template <
class Key,
class T>
381 while (it != begin) {
383 out << it.key() << it.value();
388 template <
class Key,
class T>
391 template <
class aKey,
class aT>
404 for (
quint32 i = 0; i < n; ++i) {
421 template <
class Key,
class T>
427 while (it != begin) {
429 out << it.key() << it.value();
434 #endif // QT_NO_DATASTREAM 440 #endif // QDATASTREAM_H void clear()
Removes all the items in the list.
Status status() const
Returns the status of the data stream.
static uint hash(const uchar *p, int n)
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
void setInsertInOrder(bool ordered)
#define QT_END_NAMESPACE
This macro expands to.
QDataStream & operator>>(QDataStream &s, QList< T > &l)
void clear()
Removes all items from the hash.
Status
This enum describes the current status of the data stream.
#define it(className, varName)
ByteOrder byteOrder() const
Returns the current byte order setting – either BigEndian or LittleEndian.
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...
The QByteArray class provides an array of bytes.
int size() const
Returns the number of (key, value) pairs in the map.
static LibLoadStatus status
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
void append(const T &)
Inserts value at the end of the list.
void setStatus(Status status)
Sets the status of the data stream to the status given.
The QHash class is a template class that provides a hash-table-based dictionary.
static bool setByteOrder(iconv_t cd)
FloatingPointPrecision
The precision of floating point numbers used for reading/writing the data.
The QVector class is a template class that provides a dynamic array.
void resize(int size)
Sets the size of the vector to size.
The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon dest...
void setVersion(int)
Sets the version number of the data serialization format to v.
iterator insertMulti(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
The QLinkedList class is a template class that provides linked lists.
void append(const T &t)
Inserts value at the end of the list.
QFuture< void > map(Sequence &sequence, MapFunction function)
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QLinkedList::const_iterator class provides an STL-style const iterator for QLinkedList.
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
Version
This enum provides symbolic synonyms for the data serialization format version numbers.
void clear()
Removes all items from the list.
void detach()
Detaches this map from any other maps with which it may share data.
handler setDevice(device)
iterator begin()
Returns an STL-style iterator pointing to the first item in the map.
int version() const
Returns the version number of the data serialization format.
The QMap::const_iterator class provides an STL-style const iterator for QMap and QMultiMap.
QDataStream & operator<<(QDataStream &s, const QList< T > &l)
void resetStatus()
Resets the status of the data stream.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the map...
QDataStream & operator>>(qint8 &i)
Reads a signed byte from the stream into i, and returns a reference to the stream.
const T * const_iterator
The QVector::const_iterator typedef provides an STL-style const iterator for QVector and QStack...
The QDataStream class provides serialization of binary data to a QIODevice.
ByteOrder
The byte order used for reading/writing the data.
iterator insertMulti(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QDataStream & operator<<(qint8 i)
Writes a signed byte, i, to the stream and returns a reference to the stream.
#define Q_OUTOFLINE_TEMPLATE
The QIODevice class is the base interface class of all I/O devices in Qt.
void clear()
Removes all items from the map.
The QMap class is a template class that provides a skip-list-based dictionary.
void reserve(int size)
Reserve space for alloc elements.
The QList class is a template class that provides lists.