37 bool fromBytes(
const QByteArray &data);
43 QByteArray toBytes()
const;
51 bool fromBase64(
const QString &data);
58 bool fromBase64(
const QByteArray &data);
64 QByteArray toBase64()
const;
91 static_assert(std::is_base_of_v<StreamBase, T>,
92 "The argument of the copy method must be base type of the StreamBase class");
95 return static_cast<T&
>(*this);
106 static_assert(std::is_base_of_v<StreamBase, T>,
107 "The argument of the compare method must be base type of the StreamBase class");
109 if (
static_cast<unsigned int>(
typeid (T).hash_code()) != typeId()) {
113 return toBytes() == right.toBytes();
123 virtual int parsingVersion()
const;
158 virtual QDataStream&
toStream(QDataStream& stream)
const = 0;
164 virtual unsigned int typeId()
const;
The StreamBase class add support streaming data for all children classes. For correctly working all s...
QByteArray toBytes() const
toBytes This method convert a current object to bytes array.
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.
bool compare(const T &right)
compare This method compare array signatures of this and right objects.
T & copy(const StreamBase &right)
copy This is base copy method for all StreamBase structures. Default implementation it is copy from b...
#define HEARTSHARED_EXPORT
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...