![]() |
SDK
2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
|
Use to select Item that meets specific criterias when doing a query. More...
#include <Filter.h>
Public Member Functions | |
Filter (const Filter &rh) | |
Filter (Filter &&rh) | |
Filter & | operator= (const Filter &rh) |
Filter & | operator= (Filter &&rh) |
cbe::ItemType | getDataType () const |
Returns the requested data type. More... | |
std::string | getQuery () const |
Returns the query string that was set on the filter. More... | |
bool | getAscending () const |
Returns the settings on how the data was sorted and displayed. | |
bool | getDeleted () const |
Determines if deleted objects in the bin are included. | |
bool | getContainerFirst () const |
Determines if containers should be sorted before objects. | |
bool | isJoinedResult () const |
Determines if the resultset comes from a joined query. | |
std::uint32_t | getOffset () const |
Determines the offset of items to be skiped. More... | |
std::uint32_t | getCount () const |
Returns the size of the resultset of the query. | |
bool | getByPassCache () const |
Returns if skipping the cache was used or not. | |
cbe::FilterOrder | getItemOrder () const |
Returns the order the query was sorted. More... | |
cbe::Container | container () |
Returns the parent container that was queried, if it is in the cache. This is after a query was done, not before. | |
cbe::Filter & | setDataType (cbe::ItemType itemType) |
Set which datatypes to query for. More... | |
cbe::Filter & | setQuery (std::string query) |
Set the query string. More... | |
cbe::Filter & | setAscending (bool ascending) |
Sets the order, ascending , in which data should be displayed. More... | |
cbe::Filter & | setDeleted (bool deleted) |
Whether to include deleted items. More... | |
cbe::Filter & | setContainerFirst (bool containerFirst) |
If Container should be displayed before Object . More... | |
cbe::Filter & | setOffset (std::uint32_t offset) |
Set the offset for paging. More... | |
cbe::Filter & | setCount (std::uint32_t count) |
Set the maximum resultset. More... | |
cbe::Filter & | setItemOrder (cbe::FilterOrder order) |
Set the order of how data will be shown by the enum of FilterOrder. More... | |
cbe::Filter & | setByPassCache (bool byPassCache) |
Set to ignore the local SDK cache. More... | |
Friends | |
class | CloudBackend |
class | Container |
class | QueryChain |
class | QueryResult |
std::ostream & | operator<< (std::ostream &os, const Filter &filter) |
CBI::ItemDelegatePtr | delegate::createCbiQueryDelegate (delegate::QueryDelegatePtr, cbe::util::Context &&) |
CBI::ItemDelegatePtr | delegate::createCbiQueryDelegate (delegate::QueryJoinDelegatePtr, cbe::util::Context &&) |
Use to select Item that meets specific criterias when doing a query.
Filtering on metadata KeyValues can be done with setQuery() and only to query for Object, not Container.
cbe::ItemType cbe::Filter::getDataType | ( | ) | const |
Returns the requested data type.
Such as ItemType e.g.,
cbe::FilterOrder cbe::Filter::getItemOrder | ( | ) | const |
Returns the order the query was sorted.
Check enum FilterOrder
to see options for sorting.
std::uint32_t cbe::Filter::getOffset | ( | ) | const |
Determines the offset of items to be skiped.
Returns the offset of items in the beginning of total resultset to be skiped, that was used for the filter in the query.
std::string cbe::Filter::getQuery | ( | ) | const |
Returns the query string that was set on the filter.
Query string e.g.,
cbe::Filter& cbe::Filter::setAscending | ( | bool | ascending | ) |
Sets the order, ascending
, in which data should be displayed.
ascending | true = sorted in increasing order false = sorted in decreasing order |
cbe::Filter& cbe::Filter::setByPassCache | ( | bool | byPassCache | ) |
Set to ignore the local SDK cache.
Instead allways fetch the resultset from the cloud.
byPassCache | true = skip the SDK cache and ask the cloud. default is to use the cache when available. |
cbe::Filter& cbe::Filter::setContainerFirst | ( | bool | containerFirst | ) |
cbe::Filter& cbe::Filter::setCount | ( | std::uint32_t | count | ) |
Set the maximum resultset.
Set the maximum number of items you want to get from a container.
E.g.: a container has 50 items but you only want the 10 first in ascending order then set ascending to true and setCount to 10.
count | maximum number of items to return |
cbe::Filter& cbe::Filter::setDataType | ( | cbe::ItemType | itemType | ) |
Set which datatypes
to query for.
itemType | as defined in Types.h |
cbe::Filter& cbe::Filter::setDeleted | ( | bool | deleted | ) |
Whether to include deleted items.
deleted | true = include items in the bin default is false |
cbe::Filter& cbe::Filter::setItemOrder | ( | cbe::FilterOrder | order | ) |
Set the order of how data will be shown by the enum of FilterOrder.
E.g.: Title first, Relevance, published e.t.c.
order | see the enum FilterOrder in Types.h |
cbe::Filter& cbe::Filter::setOffset | ( | std::uint32_t | offset | ) |
Set the offset for paging.
Offset is the item offset where to start your resultset.
E.g.: There is already a query resultset of the first 100 items and to get the rest you put setOffset() to 100 to get the next resultset from 101-.
offset | first item start number of the complete resultset to return |
cbe::Filter& cbe::Filter::setQuery | ( | std::string | query | ) |
Set the query string.
E.g., firstname:* (would search for all objects with the metadata key labeled firstname
).
Search string e.g.,
query | is a string of key tags or key:value pairs. E.g. Name:*|Country:Sweden|Country:Norway This will search for objects with key Name but any value and where key Country is either Sweden or Norway. |