libCZI
Reading CZI documents made easy
libCZI::CQueryParser Class Reference

#include <libCZI_Query.h>

Static Public Member Functions

static std::shared_ptr< libCZI::IQueryConditionParseQueryString (const std::string &str, const QueryOptions *options=nullptr)
 
static void EnumSubset (libCZI::ISubBlockRepository *sbRepository, const std::shared_ptr< IQueryCondition > &condition, const std::function< bool(int index, const libCZI::SubBlockInfo &info)> &funcEnum)
 
static void EnumSubset (libCZI::ISubBlockRepository *sbRepository, const libCZI::IQueryCondition *condition, const std::function< bool(int index, const libCZI::SubBlockInfo &info)> &funcEnum)
 
static std::vector< int > GetSubBlocksMatching (libCZI::ISubBlockRepository *sbRepository, const std::shared_ptr< libCZI::IQueryCondition > &condition, int maxResults)
 
static std::vector< int > GetSubBlocksMatching (libCZI::ISubBlockRepository *sbRepository, const libCZI::IQueryCondition *condition, int maxResults)
 

Detailed Description

Methods for parsing queries and querying a subblock-repository are found here. The syntax for the query is as follows: conditions of the form "variable = constant" can be formulated, and multiple conditions can be combined with boolean operators (AND, OR, XOR, NOT). The conditions can be grouped with parenthesis. Variables can be the coordinates of the various dimensions (like T, Z, C), or the following expressions:

string meaning
Width the (physical) width of the subblock in pixels
Height the (physical) height of the subblock in pixels
LogPosX the x-position of the logical subblock position
LogPosY the y-position of the logical subblock position
LogPosWidth the width of the logical subblock position
LogPosHeight the height of the logical subblock position
IsLayer0 gives "1" if the subblock is in pyramid layer 0, and "0" otherwise

Member Function Documentation

◆ EnumSubset() [1/2]

static void libCZI::CQueryParser::EnumSubset ( libCZI::ISubBlockRepository sbRepository,
const std::shared_ptr< IQueryCondition > &  condition,
const std::function< bool(int index, const libCZI::SubBlockInfo &info)> &  funcEnum 
)
static

Enumerate the subblock-repository for subblocks matching the specified condition. For each subblock matching the condition, the specified callback is called. If the callback returns false, the enumeration is stopped.

Parameters
[in]sbRepositoryThe subblock repository.
conditionThe condition.
funcEnumThe callback function which is called for every subblock matching the condition.

◆ EnumSubset() [2/2]

static void libCZI::CQueryParser::EnumSubset ( libCZI::ISubBlockRepository sbRepository,
const libCZI::IQueryCondition condition,
const std::function< bool(int index, const libCZI::SubBlockInfo &info)> &  funcEnum 
)
static

Enumerate the subblock-repository for subblocks matching the specified condition. For each subblock matching the condition, the specified callback is called. If the callback returns false, the enumeration is stopped.

Parameters
[in]sbRepositoryThe subblock repository.
conditionThe condition.
funcEnumThe callback function which is called for every subblock matching the condition.

◆ GetSubBlocksMatching() [1/2]

static std::vector<int> libCZI::CQueryParser::GetSubBlocksMatching ( libCZI::ISubBlockRepository sbRepository,
const std::shared_ptr< libCZI::IQueryCondition > &  condition,
int  maxResults 
)
static

Gets a vector containing the ids of the subblocks matching the specified condition. The maximal number of ids which will be returned may be specified.

Parameters
[in]sbRepositoryThe subblock repository.
conditionThe condition.
maxResultsThe maximum number of results to return. If less or equal to zero, then all ids are retrieved.
Returns
The ids of the subblocks matching the specified condition.

◆ GetSubBlocksMatching() [2/2]

static std::vector<int> libCZI::CQueryParser::GetSubBlocksMatching ( libCZI::ISubBlockRepository sbRepository,
const libCZI::IQueryCondition condition,
int  maxResults 
)
static

Gets a vector containing the ids of the subblocks matching the specified condition. The maximal number of ids which will be returned may be specified.

Parameters
[in]sbRepositoryThe subblock repository.
conditionThe condition.
maxResultsThe maximum number of results to return. If less or equal to zero, then all ids are retrieved.
Returns
The ids of the subblocks matching the specified condition.

◆ ParseQueryString()

static std::shared_ptr<libCZI::IQueryCondition> libCZI::CQueryParser::ParseQueryString ( const std::string &  str,
const QueryOptions options = nullptr 
)
static

Parse the specified query expression and return an object representing the parsed query. In case of an error during the parsing, an exception is thrown.

Parameters
strThe query expression.
options(Optional) If non-null, options for controlling the operation.
Returns
An object representing the parsed query.

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