Classified ads
cadbrecord.h
Go to the documentation of this file.
1 /* -*-C++-*- -*-coding: utf-8-unix;-*-
2  Classified Ads is Copyright (c) Antti Järvinen 2013-2017.
3 
4  This file is part of Classified Ads.
5 
6  Classified Ads is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  Classified Ads is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with Classified Ads; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 #ifndef CA_DBRECORD_H
22 #define CA_DBRECORD_H
23 #include <QByteArray>
24 #include "../util/hash.h" // for class Hash
25 
35 class CaDbRecord {
36 public: // data type definitions
40  typedef struct SearchStructure {
43  quint32 iModifiedAfter;
44  quint32 iModifiedBefore;
49  QString iBySearchPhrase;
52  bool operator==(const struct SearchStructure& aItemToCompare) const ;
63  bool operator<(const struct SearchStructure& aItemToCompare) const ;
64  QByteArray asJSon() const ;
65  bool fromJSon(const QByteArray& aJSon) ;
66  } SearchTerms ;
67 public: // methods
68  CaDbRecord() ;
69  ~CaDbRecord() ;
71  QByteArray asJSon() const ;
72  bool fromJSon(const QByteArray &aJSonBytes) ;
97  QString iSearchPhrase ;
101  qint64 iSearchNumber ;
106  QByteArray iData ;
110  bool iIsEncrypted ;
111 
115  quint32 iTimeOfPublish ;
134  QByteArray iSignature ;
135 } ;
136 #endif
Hash iById
Definition: cadbrecord.h:42
qint64 iByHavingNumberMoreThan
Definition: cadbrecord.h:46
QByteArray iSignature
Definition: cadbrecord.h:134
qint64 iSearchNumber
Definition: cadbrecord.h:101
QByteArray asJSon() const
bool iIsEncrypted
Definition: cadbrecord.h:110
bool operator<(const struct SearchStructure &aItemToCompare) const
Hash is class that carries 160-bit digest.
Definition: hash.h:38
Hash iRecordId
Definition: cadbrecord.h:78
qint64 iByHavingNumberLessThan
Definition: cadbrecord.h:48
Hash iFromCollection
Definition: cadbrecord.h:41
Hash iCollectionId
Definition: cadbrecord.h:83
struct CaDbRecord::SearchStructure SearchTerms
bool operator==(const struct SearchStructure &aItemToCompare) const
quint32 iModifiedBefore
Definition: cadbrecord.h:44
bool iIsSignatureVerified
Definition: cadbrecord.h:124
QString iBySearchPhrase
Definition: cadbrecord.h:49
QByteArray iData
Definition: cadbrecord.h:106
quint32 iTimeOfPublish
Definition: cadbrecord.h:115
bool fromJSon(const QByteArray &aJSon)
Hash iSenderHash
Definition: cadbrecord.h:87
QString iSearchPhrase
Definition: cadbrecord.h:97
Data record in distributed database.
Definition: cadbrecord.h:35
Hash iBySender
Definition: cadbrecord.h:50
Definition: cadbrecord.h:40
quint32 iModifiedAfter
Definition: cadbrecord.h:43