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, const string &filter, const string &limit, const string &sort)

C++ constructor.

initialize the object.

Parameters
  • uri – URI to query

  • columns – colums to query

  • filter – filter string

  • limit – string to limit results (SQL like).

  • sort – sort order (SQL like).

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 query

  • columns – columns to query

  • filter – filter string

  • limitIndex – index of the record where to start fetching. Zero based.

  • limitCount – maximum amount of elements to fetch.

  • sort – sort order (SQL like).

inline virtual ~ContentQueryArguments()

Virtual destructor.

const vector<string> getColumns() const

Retrieve column names.

Returns

vector of column names.

const string getFilter() const

Retrieves the filter string.

Returns

the filter string.

size_t getLimitCount() const

Retrieves limit count.

Returns

limit count. 0 indicates that there is no limit set.

size_t getLimitIndex() const

Retrieves limit index.

Returns

limit index

const string getLimitString() const

Retrieves limit as a string.

Empty string is returned if no special limits are defined.

Returns

limit as string accepted directly by SQL databases. (empty, count or index,count).

const string getSort() const

Retrieves the sort order.

Returns

previously set sort order.

const string getUri() const

Retrieve the URI.

Returns

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 fetching

  • limitCount – 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.

Returns

QueryArgumentData instance that can be sent to wire.

Public Static Functions

static ContentQueryArgumentsSharedPtr create(const string &uri, const vector<string> &columns)

Factory function to create instance of class with certain set of parameters.

Parameters
  • uri – content uri

  • columns – list of columns to query.

Returns

newly allocated instance.

static ContentQueryArgumentsSharedPtr createFromQueryArgumentData(const QueryArgumentData &source)

Factory function to create instance of the class based on information transfered over the wire.

Parameters

source – the source received from wire

Returns

newly allocated instance.