[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
Public Member Functions | Public Attributes | List of all members
KLFLibResourceEngine::Query Struct Reference

A structure that describes a query for query() More...

#include <klflib.h>

Collaboration diagram for KLFLibResourceEngine::Query:
Collaboration graph
[legend]

Public Member Functions

 Query ()
 

Public Attributes

KLFLib::EntryMatchCondition matchCondition
 
int skip
 
int limit
 
int orderPropId
 
Qt::SortOrder orderDirection
 
QList< int > wantedEntryProperties
 

Detailed Description

A structure that describes a query for query()

The following properties should be adjusted (by direct access) before calling query().

matchcondition is an KLFLib::EntryMatchCondition struct that tells which properties have to be matched, how, and to what value. Only entries that match the match condition set in query will be returned by query(). Note that the match condition itself may be a complex condition, like an OR and AND tree of property matching conditions with strings or regexps. See KLFLib::EntryMatchCondition, and KLFLib::PropertyMatch for more info. The idea is that engines can translate such conditions into, eg. a SQL WHERE condition for optimized entry queries.

The default match condition (set automatically in constructor) matches all entries.

The first skip results will be ignored, and the first returned result will be the skip'th entry (that is counting from 0; or the skip+1'th, counting more intuitively from 1). By default, skip is zero, so no entries are skipped. The entries must be skipped after they have been sorted. The query() function's return value (entry count) does not include the skipped entries.

A limit may be set to limit the number of returned results (default is -1, meaning no limit).

orderPropId specifies along which KLFLibEntry property ID the items should be ordered. This can be -1 to specify that elements should not be ordered; their order will then be undefined. Default value: -1.

orderDirection specifies in which direction the elements should be ordered. This can be Qt::AscendingOrder or Qt::DescendingOrder (lesser value first or greater value first).

wantedEntryProperties is a list of properties the lists should be filled with. Elements in the entryWithIdList and rawEntryList lists will only have those properties listed in wantedEntryProperties set. The other properties are undefined (some implementations may decide to ignore this optimization). An empty list (which is the default) indicates that all entry properties have to be set.

Definition at line 933 of file klflib.h.

Constructor & Destructor Documentation

KLFLibResourceEngine::Query::Query ( )
inline

Default constructor. sets reasonable default values as documented in class doc.

Definition at line 936 of file klflib.h.

Member Data Documentation

int KLFLibResourceEngine::Query::limit
KLFLib::EntryMatchCondition KLFLibResourceEngine::Query::matchCondition
Qt::SortOrder KLFLibResourceEngine::Query::orderDirection
int KLFLibResourceEngine::Query::orderPropId
int KLFLibResourceEngine::Query::skip
QList<int> KLFLibResourceEngine::Query::wantedEntryProperties

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

Generated by doxygen 1.8.11