fb-cpp 0.0.2
A modern C++ wrapper for the Firebird database API
Loading...
Searching...
No Matches
fbcpp::Row Class Referencefinal

A lightweight, non-owning view of a single row's data with typed accessors. More...

#include <Row.h>

Public Member Functions

 Row (Client &client, const std::vector< Descriptor > &descriptors, std::span< const std::byte > message)
 Constructs a Row view over the given message buffer.
 
template<typename T >
get (unsigned index)
 Retrieves a column using the most appropriate typed accessor specialization.
 
template<Aggregate T>
get ()
 Retrieves all output columns into a user-defined aggregate struct.
 
template<TupleLike T>
get ()
 Retrieves all output columns into a tuple-like type.
 
template<VariantLike V>
get (unsigned index)
 Retrieves a column value as a user-defined variant type.
 
Result reading
bool isNull (unsigned index)
 Reports whether the row has a null at the given column.
 
std::optional< bool > getBool (unsigned index)
 Reads a boolean column.
 
std::optional< std::int16_t > getInt16 (unsigned index)
 Reads a 16-bit signed integer column.
 
std::optional< ScaledInt16getScaledInt16 (unsigned index)
 Reads a scaled 16-bit signed integer column.
 
std::optional< std::int32_t > getInt32 (unsigned index)
 Reads a 32-bit signed integer column.
 
std::optional< ScaledInt32getScaledInt32 (unsigned index)
 Reads a scaled 32-bit signed integer column.
 
std::optional< std::int64_t > getInt64 (unsigned index)
 Reads a 64-bit signed integer column.
 
std::optional< ScaledInt64getScaledInt64 (unsigned index)
 Reads a scaled 64-bit signed integer column.
 
std::optional< ScaledOpaqueInt128getScaledOpaqueInt128 (unsigned index)
 Reads a Firebird scaled 128-bit integer column.
 
std::optional< BoostInt128getBoostInt128 (unsigned index)
 Reads a Boost 128-bit integer column.
 
std::optional< ScaledBoostInt128getScaledBoostInt128 (unsigned index)
 Reads a scaled Boost 128-bit integer column.
 
std::optional< float > getFloat (unsigned index)
 Reads a single precision floating-point column.
 
std::optional< double > getDouble (unsigned index)
 Reads a double precision floating-point column.
 
std::optional< OpaqueDecFloat16getOpaqueDecFloat16 (unsigned index)
 Reads a Firebird 16-digit decimal floating-point column.
 
std::optional< BoostDecFloat16getBoostDecFloat16 (unsigned index)
 Reads a Boost-based 16-digit decimal floating-point column.
 
std::optional< OpaqueDecFloat34getOpaqueDecFloat34 (unsigned index)
 Reads a Firebird 34-digit decimal floating-point column.
 
std::optional< BoostDecFloat34getBoostDecFloat34 (unsigned index)
 Reads a Boost-based 34-digit decimal floating-point column.
 
std::optional< DategetDate (unsigned index)
 Reads a date column.
 
std::optional< OpaqueDategetOpaqueDate (unsigned index)
 Reads a raw date column in Firebird's representation.
 
std::optional< TimegetTime (unsigned index)
 Reads a time-of-day column without timezone.
 
std::optional< OpaqueTimegetOpaqueTime (unsigned index)
 Reads a raw time-of-day column in Firebird's representation.
 
std::optional< TimestampgetTimestamp (unsigned index)
 Reads a timestamp column without timezone.
 
std::optional< OpaqueTimestampgetOpaqueTimestamp (unsigned index)
 Reads a raw timestamp column in Firebird's representation.
 
std::optional< TimeTzgetTimeTz (unsigned index)
 Reads a time-of-day column with timezone.
 
std::optional< OpaqueTimeTzgetOpaqueTimeTz (unsigned index)
 Reads a raw time-of-day column with timezone in Firebird's representation.
 
std::optional< TimestampTzgetTimestampTz (unsigned index)
 Reads a timestamp-with-time-zone column.
 
