WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. Zuble QML Types   |  Zuble C++ Classes   |  Zuble Overview
Zuble  0.1
Zuble Framework C++/QML extension API
ZblLogBkSearch.h
Go to the documentation of this file.
1 #ifndef ZBLLOGSEARCHER_H
2 #define ZBLLOGSEARCHER_H
3 
4 #include <QObject>
5 
6 #include "ZblLogSearch.h"
7 #include "ZblLogSearchParams.h"
8 #include "zglobal.h"
9 //#include "ZblLogMark.h"
10 
11 namespace Zbl
12 {
13 
14 class ZblLogSearch;
15 class ZLogViewport;
16 class ZblLogReader;
17 
23 class ZblLogBkSearch : public QObject
24 {
25  Q_OBJECT
26 public:
27 
32  explicit ZblLogBkSearch(qint64 startPosition,
33  ZblLogSearchParams params,
34  ZblLogReader* reader);
35 
41 
47  static void zInit();
48 
55 
56 
57 signals:
58 
65  void searchRowsMatched(ZblLogSearchList rowsFound);
66 
75  void searchRowsScanned(qint64 firstID, qint64 lastID);
76 
85  void markupUpdated(ZLogViewport* viewport, ZblLogSearchList rowsFound);
86 
87 
88 #if 0
89 
100  void findComplete(
101  qint64 recordID,
102  qint64 seekPos,
103  QList<int> rolesFound);
104 
105 
113  void rowMatched(
114  qint64 recordID,
115  qint64 seekPos,
116  QList<int> rolesFound);
117 
118 
119 #endif
120 
121 public slots:
122 
133  void markupViewport(QObject* viewport);
134 
148  void markupViewport(QObject* viewport, ZblLogSearchParams params);
149 
162  void markupViewport(QObject* viewport, ZblLogSearchParams* params);
163 
170  void startSearch();
171 
176  void scanForward();
177 
190  void onLoadComplete(
191  bool eof,
192  QString errorMsg,
193  QVariantMap context);
194 
195 
212  void onMoveComplete(
213  qint64 rowsFound,
214  qint64 rowsStored,
215  bool endOfData,
216  QString errorMsg);
217 
218 protected:
219 
220 
221 #if 0
222 
237  void searchViewport(
238  ZLogViewport* viewport,
239  bool forward,
240  qint64 startPos,
241  const QList<int> roles,
242  int type,
243  const QString& searchPhrase,
244  bool signalFirstFind = true,
245  qint64 endRow = 0);
246 #endif
247 
249 
255 
261 
266 
271 
277 
282  qint64 m_upPosition;
283 
289 };
290 
291 } // Zbl
292 
293 #endif // ZBLLOGSEARCHER_H
void searchRowsScanned(qint64 firstID, qint64 lastID)
Sent when log records have been scanned for matching text.
#define ZBL_DECLARE_LOGGED_OBJECT
Definition: zglobal.h:94
This class performs log file I/O operations and JSON parsing in a background thread on behalf of a ZL...
Definition: ZblLogReader.h:91
void markupUpdated(ZLogViewport *viewport, ZblLogSearchList rowsFound)
Sent when a viewport&#39;s markeup data (model column 1) has been updated.
This class allows Zuble log file viewer text search operations to pass parameters between threads...
ZLogViewport * m_vpUp
A viewport for scanning the file in the reverse direction.
ZblLogBkSearch(qint64 startPosition, ZblLogSearchParams params, ZblLogReader *reader)
Constructs a ZblLogBkSearch object.
ZLogViewport * m_vpDown
A viewport for scanning the file in the forward direction.
ZblLogReader * m_reader
Background log reader object.
A log viewport encapsulates a ZTableModel containing a contiguous subset of log records from a Zuble ...
Definition: ZLogViewport.h:95
Performs log file searches in a background thread.
void scanForward()
Scans a viewport for strings matching the search parameters.
qint64 m_upPosition
The current file position of the reverse scan;.
Definition: ZAndGate.cpp:6
static void zInit()
Initializes search engine. Must be called only once before calling newLogSearcher() the first time...
void searchRowsMatched(ZblLogSearchList rowsFound)
Sent when log records matching the search criteria have been located.
ZBL_DECLARE_LOGGED_OBJECT ZblLogSearchParams m_params
Search parameters for this search object.
void markupViewport(QObject *viewport)
Updates the markup column (1) of the specified viewport&#39;s data model by scanning the data column (0) ...
void onMoveComplete(qint64 rowsFound, qint64 rowsStored, bool endOfData, QString errorMsg)
Called when the backward scanning viewport has been moved and is ready.
static ZblLogBkSearch * newLogSearcher()
Constructs a ZblLogBkSearch object and moves it to the search thread.
This class allows Zuble log file viewer text search operations to pass search results between threads...
~ZblLogBkSearch()
destructor
qint64 m_downPosition
The current file position of the forward scan;.
qint64 m_startPosition
The starting file position of the search;.
void onLoadComplete(bool eof, QString errorMsg, QVariantMap context)
Called when the forward scanning viewport has been loaded and is ready.
void startSearch()
Starts a text search of the log file for log records that satisfiy the search criteria. Search direction can be forward or backward or both.