crawlserv++  [under development]
Application for crawling and analyzing textual content of websites.
crawlservpp::Struct::QueryStruct Struct Reference

Structure to identify a query including its type and result type(s). More...

#include <QueryStruct.hpp>

Constants

static constexpr std::uint8_t typeNone {0}
 Unspecified query type. More...
 
static constexpr std::uint8_t typeRegEx {1}
 Query type identifying a RegEx query. More...
 
static constexpr std::uint8_t typeXPath {2}
 Query type identifying a XPath query. More...
 
static constexpr std::uint8_t typeJsonPointer {3}
 Query type identifying a JSONPointer query. More...
 
static constexpr std::uint8_t typeJsonPath {4}
 Query type identifying a JSONPath query. More...
 
static constexpr std::uint8_t typeXPathJsonPointer {5}
 Query type identifying a combined XPath and JSONPointer query. More...
 
static constexpr std::uint8_t typeXPathJsonPath {6}
 Query type identifying a combined XPath and JSONPath query. More...
 

Properties

std::uint8_t type {QueryStruct::typeNone}
 The type of the query (see above). More...
 
std::size_t index {}
 The index of the query inside its container. More...
 
bool resultBool {false}
 Indicates whether the query generates a boolean result. More...
 
bool resultSingle {false}
 Indicates whether the query generates a single result. More...
 
bool resultMulti {false}
 Indicates whether the query generates multiple results. More...
 
bool resultSubSets {false}
 Indicates whether the query generates subsets as results. More...
 

Construction

 QueryStruct ()=default
 Default constructor. More...
 
 QueryStruct (std::uint8_t setType, std::size_t setIndex, bool setResultBool, bool setResultSingle, bool setResultMulti, bool setResultSubSets)
 Constructor explicitly setting the properties. More...
 

Getter

bool valid () const noexcept
 Gets whether the query is valid, i.e. whether a query ID has been identified. More...
 

Detailed Description

Structure to identify a query including its type and result type(s).

Constructor & Destructor Documentation

◆ QueryStruct() [1/2]

crawlservpp::Struct::QueryStruct::QueryStruct ( )
default

Default constructor.

◆ QueryStruct() [2/2]

crawlservpp::Struct::QueryStruct::QueryStruct ( std::uint8_t  setType,
std::size_t  setIndex,
bool  setResultBool,
bool  setResultSingle,
bool  setResultMulti,
bool  setResultSubSets 
)
inline

Constructor explicitly setting the properties.

Parameters
setTypeThe type of the query (see above).
setIndexThe index of the query.
setResultBoolSet whether the query generates a boolean result.
setResultSingleSet whether the query generates a single result.
setResultMultiSet whether the query generates multiple results.
setResultSubSetsSet whether the query generates subsets as results.

Member Function Documentation

◆ valid()

bool crawlservpp::Struct::QueryStruct::valid ( ) const
inlinenoexcept

Gets whether the query is valid, i.e. whether a query ID has been identified.

Returns
True, if the query is valid and a query ID has been identified. False otherwise.

References index.

Referenced by crawlservpp::Module::Extractor::Thread::onReset().

Member Data Documentation

◆ index

◆ resultBool

◆ resultMulti

◆ resultSingle

◆ resultSubSets

bool crawlservpp::Struct::QueryStruct::resultSubSets {false}

Indicates whether the query generates subsets as results.

Subsets can directly be used to run queries on them again.

Referenced by crawlservpp::Query::Container::addQuery(), crawlservpp::Query::Container::addSubSetsFromQueryOnSubSet(), and crawlservpp::Query::Container::setSubSetsFromQuery().

◆ type

◆ typeJsonPath

◆ typeJsonPointer

◆ typeNone

◆ typeRegEx

◆ typeXPath

◆ typeXPathJsonPath

◆ typeXPathJsonPointer


The documentation for this struct was generated from the following file: