ContentQueryArguments¶
-
class
kanzi::connect::ContentQueryArguments¶ Encapsulates arguments passed with content queries.
Public Functions
-
ContentQueryArguments()¶ C++ constructor. initialize the object.
-
ContentQueryArguments(const string &uri, const vector<string> &columns, string filter = string(""), int limitIndex = 0, int limitCount = INT_MAX, string sort = string(""))¶ C++ constructor.
initialize the object.
- Parameters
uri: URI to querycolumns: columns to queryfilter: filter stringlimitIndex: index of the record where to start fetching. Zero based.limitCount: maximum amount of elements to fetch.sort: sort order (SQL like).
-
ContentQueryArguments(const string &uri, const vector<string> &columns, const string &filter, const string &limit, const string &sort)¶ C++ constructor.
initialize the object.
- Parameters
uri: URI to querycolumns: colums to queryfilter: filter stringlimit: string to limit results (SQL like).sort: sort order (SQL like).
-
~ContentQueryArguments()¶ Virtual destructor.
-
const vector<string>
getColumns() const¶ Retrieve column names.
- Return
vector of column names.
-
const string
getFilter() const¶ Retrieves the filter string.
- Return
the filter string.
-
size_t
getLimitCount() const¶ Retrieves limit count.
- Return
limit count. 0 indicates that there is no limit set.
-
size_t
getLimitIndex() const¶ Retrieves limit index.
- Return
limit index
-
const string
getLimitString() const¶ Retrieves limit as a string.
Empty string is returned if no special limits are defined.
- Return
limit as string accepted directly by SQL databases. (empty, count or index,count).
-
const string
getSort() const¶ Retrieves the sort order.
- Return
previously set sort order.
-
const string
getUri() const¶ Retrieve the URI.
- Return
uri
-
void
setColumns(const vector<string> &columns)¶ Set column names.
- Parameters
columns: the columns
-
void
setFilter(const string &filter)¶ Sets the filter string.
- Parameters
filter: the filter string.
-
void
setLimit(size_t limitIndex, size_t limitCount = 0)¶ Sets the limit.
- Parameters
limitIndex: start index where to start fetchinglimitCount: maximum amount of elements to fetch.
-
void
setLimitString(const string &limit)¶ Sets limit as a string.
- Parameters
limit: the string representing the limit. INDEX,COUNT or just INDEX
-
void
setSort(const string &sort)¶ Sets the sort order.
- Parameters
sort: sort string line in SQL (ASC, DESC).
-
void
setUri(const string &uri)¶ Set the URI.
- Parameters
uri: the uri to set.
-
QueryArgumentDataSharedPtr
toQueryArgumentData()¶ Converts this internal representation into a format that is transfered over the wire.
- Return
QueryArgumentData instance that can be sent to wire.
Public Static Functions
-
ContentQueryArgumentsSharedPtr
create(const string &uri, const vector<string> &columns)¶ Factory function to create instance of class with certain set of parameters.
- Return
newly allocated instance.
- Parameters
uri: content uricolumns: list of columns to query.
-
ContentQueryArgumentsSharedPtr
createFromQueryArgumentData(const QueryArgumentData &source)¶ Factory function to create instance of the class based on information transfered over the wire.
- Return
newly allocated instance.
- Parameters
source: the source received from wire
-