std::optional< OpaqueTimestampTzgetOpaqueTimestampTz (unsigned index)
 Reads a raw timestamp-with-time-zone column in Firebird's representation.
 
std::optional< BlobIdgetBlobId (unsigned index)
 Reads a blob identifier column.
 
std::optional< std::string > getString (unsigned index)
 Reads a textual column, applying number-to-string conversions when needed.
 

Detailed Description

A lightweight, non-owning view of a single row's data with typed accessors.

Row provides typed access to column values in a message buffer, using descriptors to interpret the raw bytes. It is produced by RowSet for any fetched row.

Definition at line 65 of file Row.h.

Constructor & Destructor Documentation

◆ Row()

fbcpp::Row::Row ( Client client,
const std::vector< Descriptor > &  descriptors,
std::span< const std::byte >  message 
)
inline

Constructs a Row view over the given message buffer.

Parameters
clientClient used to build conversion helpers.
descriptorsColumn descriptors.
messageSpan over the raw row data.

Definition at line 75 of file Row.h.

Member Function Documentation

◆ get() [1/3]

template<Aggregate T>
T fbcpp::Row::get ( )
inline

Retrieves all output columns into a user-defined aggregate struct.

Definition at line 616 of file Row.h.

◆ get() [2/3]

template<TupleLike T>
T fbcpp::Row::get ( )
inline

Retrieves all output columns into a tuple-like type.

Definition at line 635 of file Row.h.

◆ get() [3/3]

template<VariantLike V>
V fbcpp::Row::get ( unsigned  index)
inline

Retrieves a column value as a user-defined variant type.

Definition at line 654 of file Row.h.

◆ getBlobId()

std::optional< BlobId > fbcpp::Row::getBlobId ( unsigned  index)
inline

Reads a blob identifier column.

Definition at line 508 of file Row.h.

◆ getBool()

std::optional< bool > fbcpp::Row::getBool ( unsigned  index)
inline

Reads a boolean column.

Definition at line 102 of file Row.h.

◆ getBoostDecFloat16()

std::optional< BoostDecFloat16 > fbcpp::Row::getBoostDecFloat16 ( unsigned  index)
inline

Reads a Boost-based 16-digit decimal floating-point column.

Definition at line 262 of file Row.h.

◆ getBoostDecFloat34()

std::optional< BoostDecFloat34 > fbcpp::Row::getBoostDecFloat34 ( unsigned  index)
inline

Reads a Boost-based 34-digit decimal floating-point column.

Definition at line 293 of file Row.h.

◆ getBoostInt128()

std::optional< BoostInt128 > fbcpp::Row::getBoostInt128 ( unsigned  index)
inline

Reads a Boost 128-bit integer column.

Definition at line 202 of file Row.h.

◆ getDate()

std::optional< Date > fbcpp::Row::getDate ( unsigned  index)
inline

Reads a date column.

Definition at line 303 of file Row.h.

◆ getDouble()

std::optional< double > fbcpp::Row::getDouble ( unsigned  index)
inline

Reads a double precision floating-point column.

Definition at line 232 of file Row.h.

◆ getFloat()

std::optional< float > fbcpp::Row::getFloat ( unsigned  index)
inline

Reads a single precision floating-point column.

Definition at line 223 of file Row.h.

◆ getInt16()

std::optional< std::int16_t > fbcpp::Row::getInt16 ( unsigned  index)
inline

Reads a 16-bit signed integer column.

Definition at line 122 of file Row.h.

◆ getInt32()

std::optional< std::int32_t > fbcpp::Row::getInt32 ( unsigned  index)
inline

Reads a 32-bit signed integer column.

Definition at line 141 of file Row.h.

◆ getInt64()

std::optional< std::int64_t > fbcpp::Row::getInt64 ( unsigned  index)
inline

Reads a 64-bit signed integer column.

Definition at line 160 of file Row.h.

◆ getOpaqueDate()

std::optional< OpaqueDate > fbcpp::Row::getOpaqueDate ( unsigned  index)
inline

Reads a raw date column in Firebird's representation.

