SecretService 0.13.2d47dfe
SecretService is base back end library for your c++ Qt projects.
record.h
Go to the documentation of this file.
1//#
2//# Copyright (C) 2024-2024 QuasarApp.
3//# Distributed under the GPLv3 software license, see the accompanying
4//# Everyone is permitted to copy and distribute verbatim copies
5//# of this license document, but changing it is not allowed.
6//#
7
8
9#ifndef RECORD_H
10#define RECORD_H
11
12#include "dbobject.h"
13#include <SecretDB/irecord.h>
14
15#include <QByteArray>
16#include <QString>
17
18namespace DBSecret {
19
23class Record : public QH::PKG::DBObject, public iRecord
24{
25public:
26 Record();
27
28 // iRecord interface
29 const QString &getAlias() const override;
30 void setAlias(const QString &alias) override;
31 const QByteArray &getHash() const override;
32 void setHash(const QByteArray &source) override;
33 const QByteArray &getData() const override;
34 const QByteArray & setData(const QByteArray &newData) override;
35
36 // DBObject interface
37 QH::PKG::DBObject* createDBObject() const override;
38 bool fromSqlRecord(const QSqlRecord& q) override;
39 QString table() const override;
40 QH::PKG::DBVariantMap variantMap() const override;
41
42 QString primaryKey() const override;
43 QVariant primaryValue() const override;
44
45private:
46 QString _alias;
47 QByteArray _hash;
48 QByteArray _data;
49};
50}
51#endif // RECORD_H
The Record class.
Definition record.h:24
const QByteArray & getHash() const override
getHash return hash of data
Definition record.cpp:65
bool fromSqlRecord(const QSqlRecord &q) override
Definition record.cpp:21
const QByteArray & getData() const override
getData This method returns data of the record.
Definition record.cpp:73
void setAlias(const QString &alias) override
setAlias This method sets new alias for record.
Definition record.cpp:61
QH::PKG::DBObject * createDBObject() const override
Definition record.cpp:17
const QByteArray & setData(const QByteArray &newData) override
setData This method sets new data of record.
Definition record.cpp:77
QH::PKG::DBVariantMap variantMap() const override
Definition record.cpp:33
void setHash(const QByteArray &source) override
setHash This method sets new hash of record.
Definition record.cpp:69
QString primaryKey() const override
Definition record.cpp:43
QVariant primaryValue() const override
Definition record.cpp:50
const QString & getAlias() const override
getAlias returns alias of the record.
Definition record.cpp:57
QString table() const override
Definition record.cpp:29
The iRecord class This is main interface for all records of database.
Definition irecord.h:19