crawlserv++  [under development]
Application for crawling and analyzing textual content of websites.
QueryProperties.hpp
Go to the documentation of this file.
1 /*
2  *
3  * ---
4  *
5  * Copyright (C) 2020 Anselm Schmidt (ans[ät]ohai.su)
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version in addition to the terms of any
11  * licences already herein identified.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  *
21  * ---
22  *
23  * QueryProperties.hpp
24  *
25  * Query properties (name, text, type and result type(s)).
26  *
27  * Created on: Feb 2, 2019
28  * Author: ans
29  */
30 
31 #ifndef STRUCT_QUERYPROPERTIES_HPP_
32 #define STRUCT_QUERYPROPERTIES_HPP_
33 
34 #include <string> // std::string
35 
36 namespace crawlservpp::Struct {
37 
39  struct QueryProperties {
42 
44  std::string name;
45 
47  std::string text;
48 
50  std::string type;
51 
53  bool resultBool{false};
54 
56  bool resultSingle{false};
57 
59  bool resultMulti{false};
60 
62 
66  bool resultSubSets{false};
67 
69  bool textOnly{false};
70 
74 
76  QueryProperties() = default;
77 
79 
106  const std::string& setName,
107  const std::string& setText,
108  const std::string& setType,
109  bool setResultBool,
110  bool setResultSingle,
111  bool setResultMulti,
112  bool setResultSubSets,
113  bool setTextOnly
114  ) : name(setName),
115  text(setText),
116  type(setType),
117  resultBool(setResultBool),
118  resultSingle(setResultSingle),
119  resultMulti(setResultMulti),
120  resultSubSets(setResultSubSets),
121  textOnly(setTextOnly) {}
122 
124 
151  const std::string& setText,
152  const std::string& setType,
153  bool setResultBool,
154  bool setResultSingle,
155  bool setResultMulti,
156  bool setResultSubSets,
157  bool setTextOnly
158  ) : QueryProperties(
159  "",
160  setText,
161  setType,
162  setResultBool,
163  setResultSingle,
164  setResultMulti,
165  setResultSubSets,
166  setTextOnly
167  ) {}
168 
170  };
171 
172 } /* namespace crawlservpp::Struct */
173 
174 #endif /* STRUCT_QUERYPROPERTIES_HPP_ */
bool resultSingle
Indicates whether the query generates a single result.
Definition: QueryProperties.hpp:56
Query properties containing its name, text, type, and result type(s).
Definition: QueryProperties.hpp:39
std::string text
The query.
Definition: QueryProperties.hpp:47
bool resultSubSets
Indicates whether the query generates subsets as results.
Definition: QueryProperties.hpp:66
QueryProperties(const std::string &setName, const std::string &setText, const std::string &setType, bool setResultBool, bool setResultSingle, bool setResultMulti, bool setResultSubSets, bool setTextOnly)
Constructor setting properties, including the name of the query.
Definition: QueryProperties.hpp:105
QueryProperties()=default
Default constructor.
bool resultMulti
Indicates whether the query generates multiple results.
Definition: QueryProperties.hpp:59
bool textOnly
Indicates whether the query should be considered text-only.
Definition: QueryProperties.hpp:69
bool resultBool
Indicates whether the query generates a boolean result.
Definition: QueryProperties.hpp:53
QueryProperties(const std::string &setText, const std::string &setType, bool setResultBool, bool setResultSingle, bool setResultMulti, bool setResultSubSets, bool setTextOnly)
Constructor setting properties, but not the name of the query.
Definition: QueryProperties.hpp:150
std::string name
The name of the query.
Definition: QueryProperties.hpp:44
std::string type
The type of the query.
Definition: QueryProperties.hpp:50
Namespace for data structures.
Definition: AlgoThreadProperties.hpp:43