Heart 1.3.848.aa44c26
Heart is base back end library for your c++ Qt projects.
|
The DbAddress class use to work with database addresses. Database Address it is structure with 2 values. More...
#include <dbaddress.h>
Public Member Functions | |
DbAddress ()=default | |
DbAddress (const QString &table, const QVariant &id) | |
DbAddress this constructor initialize a default database address. | |
QDataStream & | fromStream (QDataStream &stream) |
fromStream This method should be read all bytes from the stream object and full the current object. | |
QDataStream & | toStream (QDataStream &stream) const |
fromStream This method should be write all members of the current object to the stream object. | |
QString | toString () const |
toString This method return a string implementation fo this object. | |
bool | isValid () const |
isValid This method check object for valid. | |
const QString & | table () const |
table This method return table name. | |
void | setTable (const QString &table) |
setTable This method set new table name of address. | |
const QVariant & | id () const |
id This method return id of object in table. | |
void | setId (const QVariant &id) |
setId This method set id for this address. | |
QByteArray | SHA256Hash () const |
SHA256Hash This method return address hash. This hash using into database. | |
Public Member Functions inherited from QH::StreamBase | |
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. | |
Friends | |
bool | operator== (const DbAddress &left, const DbAddress &other) |
bool | operator!= (const DbAddress &left, const DbAddress &other) |
Additional Inherited Members | |
Protected Member Functions inherited from QH::StreamBase | |
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 unsigned int | typeId () const |
typeId This method return id of type. | |
The DbAddress class use to work with database addresses. Database Address it is structure with 2 values.
Definition at line 24 of file dbaddress.h.
|
default |
QH::DbAddress::DbAddress | ( | const QString & | table, |
const QVariant & | id | ||
) |
DbAddress this constructor initialize a default database address.
table | This is table name in database. |
id | This is id of object in table. |
Definition at line 20 of file dbaddress.cpp.
|
virtual |
fromStream This method should be read all bytes from the stream object and full the current object.
stream | This is Qt stream object. |
Examle of base simple implementation:
Implements QH::StreamBase.
Definition at line 31 of file dbaddress.cpp.
const QVariant & QH::DbAddress::id | ( | ) | const |
id This method return id of object in table.
Definition at line 67 of file dbaddress.cpp.
bool QH::DbAddress::isValid | ( | ) | const |
isValid This method check object for valid.
Definition at line 54 of file dbaddress.cpp.
void QH::DbAddress::setId | ( | const QVariant & | id | ) |
setId This method set id for this address.
id | this is new value of objects id. |
Definition at line 71 of file dbaddress.cpp.
void QH::DbAddress::setTable | ( | const QString & | table | ) |
setTable This method set new table name of address.
table | new value of table name. |
Definition at line 62 of file dbaddress.cpp.
QByteArray QH::DbAddress::SHA256Hash | ( | ) | const |
SHA256Hash This method return address hash. This hash using into database.
Definition at line 76 of file dbaddress.cpp.
const QString & QH::DbAddress::table | ( | ) | const |
table This method return table name.
Definition at line 58 of file dbaddress.cpp.
|
virtual |
fromStream This method should be write all members of the current object to the stream object.
stream | This is Qt stream object. |
Examle of base simple implementation:
Implements QH::StreamBase.
Definition at line 39 of file dbaddress.cpp.
QString QH::DbAddress::toString | ( | ) | const |
toString This method return a string implementation fo this object.
Definition at line 45 of file dbaddress.cpp.
Definition at line 50 of file dbaddress.cpp.
Definition at line 27 of file dbaddress.cpp.