| Apache Ignite C++

Public Member Functions | List of all members
ignite::binary::BinaryStringArrayReader Class Reference

Binary string array reader. More...

`#include <binary_containers.h>`

## Public Member Functions
| BinaryStringArrayReader (impl::binary::BinaryReaderImpl *impl, int32_t id, int32_t size)
| Constructor. More...
bool | HasNext ()
| Check whether next element is available for read. More...
int32_t | GetNext (char *res, int32_t len)
| Get next element. More...
std::string | GetNext ()
| Get next element. More...
int32_t | GetSize () const
| Get array size. More...
bool | IsNull () const
| Check whether array is NULL. More...

## Detailed Description

Binary string array reader.

Can be used to read array of strings string by string.

Use GetNext() method to read array value by value while HasNext() method returns true.

## Constructor & Destructor Documentation

## ◆ BinaryStringArrayReader()

ignite::binary::BinaryStringArrayReader::BinaryStringArrayReader | ( | impl::binary::BinaryReaderImpl * | impl,
|  | int32_t | id,
|  | int32_t | size
| ) |  |

Constructor.

Internal call. Should not be used by user.

Parameters

  impl | Reader implementation.
  id | Identifier.
  size | Array size.

## Member Function Documentation

## ◆ GetNext() [1/2]

int32_t ignite::binary::BinaryStringArrayReader::GetNext | ( | char * | res,
|  | int32_t | len
| ) |  |

Get next element.

Parameters

  res | Buffer to store data to.
  len | Expected length of string. NULL terminator will be set in case len is greater than real string length.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

Exceptions

  IgniteError | if there is no element to read.

## ◆ GetNext() [2/2]

std::string ignite::binary::BinaryStringArrayReader::GetNext | ( |  | ) |
| inline

Get next element.

Returns
  String.

Exceptions

  IgniteError | if there is no element to read.

## ◆ GetSize()

int32_t ignite::binary::BinaryStringArrayReader::GetSize | ( |  | ) | const

Get array size.

Returns
  Size or -1 if array is NULL.

## ◆ HasNext()

bool ignite::binary::BinaryStringArrayReader::HasNext | ( |  | ) |

Check whether next element is available for read.

Returns
  True if available.

## ◆ IsNull()

bool ignite::binary::BinaryStringArrayReader::IsNull | ( |  | ) | const

Check whether array is NULL.

Returns
  True if the array is NULL.

The documentation for this class was generated from the following files:

- binary_containers.h
- binary_containers.cpp