31 #ifndef MODULE_EXTRACTOR_CONFIG_HPP_ 32 #define MODULE_EXTRACTOR_CONFIG_HPP_ 34 #include "../../Network/Config.hpp" 40 #include <string_view> 50 using std::string_view_literals::operator
""sv;
996 void reset()
override;
1002 static void removeProtocolsFromUrl(std::string& inOut);
1087 CharParsingOption::FromString
1143 "Parser::Config::checkOptions():" 1144 " No target table has been specified." 1150 Config::removeProtocolsFromUrl(url);
1157 bool incompleteVariables{
false};
1159 const auto completeVariables{
1171 incompleteVariables =
true;
1178 incompleteVariables =
true;
1182 if(incompleteVariables) {
1184 "'variables.name' and '.source'" 1185 " should have the same number of elements." 1188 this->
warning(
"Incomplete variable(s) removed from configuration.");
1190 incompleteVariables =
false;
1195 incompleteVariables =
true;
1201 incompleteVariables =
true;
1208 incompleteVariables =
true;
1215 incompleteVariables =
true;
1222 incompleteVariables =
true;
1229 incompleteVariables =
true;
1236 incompleteVariables =
true;
1243 incompleteVariables =
true;
1249 if(incompleteVariables) {
1250 this->
warning(
"Unused variable properties removed from configuration.");
1254 bool incompleteTokens{
false};
1256 const auto completeTokens{
1269 incompleteTokens =
true;
1276 incompleteTokens =
true;
1283 incompleteTokens =
true;
1287 if(incompleteTokens) {
1289 "'variables.tokens', '.tokens.source' and '.tokens.query'" 1290 " should have the same number of elements." 1293 this->
warning(
"Incomplete token(s) removed from configuration.");
1295 incompleteTokens =
false;
1300 incompleteTokens =
true;
1307 incompleteTokens =
true;
1313 if(incompleteTokens) {
1315 "Unused token properties removed from configuration." 1320 bool incompleteDateTimes{
false};
1327 incompleteDateTimes =
true;
1339 incompleteDateTimes =
true;
1347 if(incompleteDateTimes) {
1349 "Unused date/time properties removed from configuration." 1357 [](
const auto& str) {
1364 const auto completeFields{
1371 bool incompleteFields{
false};
1375 incompleteFields =
true;
1380 incompleteFields =
true;
1386 if(incompleteFields) {
1388 "'variables.field.names' and '.field.queries'" 1389 " should have the same number of elements." 1392 this->
warning(
"Incomplete field(s) removed from configuration.");
1394 incompleteFields =
false;
1399 incompleteFields =
true;
1406 incompleteFields =
true;
1413 incompleteFields =
true;
1430 incompleteFields =
true;
1437 incompleteFields =
true;
1444 incompleteFields =
true;
1451 incompleteFields =
true;
1457 if(incompleteFields) {
1459 "Unused field properties for extraction removed from configuration." 1464 const auto completeLinkedFields{
1471 incompleteFields =
false;
1475 incompleteFields =
true;
1480 incompleteFields =
true;
1486 if(incompleteFields) {
1488 "'linked.field.names' and '.field.queries'" 1489 " should have the same number of elements." 1492 this->
warning(
"Incomplete field(s) removed from configuration.");
1494 incompleteFields =
false;
1499 incompleteFields =
true;
1506 incompleteFields =
true;
1513 incompleteFields =
true;
1530 incompleteFields =
true;
1537 incompleteFields =
true;
1544 incompleteFields =
true;
1551 incompleteFields =
true;
1557 if(incompleteFields) {
1559 "Unused field properties for linked data removed from configuration." 1574 inline void Config::removeProtocolsFromUrl(std::string& inOut) {
1577 inOut.length() >= protocol.length() &&
1578 inOut.substr(0, protocol.length()) == protocol.data()
1580 inOut = inOut.substr(protocol.length());
void option(const std::string &name, bool &target)
Checks for a configuration option of type bool.
Definition: Config.hpp:573
Abstract class containing the network-specific configuration for threads.
Definition: Config.hpp:121
#define MAIN_EXCEPTION_CLASS()
Macro used to easily define classes for general exceptions.
Definition: Exception.hpp:50
void category(const std::string &category)
Sets the category of the subsequent configuration items to be checked for.
Definition: Config.hpp:527
void warning(const std::string &warning)
Adds a warning to the logging queue.
Definition: Config.hpp:2427
Configuration item containing its category, name, and JSON value.
Definition: ConfigItem.hpp:41