ContentResult

class kanzi::connect::ContentResult

Content result class is a wrapper for the data that was retrieved from the content query.

It is possible to serialize an instance of this class from server to client.

Public Functions

ContentResult()

Constructor.

ContentResult(ContentDataSharedPtr data)

Constructor.

Parameters

data – Actual data from the content query.

~ContentResult()

Destructor.

ContentDataSharedPtr get() const

Retrieves content data from this result. Internal, do not use.

size_t getColumnCount()

Returns total number of columns in the result set.

Returns

Number of columns.

string getColumnName(size_t columnIndex)

Returns name of the column in given index.

Parameters

columnIndex – Index of the column.

Returns

Name of the column.

ContentDataType getColumnType(const string &name)

Returns data type of the column.

Parameters

name – Name of the column.

Returns

Data type of the column.

ContentDataType getColumnType(size_t columnIndex)

Returns data type of the column in given index.

Parameters

columnIndex – Index of the column.

Returns

Data type of the column.

string getColumnValue(size_t columnIndex)

Returns value of the column, as string.

Parameters

columnIndex – Index of the column.

Returns

Value as string.

size_t getRowCount()

Returns total number of rows in the result set.

Returns

Number of rows.

size_t getRowIndex()

Returns index of current row in result set.

Returns

index of the row that is currently being iterated.

size_t getStartIndex() const

Retrieve the previously stored start index.

Returns

start index

template<class T>
inline T getValue(size_t columnIndex)

Returns value from specific column in current row (for simple types).

Parameters

columnIndex – Index of the column.

Returns

Value as Type.

bool isEmptyData() const

Checks if the contained data is empty.

Returns

If true, there is no content in this result.

void pack(QueryResponseData &data)

Writes data from QueryResponseData to this result.

Internal, do not use.

Parameters

data – response data where to write information to.

void set(ContentDataSharedPtr data)

Sets content data in to this result. Internal, do not use.

void setRowIndex(size_t index)

Sets index of current row in result set.

Parameters

index – New index to be set as current.

void setStartIndex(size_t startIndex)

Sets a start index.

Parameters

startIndex – new start index to be stored.

void unpack(const QueryResponseData &data, bool resetData = true)

Writes data from this result to QueryResponseData.

Internal, do not use.

Parameters
  • data – where to read information from

  • resetData – whether to reset internal contents before unpack. defaults to true.