9#include <crc/crchash.h>
23 if (
hdr.
size !=
static_cast<unsigned int>(
data.size())) {
39 return QString(
"Pakcage description: %0."
40 " Data description: Data size - %1, Data: %2").
46 return qa_common::hash32(tmp.constData(), tmp.size());
55 stream.readRawData(
reinterpret_cast<char*
>(&
hdr),
sizeof(
Header));
57 char * buf =
static_cast<char*
>(malloc(
hdr.
size));
58 stream.readRawData(buf,
hdr.
size);
68 stream.writeRawData(
reinterpret_cast<const char*
>(&
hdr),
71 stream.writeRawData(
data.data(),
unsigned int calcHash() const
calcHash This method recalc hash sum for this pacakge.
QDataStream & fromStream(QDataStream &stream) override
fromStream This method should be read all bytes from the stream object and full the current object.
QByteArray data
data This is source data of package.
virtual bool isValid() const
isValid This method validation a current package. Default implementation is checked a header and comp...
Header hdr
hdr This is header of package. For more information see the Header struct.
QString toString() const
toString This method convert a package information to a string label.
virtual void reset()
reset This method reset all data and set for package invalid status.
static unsigned int maximumSize()
maximumSize This method return maximu size of pacakge. If pacakge large the maximum size then package...
QDataStream & toStream(QDataStream &stream) const override
fromStream This method should be write all members of the current object to the stream object.
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...