The StreamMultiversion class this parser works with simple multiversion packages.
More...
#include <streammultiversion.h>
|
| | StreamMultiversion () |
| | ~StreamMultiversion () |
| | StreamBase () |
| virtual | ~StreamBase () |
| bool | fromBytes (const QByteArray &dataz) |
| | 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.
|
|
| void | saveVersion (char version, QDataStream &stream) const |
| | saveVersion save version of the object to the stream.
|
| char | readVersion (QDataStream &stream) |
| | readVersion read version of the object from the stream.
|
| char | versionHeader (char version, QDataStream &stream) |
| | versionHeader this is new function that automaticaly choose what shuld be to-do (read/wirte).
|
| char | versionHeader (char version, QDataStream &stream) const |
| | versionHeader this is new function that automaticaly choose what shuld be to-do (read/wirte).
|
| template<class T> |
| void | readWrite (QDataStream &stream, const T &data) const |
| | readWrite this method automaticaly choose what we need to-do read or write.
|
| template<class T> |
| void | readWrite (QDataStream &stream, T &data) |
| | readWrite this method automaticaly choose what we need to-do read or write.
|
| template<typename... Args> |
| void | readWritePack (QDataStream &stream, Args &&... args) const |
| | readWritePack - this is a pack write or read from the srting
|
| template<typename... Args> |
| void | readWritePack (QDataStream &stream, Args &&... args) |
| | readWritePack - this is a pack write or read from the srting
|
| virtual int | parsingVersion () const |
| | parsingVersion this method return parsing version of Qt. By Default is 0 (last available parsing). see https://doc.qt.io/qt-6/qdatastream.html#Version-enum
|
| virtual QDataStream & | fromStream (QDataStream &stream)=0 |
| | fromStream This method should be read all bytes from the stream object and full the current object.
|
| virtual QDataStream & | toStream (QDataStream &stream) const =0 |
| | fromStream This method should be write all members of the current object to the stream object.
|
| virtual unsigned int | typeId () const |
| | typeId This method return id of type.
|
The StreamMultiversion class this parser works with simple multiversion packages.
This class used to save and read version of the object in file.
- See also
- StreamBase
protected:
QDataStream &
fromStream(QDataStream &stream)
override {
return stream;
}
QDataStream &
toStream(QDataStream &stream)
const override {
return stream;
}
private:
int data;
}
virtual QDataStream & fromStream(QDataStream &stream)=0
fromStream This method should be read all bytes from the stream object and full the current object.
virtual QDataStream & toStream(QDataStream &stream) const =0
fromStream This method should be write all members of the current object to the stream object.
char versionHeader(char version, QDataStream &stream)
versionHeader this is new function that automaticaly choose what shuld be to-do (read/wirte).
void readWrite(QDataStream &stream, const T &data) const
readWrite this method automaticaly choose what we need to-do read or write.
More example of use:
QDataStream &ClassName::fromStream(QDataStream &stream)
{
fild1)
}
QDataStream &ClassName::toStream(QDataStream &stream) const
{
fild1)
}
#define READ_WRITE_IMPL(...)
Definition at line 63 of file streammultiversion.h.
◆ StreamMultiversion()
| QH::StreamMultiversion::StreamMultiversion |
( |
| ) |
|
◆ ~StreamMultiversion()
| QH::StreamMultiversion::~StreamMultiversion |
( |
| ) |
|
◆ readVersion()
| char QH::StreamMultiversion::readVersion |
( |
QDataStream & | stream | ) |
|
|
protected |
◆ readWrite() [1/2]
template<class T>
| void QH::StreamMultiversion::readWrite |
( |
QDataStream & | stream, |
|
|
const T & | data ) const |
|
inlineprotected |
readWrite this method automaticaly choose what we need to-do read or write.
- Parameters
-
Definition at line 117 of file streammultiversion.h.
◆ readWrite() [2/2]
template<class T>
| void QH::StreamMultiversion::readWrite |
( |
QDataStream & | stream, |
|
|
T & | data ) |
|
inlineprotected |
readWrite this method automaticaly choose what we need to-do read or write.
- Parameters
-
Definition at line 127 of file streammultiversion.h.
◆ readWritePack() [1/2]
template<typename... Args>
| void QH::StreamMultiversion::readWritePack |
( |
QDataStream & | stream, |
|
|
Args &&... | args ) |
|
inlineprotected |
readWritePack - this is a pack write or read from the srting
- Parameters
-
| stream | - stream cheenel to save or read. |
| args | - list of arguments |
Definition at line 148 of file streammultiversion.h.
◆ readWritePack() [2/2]
template<typename... Args>
| void QH::StreamMultiversion::readWritePack |
( |
QDataStream & | stream, |
|
|
Args &&... | args ) const |
|
inlineprotected |
readWritePack - this is a pack write or read from the srting
- Parameters
-
| stream | - stream cheenel to save or read. |
| args | - list of arguments |
Definition at line 138 of file streammultiversion.h.
◆ saveVersion()
| void QH::StreamMultiversion::saveVersion |
( |
char | version, |
|
|
QDataStream & | stream ) const |
|
protected |
saveVersion save version of the object to the stream.
- Parameters
-
| version | - version of the object. |
| stream | - stream to save. |
This method used to save version of the object in file.
- See also
- toStream
Definition at line 14 of file streammultiversion.cpp.
◆ versionHeader() [1/2]
| char QH::StreamMultiversion::versionHeader |
( |
char | version, |
|
|
QDataStream & | stream ) |
|
protected |
versionHeader this is new function that automaticaly choose what shuld be to-do (read/wirte).
- Parameters
-
| version | this is a version of object. |
| stream | this is stream cheenel to save or read. |
- Returns
- version of object.
Definition at line 26 of file streammultiversion.cpp.
◆ versionHeader() [2/2]
| char QH::StreamMultiversion::versionHeader |
( |
char | version, |
|
|
QDataStream & | stream ) const |
|
protected |
versionHeader this is new function that automaticaly choose what shuld be to-do (read/wirte).
- Parameters
-
| version | this is a version of object. |
| stream | this is stream cheenel to save or read. |
- Note
- The version returned by versionHeader() should be handled manually.
-
For backward compatibility, toStream() always writes version 0.
-
Consider implementing version switching logic for multiversion support.
- Returns
- version of object.
Definition at line 30 of file streammultiversion.cpp.
The documentation for this class was generated from the following files: