GATE
C/C++ Framework
Loading...
Searching...
No Matches
gate_data_reader_t Interface Reference

A database result reader utility. More...

#include <adapter.h>

Inheritance diagram for gate_data_reader_t:
gate_object_t

Public Member Functions

gate_bool_t is_valid (void)
 Returns true if field records are loaded and can be accessed.
gate_result_t next (void)
 Updates and/or moves the data cursor to the next row.
gate_result_t close (void)
 Closes the data access resources and discards further unread data.
gate_size_t get_field_count (void)
 Returns the amount of readable fields in the current record set.
gate_result_t get_field_type (gate_size_t field_index, gate_type_id_t *ptr_type)
 Returns the field data type used at the given field index.
gate_result_t get_field_name (gate_size_t field_index, gate_string_t const **ptr_name)
 Returns the string name of a field at a given index.
gate_result_t get_field_value (gate_size_t field_index, gate_value_t const **ptr_value)
 Returns a value if a field at a given index.
Public Member Functions inherited from gate_object_t
char const * get_interface_name ()
 Returns on object's interface path name.
void release ()
 Decrease object's reference counter, releases the object when count reaches zero.
int retain ()
 Increase object's reference counter.

Detailed Description

A database result reader utility.

Member Function Documentation

◆ is_valid()

gate_bool_t is_valid ( void )

Returns true if field records are loaded and can be accessed.

Returns
true if fields can be retrieved, or false if end-of-stream or error state

◆ next()

gate_result_t next ( void )

Updates and/or moves the data cursor to the next row.

Returns
GATE_RESULT_* result code

◆ close()

gate_result_t close ( void )

Closes the data access resources and discards further unread data.

Returns
GATE_RESULT_* result code

◆ get_field_count()

gate_size_t get_field_count ( void )

Returns the amount of readable fields in the current record set.

Returns
Amount of fields in current record set

◆ get_field_type()

gate_result_t get_field_type ( gate_size_t field_index,
gate_type_id_t * ptr_type )

Returns the field data type used at the given field index.

Parameters
[in]field_indexField index to be accessed
[out]ptr_typePointer to type-id variable to be filled with data type ID
Returns
GATE_RESULT_* result code

◆ get_field_name()

gate_result_t get_field_name ( gate_size_t field_index,
gate_string_t const ** ptr_name )

Returns the string name of a field at a given index.

Parameters
[in]field_indexField index to be accessed
[out]ptr_namePointer to string to be initialized with name of field
Returns
GATE_RESULT_* result code

◆ get_field_value()

gate_result_t get_field_value ( gate_size_t field_index,
gate_value_t const ** ptr_value )

Returns a value if a field at a given index.

Parameters
[in]field_indexField index to be accessed
[out]ptr_valuePointer to value to be filled with native data type
Returns
GATE_RESULT_* result code

The documentation for this interface was generated from the following file: