Filter.h

Includes:
<Foundation/Foundation.h>
<CBEIOS/Types.h>

Introduction

Use the links in the table of contents to the left to access the documentation.



Methods

+container
+getAscending
+getByPassCache
+getContainerFirst
+getCount
+getDataType
+getDeleted
+getItemOrder
+getOffset
+getQuery
+isJoinedResult
+setAscending:
+setByPassCache:
+setContainerFirst:
+setCount:
+setDataType:
+setDeleted:
+setItemOrder:
+setOffset:
+setQuery:

container


//todo cbewrap put this back -(CBEContainer*) container;  
Discussion

Returns the parent container that was queried, if it is in the cache. This is after a query was done, not before.


getAscending


-(bool) getAscending;  
Discussion

Returns the settings on how the data was sorted and displayed.


getByPassCache


-(bool) getByPassCache;  
Discussion

Returns if skipping the cache was used or not.


getContainerFirst


-(bool) getContainerFirst;  
Discussion

if containers should be sorted before objects


getCount


-(uint32_t) getCount;  
Discussion

Returns the size of the resultset of the query.


getDataType


 -(CBEItemType) getDataType;  
Discussion

Returns the requested data type. E.g., cbe::ItemType::Container, Object, Tag, ...


getDeleted


-(bool) getDeleted;  
Discussion

if deleted objects in the bin are included


getItemOrder


-(CBEFilterOrder) getItemOrder;  
Discussion

Returns the order the query was sorted. Check enum \c FilterOrder to see options for sorting.


getOffset


-(uint32_t) getOffset;  
Discussion

Returns the offset of items to be skiped that was used for the filter in the query.


getQuery


-(NSString*) getQuery;  
Discussion

Returns the query NSString* that was set on the filter. \n E.g.: \n name:Abc* \n age:100 \n price<200 \n size>40


isJoinedResult


-(bool) isJoinedResult;  
Discussion

if the resultset comes from a joined query


setAscending:


-(void) setAscending:(bool) ascending;  
Parameters
ascending

true = sorted in increasing order \n false = sorted in decreasing order

Discussion

Sets the order, \p ascending , in which data should be displayed:


setByPassCache:


-(void) setByPassCache:(bool) byPassCache;  
Parameters
byPassCache

true = skip the SDK cache and ask the cloud. \n default is to use the cache when available.

Discussion

Set to skip the local SDK cache and fetch an update from the cloud.


setContainerFirst:


-(void) setContainerFirst:(bool) containerFirst;  
Parameters
containerFirst

true = sort containers at the top of the resultset. \n default is to not sort for this.

Discussion

If \c Container should be displayed before \c Object


setCount:


-(void) setCount:(uint32_t) count;  
Parameters
count

maximum number of items to return

Discussion

Set the number of items you want to get from a container. \n 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.


setDataType:


-(void) setDataType:(CBEItemType) itemType;  
Parameters
itemType

as defined in Types.h

Discussion

Set which \c datatypes to query for.


setDeleted:


-(void) setDeleted:(bool) deleted;  
Parameters
deleted

true = include items in the bin \n default is false

Discussion

Show deleted items


setItemOrder:


-(void) setItemOrder:(CBEFilterOrder) order;  
Parameters
order

see the enum \c FilterOrder in Types.h

Discussion

Set the order of how data will be shown by the enum of FilterOrder E.g.: Title first, Relevance, published e.t.c.


setOffset:


-(void) setOffset:(uint32_t) offset;  
Parameters
offset

first item start number of the complete resultset to return

Discussion

Set the offset for paging, offset is the item offset where to start your resultset. \n E.g.: There is already a query of the first 99 items and to get the rest you put setOffset() to 100 to get the next set.


setQuery:


-(void) setQuery:(NSString*) query;  
Parameters
query

is a NSString of key tags or key:value pairs. \n E.g. Name:*|Country:Sweden|Country:Norway, this would search for objects with key Name but any value and where key Country is either Sweden or Norway. \n E.g.: \n name:Abc* \n age:100 \n price<200 \n size>40

Discussion

Set the query NSString. \n E.g.: Name:* (would search for all objects with the metadata key of Name). \n \note If used with rootContainer id as the dataId to search in, the whole account will be searched.