Definition at line 324 of file Row.h.

◆ getOpaqueDecFloat16()

std::optional< OpaqueDecFloat16 > fbcpp::Row::getOpaqueDecFloat16 ( unsigned  index)
inline

Reads a Firebird 16-digit decimal floating-point column.

Definition at line 241 of file Row.h.

◆ getOpaqueDecFloat34()

std::optional< OpaqueDecFloat34 > fbcpp::Row::getOpaqueDecFloat34 ( unsigned  index)
inline

Reads a Firebird 34-digit decimal floating-point column.

Definition at line 272 of file Row.h.

◆ getOpaqueTime()

std::optional< OpaqueTime > fbcpp::Row::getOpaqueTime ( unsigned  index)
inline

Reads a raw time-of-day column in Firebird's representation.

Definition at line 365 of file Row.h.

◆ getOpaqueTimestamp()

std::optional< OpaqueTimestamp > fbcpp::Row::getOpaqueTimestamp ( unsigned  index)
inline

Reads a raw timestamp column in Firebird's representation.

Definition at line 406 of file Row.h.

◆ getOpaqueTimestampTz()

std::optional< OpaqueTimestampTz > fbcpp::Row::getOpaqueTimestampTz ( unsigned  index)
inline

Reads a raw timestamp-with-time-zone column in Firebird's representation.

Definition at line 488 of file Row.h.

◆ getOpaqueTimeTz()

std::optional< OpaqueTimeTz > fbcpp::Row::getOpaqueTimeTz ( unsigned  index)
inline

Reads a raw time-of-day column with timezone in Firebird's representation.

Definition at line 447 of file Row.h.

◆ getScaledBoostInt128()

std::optional< ScaledBoostInt128 > fbcpp::Row::getScaledBoostInt128 ( unsigned  index)
inline

Reads a scaled Boost 128-bit integer column.

Definition at line 212 of file Row.h.

◆ getScaledInt16()

std::optional< ScaledInt16 > fbcpp::Row::getScaledInt16 ( unsigned  index)
inline

Reads a scaled 16-bit signed integer column.

Definition at line 131 of file Row.h.

◆ getScaledInt32()

std::optional< ScaledInt32 > fbcpp::Row::getScaledInt32 ( unsigned  index)
inline

Reads a scaled 32-bit signed integer column.

Definition at line 150 of file Row.h.

◆ getScaledInt64()

std::optional< ScaledInt64 > fbcpp::Row::getScaledInt64 ( unsigned  index)
inline

Reads a scaled 64-bit signed integer column.

Definition at line 169 of file Row.h.

◆ getScaledOpaqueInt128()

std::optional< ScaledOpaqueInt128 > fbcpp::Row::getScaledOpaqueInt128 ( unsigned  index)
inline

Reads a Firebird scaled 128-bit integer column.

Definition at line 179 of file Row.h.

◆ getString()

std::optional< std::string > fbcpp::Row::getString ( unsigned  index)
inline

Reads a textual column, applying number-to-string conversions when needed.

Definition at line 532 of file Row.h.

◆ getTime()

std::optional< Time > fbcpp::Row::getTime ( unsigned  index)
inline

Reads a time-of-day column without timezone.

Definition at line 344 of file Row.h.

◆ getTimestamp()

std::optional< Timestamp > fbcpp::Row::getTimestamp ( unsigned  index)
inline

Reads a timestamp column without timezone.

Definition at line 385 of file Row.h.

◆ getTimestampTz()

std::optional< TimestampTz > fbcpp::Row::getTimestampTz ( unsigned  index)
inline

Reads a timestamp-with-time-zone column.

Definition at line 467 of file Row.h.

◆ getTimeTz()

std::optional< TimeTz > fbcpp::Row::getTimeTz ( unsigned  index)
inline

Reads a time-of-day column with timezone.

Definition at line 426 of file Row.h.

◆ isNull()

bool fbcpp::Row::isNull ( unsigned  index)
inline

Reports whether the row has a null at the given column.

Definition at line 93 of file Row.h.


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