radio/lib/wType/blob.h

49 lines
1.1 KiB
C
Raw Normal View History

2018-08-04 21:46:25 +00:00
#ifndef BLOB_H
#define BLOB_H
#include "object.h"
#include <QtCore/QByteArray>
namespace W
{
class Blob: public Object
{
public:
Blob();
Blob(uint32_t size, char* p_data);
Blob(const Blob& original);
~Blob();
Blob& operator=(const Blob& original);
StdStr toString() const override;
Object* copy() const override;
size_type length() const override;
size_type size() const override;
objectType getType() const override;
2018-12-17 17:15:58 +00:00
Blob* slice(uint64_t start, uint64_t length = 0) const;
2018-08-04 21:46:25 +00:00
bool operator==(const W::Object & other) const override;
void serialize(ByteArray& out) const override;
void deserialize(ByteArray& in) override;
bool operator==(const Blob& other) const;
static const objectType type = blob;
const QByteArray& byteArray() const;
2018-12-17 17:15:58 +00:00
const unsigned char* uchar() const;
2018-08-04 21:46:25 +00:00
protected:
bool hasData;
uint32_t dataSize;
char* data;
QByteArray qDataView;
};
}
#endif // BLOB_H