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< BoostDecimal32getBoostDecimal32 (unsigned index)
 Reads a Boost.Decimal 7-digit decimal floating-point column.
 
std::optional< BoostDecimal64getBoostDecimal64 (unsigned index)
 Reads a Boost.Decimal 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< BoostDecimal128getBoostDecimal128 (unsigned index)
 Reads a Boost.Decimal 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< ArrayIdgetArrayId (unsigned index)
 Reads an array identifier column.
 
std::optional< std::string > getString (unsigned index)
 Reads a textual column, applying number-to-string conversions when needed.
 
std::optional< std::vector< std::byte > > getBytes (unsigned index)
 Reads a text or varying column as its raw bytes.
 

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 70 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 80 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 701 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 720 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 739 of file Row.h.

◆ getArrayId()

std::optional< ArrayId > fbcpp::Row::getArrayId ( unsigned  index)
inline

Reads an array identifier column.

Definition at line 568 of file Row.h.

◆ getBlobId()

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

Reads a blob identifier column.

Definition at line 544 of file Row.h.

◆ getBool()

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

Reads a boolean column.

Definition at line 107 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 267 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 318 of file Row.h.

◆ getBoostDecimal128()

std::optional< BoostDecimal128 > fbcpp::Row::getBoostDecimal128 ( unsigned  index)
inline

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

Definition at line 329 of file Row.h.

◆ getBoostDecimal32()

std::optional< BoostDecimal32 > fbcpp::Row::getBoostDecimal32 ( unsigned  index)
inline

Reads a Boost.Decimal 7-digit decimal floating-point column.

Definition at line 278 of file Row.h.

◆ getBoostDecimal64()

std::optional< BoostDecimal64 > fbcpp::Row::getBoostDecimal64 ( unsigned  index)
inline

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

Definition at line 287 of file Row.h.

◆ getBoostInt128()

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

Reads a Boost 128-bit integer column.

Definition at line 207 of file Row.h.

◆ getBytes()

std::optional< std::vector< std::byte > > fbcpp::Row::getBytes ( unsigned  index)
inline

Reads a text or varying column as its raw bytes.

Definition at line 665 of file Row.h.

◆ getDate()

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

Reads a date column.

Definition at line 339 of file Row.h.

◆ getDouble()

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

Reads a double precision floating-point column.

Definition at line 237 of file Row.h.

◆ getFloat()

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

Reads a single precision floating-point column.

Definition at line 228 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 127 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 146 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 165 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 360 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 246 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 297 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 401 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 442 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 524 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 483 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 217 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 136 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 155 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 174 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 184 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 592 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 380 of file Row.h.

◆ getTimestamp()

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

Reads a timestamp column without timezone.

Definition at line 421 of file Row.h.

◆ getTimestampTz()

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

Reads a timestamp-with-time-zone column.

Definition at line 503 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 462 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 98 of file Row.h.


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