|
| StreamBase () |
|
virtual | ~StreamBase () |
|
bool | fromBytes (const QByteArray &data) |
| fromBytes This method provide initialization of object from byte array.
|
|
QByteArray | toBytes () const |
| toBytes This method convert a current object to bytes array.
|
|
bool | fromBase64 (const QString &data) |
| fromBase64 This method provide initialization of object from the base64 string.
|
|
bool | fromBase64 (const QByteArray &data) |
| fromBase64 This method provide initialization of object from the base64 string.
|
|
QByteArray | toBase64 () const |
| toBase64 This method convert a current object to the base64 string.
|
|
template<class T > |
T & | copy (const StreamBase &right) |
| copy This is base copy method for all StreamBase structures. Default implementation it is copy from byteArray.
|
|
template<class T > |
bool | compare (const T &right) |
| compare This method compare array signatures of this and right objects.
|
|
The StreamBase class add support streaming data for all children classes. For correctly working all serializations functions you need to override fromStream and toStream methods. All implementations of overridden method should be contains a invoke of method of base class.
Definition at line 27 of file streambase.h.
virtual QDataStream & QH::StreamBase::fromStream |
( |
QDataStream & |
stream | ) |
|
|
protectedpure virtual |
fromStream This method should be read all bytes from the stream object and full the current object.
- Note
- The implementation of this method should be invoke a method of base class.
- Parameters
-
stream | This is Qt stream object. |
- Returns
- Qt stream object.
Examle of base simple implementation:
QDataStream &ExampleClass::fromStream(QDataStream &stream) const {
stream >> exampleMember;
return stream;
}
virtual QDataStream & toStream(QDataStream &stream) const =0
fromStream This method should be write all members of the current object to the stream object.
Implemented in QH::AccessToken, QH::DbAddress, QH::PKG::APIVersion, QH::PKG::VersionIsReceived, QH::DistVersion, QH::Package, QH::PKG::BadRequest, QH::PKG::BigDataBase, QH::PKG::BigDataHeader, QH::PKG::BigDataPart, QH::PKG::BigDataRequest, QH::PKG::BigDataWraper, QH::PKG::CloseConnection, QH::PKG::DataPack< Package >, QH::PKG::DBObject, QH::PKG::DBObjectsRequest< T >, QH::PKG::DBObjectsRequestWithStream< T >, QH::PKG::DeleteObject, QH::PKG::Ping, QH::StreamMultiversion, QH::PKG::MultiversionData, and QH::PKG::UniversalData.
virtual QDataStream & QH::StreamBase::toStream |
( |
QDataStream & |
stream | ) |
const |
|
protectedpure virtual |
fromStream This method should be write all members of the current object to the stream object.
- Note
- The implementation of this method should be invoke a method of base class.
- Parameters
-
stream | This is Qt stream object. |
- Returns
- Qt stream object.
Examle of base simple implementation:
QDataStream &ExampleClass::toStream(QDataStream &stream) const {
stream << exampleMember;
return stream;
}
Implemented in QH::AccessToken, QH::DbAddress, QH::PKG::APIVersion, QH::PKG::VersionIsReceived, QH::DistVersion, QH::Package, QH::PKG::BadRequest, QH::PKG::BigDataBase, QH::PKG::BigDataHeader, QH::PKG::BigDataPart, QH::PKG::BigDataRequest, QH::PKG::BigDataWraper, QH::PKG::CloseConnection, QH::PKG::DataPack< Package >, QH::PKG::DBObject, QH::PKG::DBObjectsRequest< T >, QH::PKG::DBObjectsRequestWithStream< T >, QH::PKG::DeleteObject, QH::PKG::Ping, QH::StreamMultiversion, QH::PKG::MultiversionData, and QH::PKG::UniversalData.