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
ZLogSearch.cpp
Go to the documentation of this file.
1 #include "ZLogSearch.h"
2 
3 namespace Zbl
4 {
5 
6 ZLogSearch::ZLogSearch(QSharedPointer<ZblLogSearch> searchPtr, ZLogReader *reader)
7  : QObject(NULL), m_search(searchPtr)
8 {
9  connect(m_search.data(), SIGNAL(notifySearchState(int)), this, SIGNAL(notifySearchState(int)));
10 }
11 
12 QSharedPointer<ZblLogSearch> ZLogSearch::getZSearch()
13 {
14  return m_search;
15 }
16 
17 QObject* ZLogSearch::getReader() const
18 {
19  return m_search->getReader();
20 }
21 
22 QString ZLogSearch::getPhrase() const
23 {
24  if(m_search.isNull())
25  return QString();
26 
27  return m_search->getPhrase();
28 }
29 
31 {
32  if(m_search.isNull())
33  return -1;
34 
35  return m_search->getSearchType();
36 }
37 
38 QList<int> ZLogSearch::getSearchRoles() const
39 {
40  if(m_search.isNull())
41  return QList<int>();
42 
43  return m_search->getSearchRoles();
44 }
45 
47 {
48  return SearchCaseSensitive;
49 }
50 
52 {
53  return SearchCaseInsensitive;
54 }
55 
57 {
58  if(m_search.isNull())
59  return -1;
60 
61  return static_cast<int>(m_search->getSearchState());
62 }
63 
64 
66 {
67  return m_search->getActive();
68 }
69 
71 {
72  return m_search->getSaved();
73 }
74 
76 {
77  return m_search->getCompletionFileSize();
78 }
79 
80 
81 
83 {
84  if(m_search.isNull())
85  return false;
86 
87  return m_search->getSearchForward();
88 }
89 
90 void ZLogSearch::setSearchForward(bool forward)
91 {
92  if(m_search.isNull())
93  return;
94 
95  m_search->setSearchForward(forward);
96 
97  notifySearchForward(forward);
98 }
99 
101 {
102  if(m_search.isNull())
103  return false;
104 
105  return m_search->getSearchBackward();
106 }
107 
108 void ZLogSearch::setSearchBackward(bool backward)
109 {
110  if(m_search.isNull())
111  return;
112 
113  m_search->setSearchBackward(backward);
114 
115  notifySearchBackward(backward);
116 }
117 
119 {
120  if(m_search.isNull())
121  return NULL;
122 
123  return m_search->linkModel();
124 }
125 
127 {
128  return !m_search.isNull();
129 }
130 
132 {
133  m_search.clear();
134 }
135 
136 
137 
138 
139 
140 } // Zbl
Q_INVOKABLE QObject * getReader() const
Returns the foreground log file reader object for this search.
Definition: ZLogSearch.cpp:17
void setSearchBackward(bool backward)
Definition: ZLogSearch.cpp:108
A QML type that manages reading JSON formatted Zuble log files. QML programs create using Zbl...
Definition: ZLogReader.h:62
QString getPhrase() const
Definition: ZLogSearch.cpp:22
void notifySearchBackward(bool newValue)
bool getSearchForward() const
Definition: ZLogSearch.cpp:82
bool getActive() const
Definition: ZLogSearch.cpp:65
int getCaseInsensitive() const
Definition: ZLogSearch.cpp:51
Definition: ZAndGate.cpp:6
QList< int > getSearchRoles() const
Definition: ZLogSearch.cpp:38
int getSearchType() const
Definition: ZLogSearch.cpp:30
int getSearchState() const
Definition: ZLogSearch.cpp:56
void setSearchForward(bool forward)
Definition: ZLogSearch.cpp:90
void notifySearchState(int newValue)
void notifySearchForward(bool newValue)
bool getSearchBackward() const
Definition: ZLogSearch.cpp:100
Q_INVOKABLE QObject * resultModel()
Obtain a list model containing an item for each log record represented in the ZLogSearchMark&#39;s result...
Definition: ZLogSearch.cpp:118
QSharedPointer< ZblLogSearch > m_search
Definition: ZLogSearch.h:156
QSharedPointer< ZblLogSearch > getZSearch()
Definition: ZLogSearch.cpp:12
void onInvalidate()
Handler for the ZblLogSearch::invalidate signal.
Definition: ZLogSearch.cpp:131
bool getSaved() const
Definition: ZLogSearch.cpp:70
qint64 getCompletionFileSize() const
Definition: ZLogSearch.cpp:75
Q_INVOKABLE bool isValid() const
Determine if this wrapper object points to a valid search object.
Definition: ZLogSearch.cpp:126
ZLogSearch(QSharedPointer< ZblLogSearch > searchPtr, ZLogReader *reader)
Definition: ZLogSearch.cpp:6
int getCaseSensitive() const
Definition: ZLogSearch.cpp:46