API reference - Class QDataStream

Notation used in Ruby API documentation

Module: QtCore

Description: Binding of QDataStream

Sub-classes: ByteOrder, QFlags_ByteOrder, FloatingPointPrecision, QFlags_FloatingPointPrecision, Status, QFlags_Status

Public constructors

new QDataStreamnewConstructor QDataStream::QDataStream()
new QDataStreamnew(QIODevice ptr arg1)Constructor QDataStream::QDataStream(QIODevice *)
new QDataStreamnew(bytes ptr arg1,
QIODevice_QFlags_OpenModeFlag flags)
Constructor QDataStream::QDataStream(QByteArray *, QFlags<QIODevice::OpenModeFlag> flags)
new QDataStreamnew(bytes arg1)Constructor QDataStream::QDataStream(const QByteArray &)

Public methods

[const]QDataStream ptr_const_castReturns a non-const reference to self.
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
voidabortTransactionMethod void QDataStream::abortTransaction()
[const]boolatEndMethod bool QDataStream::atEnd()
[const]QDataStream_ByteOrderbyteOrderMethod QDataStream::ByteOrder QDataStream::byteOrder()
voidbyteOrder=(const QDataStream_ByteOrder arg1)Method void QDataStream::setByteOrder(QDataStream::ByteOrder)
boolcommitTransactionMethod bool QDataStream::commitTransaction()
[const]QIODevice ptrdeviceMethod QIODevice *QDataStream::device()
voiddevice=(QIODevice ptr arg1)Method void QDataStream::setDevice(QIODevice *)
[const]QDataStream_FloatingPointPrecisionfloatingPointPrecisionMethod QDataStream::FloatingPointPrecision QDataStream::floatingPointPrecision()
voidfloatingPointPrecision=(const QDataStream_FloatingPointPrecision precision)Method void QDataStream::setFloatingPointPrecision(QDataStream::FloatingPointPrecision precision)
QDataStream ptrput_b(bool arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_ba(bytes arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_d(double arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_f(float arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_i16(short arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_i32(int arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_i64(long long arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_i8(signed char arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_il(int[] arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_iv(int[] arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_qc(unsigned int arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_s(string arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_ui16(unsigned short arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_ui32(unsigned int arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_ui64(unsigned long long arg1)Non-ambiguous adaptation of the corresponding operator<<
QDataStream ptrput_ui8(unsigned char arg1)Non-ambiguous adaptation of the corresponding operator<<
boolread_bNon-ambiguous adaptation of the corresponding operator>>
bytesread_baNon-ambiguous adaptation of the corresponding operator>>
doubleread_dNon-ambiguous adaptation of the corresponding operator>>
floatread_fNon-ambiguous adaptation of the corresponding operator>>
shortread_i16Non-ambiguous adaptation of the corresponding operator>>
intread_i32Non-ambiguous adaptation of the corresponding operator>>
long longread_i64Non-ambiguous adaptation of the corresponding operator>>
signed charread_i8Non-ambiguous adaptation of the corresponding operator>>
int[]read_ilNon-ambiguous adaptation of the corresponding operator>>
int[]read_ivNon-ambiguous adaptation of the corresponding operator>>
unsigned intread_qcNon-ambiguous adaptation of the corresponding operator>>
stringread_sNon-ambiguous adaptation of the corresponding operator>>
unsigned shortread_ui16Non-ambiguous adaptation of the corresponding operator>>
unsigned intread_ui32Non-ambiguous adaptation of the corresponding operator>>
unsigned long longread_ui64Non-ambiguous adaptation of the corresponding operator>>
unsigned charread_ui8Non-ambiguous adaptation of the corresponding operator>>
voidresetStatusMethod void QDataStream::resetStatus()
voidrollbackTransactionMethod void QDataStream::rollbackTransaction()
voidsetByteOrder(const QDataStream_ByteOrder arg1)Method void QDataStream::setByteOrder(QDataStream::ByteOrder)
voidsetDevice(QIODevice ptr arg1)Method void QDataStream::setDevice(QIODevice *)
voidsetFloatingPointPrecision(const QDataStream_FloatingPointPrecision precision)Method void QDataStream::setFloatingPointPrecision(QDataStream::FloatingPointPrecision precision)
voidsetStatus(const QDataStream_Status status)Method void QDataStream::setStatus(QDataStream::Status status)
voidsetVersion(int arg1)Method void QDataStream::setVersion(int)
intskipRawData(int len)Method int QDataStream::skipRawData(int len)
voidstartTransactionMethod void QDataStream::startTransaction()
[const]QDataStream_StatusstatusMethod QDataStream::Status QDataStream::status()
voidstatus=(const QDataStream_Status status)Method void QDataStream::setStatus(QDataStream::Status status)
voidunsetDeviceMethod void QDataStream::unsetDevice()
[const]intversionMethod int QDataStream::version()
voidversion=(int arg1)Method void QDataStream::setVersion(int)
QDataStreamwriteBytes(string arg1,
unsigned int len)
Method QDataStream &QDataStream::writeBytes(const char *, unsigned int len)
intwriteRawData(string arg1,
int len)
Method int QDataStream::writeRawData(const char *, int len)

Public static methods and constants

[static,const]QDataStream_ByteOrderBigEndianEnum constant QDataStream::BigEndian
[static,const]QDataStream_FloatingPointPrecisionDoublePrecisionEnum constant QDataStream::DoublePrecision
[static,const]QDataStream_ByteOrderLittleEndianEnum constant QDataStream::LittleEndian
[static,const]QDataStream_StatusOkEnum constant QDataStream::Ok
[static,const]QDataStream_StatusReadCorruptDataEnum constant QDataStream::ReadCorruptData
[static,const]QDataStream_StatusReadPastEndEnum constant QDataStream::ReadPastEnd
[static,const]QDataStream_FloatingPointPrecisionSinglePrecisionEnum constant QDataStream::SinglePrecision
[static,const]QDataStream_StatusWriteFailedEnum constant QDataStream::WriteFailed

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

BigEndian

Signature: [static,const] QDataStream_ByteOrder BigEndian

Description: Enum constant QDataStream::BigEndian

Python specific notes:
The object exposes a readable attribute 'BigEndian'. This is the getter.

DoublePrecision

Signature: [static,const] QDataStream_FloatingPointPrecision DoublePrecision

Description: Enum constant QDataStream::DoublePrecision

Python specific notes:
The object exposes a readable attribute 'DoublePrecision'. This is the getter.

LittleEndian

Signature: [static,const] QDataStream_ByteOrder LittleEndian

Description: Enum constant QDataStream::LittleEndian

Python specific notes:
The object exposes a readable attribute 'LittleEndian'. This is the getter.

Ok

Signature: [static,const] QDataStream_Status Ok

Description: Enum constant QDataStream::Ok

Python specific notes:
The object exposes a readable attribute 'Ok'. This is the getter.

ReadCorruptData

Signature: [static,const] QDataStream_Status ReadCorruptData

Description: Enum constant QDataStream::ReadCorruptData

Python specific notes:
The object exposes a readable attribute 'ReadCorruptData'. This is the getter.

ReadPastEnd

Signature: [static,const] QDataStream_Status ReadPastEnd

Description: Enum constant QDataStream::ReadPastEnd

Python specific notes:
The object exposes a readable attribute 'ReadPastEnd'. This is the getter.

SinglePrecision

Signature: [static,const] QDataStream_FloatingPointPrecision SinglePrecision

Description: Enum constant QDataStream::SinglePrecision

Python specific notes:
The object exposes a readable attribute 'SinglePrecision'. This is the getter.

WriteFailed

Signature: [static,const] QDataStream_Status WriteFailed

Description: Enum constant QDataStream::WriteFailed

Python specific notes:
The object exposes a readable attribute 'WriteFailed'. This is the getter.

_const_cast

Signature: [const] QDataStream ptr _const_cast

Description: Returns a non-const reference to self.

Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects.

This method has been introduced in version 0.29.6.

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

abortTransaction

Signature: void abortTransaction

Description: Method void QDataStream::abortTransaction()

atEnd

Signature: [const] bool atEnd

Description: Method bool QDataStream::atEnd()

byteOrder

Signature: [const] QDataStream_ByteOrder byteOrder

Description: Method QDataStream::ByteOrder QDataStream::byteOrder()

Python specific notes:
The object exposes a readable attribute 'byteOrder'. This is the getter.

byteOrder=

Signature: void byteOrder= (const QDataStream_ByteOrder arg1)

Description: Method void QDataStream::setByteOrder(QDataStream::ByteOrder)

Python specific notes:
The object exposes a writable attribute 'byteOrder'. This is the setter.

commitTransaction

Signature: bool commitTransaction

Description: Method bool QDataStream::commitTransaction()

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

device

Signature: [const] QIODevice ptr device

Description: Method QIODevice *QDataStream::device()

Python specific notes:
The object exposes a readable attribute 'device'. This is the getter.

device=

Signature: void device= (QIODevice ptr arg1)

Description: Method void QDataStream::setDevice(QIODevice *)

Python specific notes:
The object exposes a writable attribute 'device'. This is the setter.

floatingPointPrecision

Signature: [const] QDataStream_FloatingPointPrecision floatingPointPrecision

Description: Method QDataStream::FloatingPointPrecision QDataStream::floatingPointPrecision()

Python specific notes:
The object exposes a readable attribute 'floatingPointPrecision'. This is the getter.

floatingPointPrecision=

Signature: void floatingPointPrecision= (const QDataStream_FloatingPointPrecision precision)

Description: Method void QDataStream::setFloatingPointPrecision(QDataStream::FloatingPointPrecision precision)

Python specific notes:
The object exposes a writable attribute 'floatingPointPrecision'. This is the setter.

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

new

(1) Signature: [static] new QDataStream new

Description: Constructor QDataStream::QDataStream()

This method creates an object of class QDataStream.

Python specific notes:
This method is the default initializer of the object.

(2) Signature: [static] new QDataStream new (QIODevice ptr arg1)

Description: Constructor QDataStream::QDataStream(QIODevice *)

This method creates an object of class QDataStream.

Python specific notes:
This method is the default initializer of the object.

(3) Signature: [static] new QDataStream new (bytes ptr arg1, QIODevice_QFlags_OpenModeFlag flags)

Description: Constructor QDataStream::QDataStream(QByteArray *, QFlags<QIODevice::OpenModeFlag> flags)

This method creates an object of class QDataStream.

Python specific notes:
This method is the default initializer of the object.

(4) Signature: [static] new QDataStream new (bytes arg1)

Description: Constructor QDataStream::QDataStream(const QByteArray &)

This method creates an object of class QDataStream.

Python specific notes:
This method is the default initializer of the object.

put_b

Signature: QDataStream ptr put_b (bool arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_ba

Signature: QDataStream ptr put_ba (bytes arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_d

Signature: QDataStream ptr put_d (double arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_f

Signature: QDataStream ptr put_f (float arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_i16

Signature: QDataStream ptr put_i16 (short arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_i32

Signature: QDataStream ptr put_i32 (int arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_i64

Signature: QDataStream ptr put_i64 (long long arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_i8

Signature: QDataStream ptr put_i8 (signed char arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_il

Signature: QDataStream ptr put_il (int[] arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_iv

Signature: QDataStream ptr put_iv (int[] arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_qc

Signature: QDataStream ptr put_qc (unsigned int arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_s

Signature: QDataStream ptr put_s (string arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_ui16

Signature: QDataStream ptr put_ui16 (unsigned short arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_ui32

Signature: QDataStream ptr put_ui32 (unsigned int arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_ui64

Signature: QDataStream ptr put_ui64 (unsigned long long arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

put_ui8

Signature: QDataStream ptr put_ui8 (unsigned char arg1)

Description: Non-ambiguous adaptation of the corresponding operator<<

read_b

Signature: bool read_b

Description: Non-ambiguous adaptation of the corresponding operator>>

read_ba

Signature: bytes read_ba

Description: Non-ambiguous adaptation of the corresponding operator>>

read_d

Signature: double read_d

Description: Non-ambiguous adaptation of the corresponding operator>>

read_f

Signature: float read_f

Description: Non-ambiguous adaptation of the corresponding operator>>

read_i16

Signature: short read_i16

Description: Non-ambiguous adaptation of the corresponding operator>>

read_i32

Signature: int read_i32

Description: Non-ambiguous adaptation of the corresponding operator>>

read_i64

Signature: long long read_i64

Description: Non-ambiguous adaptation of the corresponding operator>>

read_i8

Signature: signed char read_i8

Description: Non-ambiguous adaptation of the corresponding operator>>

read_il

Signature: int[] read_il

Description: Non-ambiguous adaptation of the corresponding operator>>

read_iv

Signature: int[] read_iv

Description: Non-ambiguous adaptation of the corresponding operator>>

read_qc

Signature: unsigned int read_qc

Description: Non-ambiguous adaptation of the corresponding operator>>

read_s

Signature: string read_s

Description: Non-ambiguous adaptation of the corresponding operator>>

read_ui16

Signature: unsigned short read_ui16

Description: Non-ambiguous adaptation of the corresponding operator>>

read_ui32

Signature: unsigned int read_ui32

Description: Non-ambiguous adaptation of the corresponding operator>>

read_ui64

Signature: unsigned long long read_ui64

Description: Non-ambiguous adaptation of the corresponding operator>>

read_ui8

Signature: unsigned char read_ui8

Description: Non-ambiguous adaptation of the corresponding operator>>

resetStatus

Signature: void resetStatus

Description: Method void QDataStream::resetStatus()

rollbackTransaction

Signature: void rollbackTransaction

Description: Method void QDataStream::rollbackTransaction()

setByteOrder

Signature: void setByteOrder (const QDataStream_ByteOrder arg1)

Description: Method void QDataStream::setByteOrder(QDataStream::ByteOrder)

Python specific notes:
The object exposes a writable attribute 'byteOrder'. This is the setter.

setDevice

Signature: void setDevice (QIODevice ptr arg1)

Description: Method void QDataStream::setDevice(QIODevice *)

Python specific notes:
The object exposes a writable attribute 'device'. This is the setter.

setFloatingPointPrecision

Signature: void setFloatingPointPrecision (const QDataStream_FloatingPointPrecision precision)

Description: Method void QDataStream::setFloatingPointPrecision(QDataStream::FloatingPointPrecision precision)

Python specific notes:
The object exposes a writable attribute 'floatingPointPrecision'. This is the setter.

setStatus

Signature: void setStatus (const QDataStream_Status status)

Description: Method void QDataStream::setStatus(QDataStream::Status status)

Python specific notes:
The object exposes a writable attribute 'status'. This is the setter.

setVersion

Signature: void setVersion (int arg1)

Description: Method void QDataStream::setVersion(int)

Python specific notes:
The object exposes a writable attribute 'version'. This is the setter.

skipRawData

Signature: int skipRawData (int len)

Description: Method int QDataStream::skipRawData(int len)

startTransaction

Signature: void startTransaction

Description: Method void QDataStream::startTransaction()

status

Signature: [const] QDataStream_Status status

Description: Method QDataStream::Status QDataStream::status()

Python specific notes:
The object exposes a readable attribute 'status'. This is the getter.

status=

Signature: void status= (const QDataStream_Status status)

Description: Method void QDataStream::setStatus(QDataStream::Status status)

Python specific notes:
The object exposes a writable attribute 'status'. This is the setter.

unsetDevice

Signature: void unsetDevice

Description: Method void QDataStream::unsetDevice()

version

Signature: [const] int version

Description: Method int QDataStream::version()

Python specific notes:
The object exposes a readable attribute 'version'. This is the getter.

version=

Signature: void version= (int arg1)

Description: Method void QDataStream::setVersion(int)

Python specific notes:
The object exposes a writable attribute 'version'. This is the setter.

writeBytes

Signature: QDataStream writeBytes (string arg1, unsigned int len)

Description: Method QDataStream &QDataStream::writeBytes(const char *, unsigned int len)

writeRawData

Signature: int writeRawData (string arg1, int len)

Description: Method int QDataStream::writeRawData(const char *, int len)