fb-cpp 0.0.1
A modern C++ wrapper for the Firebird database API
Loading...
Searching...
No Matches
fbcpp Namespace Reference

fb-cpp namespace. More...

Classes

class  Attachment
 Represents a connection to a Firebird database. More...
 
class  AttachmentOptions
 Represents options used when creating an Attachment object. More...
 
class  Blob
 Provides read and write access to Firebird blobs. More...
 
class  BlobId
 Represents a Firebird blob identifier. More...
 
class  BlobOptions
 Additional options used when creating or opening blobs. More...
 
class  Client
 Represents a Firebird client library instance. More...
 
class  DatabaseException
 
struct  Descriptor
 Describes a parameter or column. More...
 
struct  EventCount
 Represents the number of occurrences for a registered event delivered by Firebird. More...
 
class  EventListener
 Observes Firebird events and forwards aggregated counts to a callback on a background thread. More...
 
class  FbCppException
 
class  FbRef
 
struct  OpaqueDate
 Wrapper for Firebird date values. More...
 
struct  OpaqueTime
 Wrapper for Firebird time values. More...
 
struct  OpaqueTimestamp
 Wrapper for Firebird timestamp values. More...
 
struct  OpaqueTimestampTz
 Wrapper for Firebird timestamp-with-time-zone values. More...
 
struct  OpaqueTimeTz
 Wrapper for Firebird time-with-time-zone values. More...
 
struct  ScaledNumber
 Represents a numeric value with an explicit decimal scale. More...
 
class  Statement
 Prepares, executes, and fetches SQL statements against a Firebird attachment. More...
 
class  StatementOptions
 Represents options used when preparing a Statement. More...
 
struct  Timestamp
 Combined date and time with microsecond precision. More...
 
struct  TimestampTz
 Timestamp bound to a time zone. More...
 
struct  TimeTz
 Local time bound to a time zone. More...
 
class  Transaction
 Represents a transaction in a Firebird database. More...
 
class  TransactionOptions
 Represents options used when creating a Transaction object. More...
 

Typedefs

template<typename T >
using FbUniquePtr = std::unique_ptr< T, impl::FbDisposeDeleter >
 
using ScaledInt16 = ScaledNumber< std::int16_t >
 Signed 16-bit scaled number.
 
using ScaledInt32 = ScaledNumber< std::int32_t >
 Signed 32-bit scaled number.
 
using ScaledInt64 = ScaledNumber< std::int64_t >
 Signed 64-bit scaled number.
 
using BoostInt128 = boost::multiprecision::int128_t
 128-bit integer using Boost.Multiprecision.
 
using ScaledBoostInt128 = ScaledNumber< BoostInt128 >
 Scaled 128-bit integer backed by Boost.Multiprecision.
 
using BoostDecFloat16 = boost::multiprecision::number< boost::multiprecision::cpp_dec_float< 16 > >
 16-digit decimal floating point using Boost.Multiprecision.
 
using BoostDecFloat34 = boost::multiprecision::number< boost::multiprecision::cpp_dec_float< 34 > >
 34-digit decimal floating point using Boost.Multiprecision.
 
using Date = std::chrono::year_month_day
 Firebird SQL calendar date.
 
using Time = std::chrono::hh_mm_ss< std::chrono::microseconds >
 Firebird SQL time-of-day with microsecond resolution.
 
using OpaqueInt128 = FB_I128
 Opaque 128-bit integer exposed by the Firebird API.
 
using OpaqueDecFloat16 = FB_DEC16
 Opaque 16-digit decimal floating point exposed by the Firebird API.
 
using OpaqueDecFloat34 = FB_DEC34
 Opaque 34-digit decimal floating point exposed by the Firebird API.
 
using ScaledOpaqueInt128 = ScaledNumber< OpaqueInt128 >
 Scaled Firebird opaque 128-bit integer.
 

Enumerations

enum class  BlobStorage : std::uint8_t { MAIN = isc_bpb_storage_main , TEMPORARY = isc_bpb_storage_temp }
 Blob storage options. More...
 
enum class  BlobType : std::uint8_t { SEGMENTED = isc_bpb_type_segmented , STREAM = isc_bpb_type_stream }
 Blob type. More...
 
enum class  BlobSeekMode : int { FROM_BEGIN = 0 , FROM_CURRENT = blb_seek_relative , FROM_END = blb_seek_from_tail }
 Defines the origin used when repositioning a blob. More...
 
enum class  DescriptorOriginalType : unsigned {
  NULL_TYPE = SQL_NULL , TEXT = SQL_TEXT , VARYING = SQL_VARYING , SHORT = SQL_SHORT ,
  LONG = SQL_LONG , FLOAT = SQL_FLOAT , DOUBLE = SQL_DOUBLE , TIMESTAMP = SQL_TIMESTAMP ,
  BLOB = SQL_BLOB , TIME = SQL_TYPE_TIME , DATE = SQL_TYPE_DATE , INT64 = SQL_INT64 ,
  TIMESTAMP_TZ = SQL_TIMESTAMP_TZ , TIMESTAMP_TZ_EX = SQL_TIMESTAMP_TZ_EX , TIME_TZ = SQL_TIME_TZ , TIME_TZ_EX = SQL_TIME_TZ_EX ,
  INT128 = SQL_INT128 , DEC16 = SQL_DEC16 , DEC34 = SQL_DEC34 , BOOLEAN = SQL_BOOLEAN
}
 Descriptor original type. More...
 
enum class  DescriptorAdjustedType : unsigned {
  NULL_TYPE = SQL_NULL , STRING = SQL_VARYING , INT16 = SQL_SHORT , INT32 = SQL_LONG ,
  FLOAT = SQL_FLOAT , DOUBLE = SQL_DOUBLE , TIMESTAMP = SQL_TIMESTAMP , BLOB = SQL_BLOB ,
  TIME = SQL_TYPE_TIME , DATE = SQL_TYPE_DATE , INT64 = SQL_INT64 , TIMESTAMP_TZ = SQL_TIMESTAMP_TZ ,
  TIMESTAMP_TZ_EX = SQL_TIMESTAMP_TZ_EX , TIME_TZ = SQL_TIME_TZ , TIME_TZ_EX = SQL_TIME_TZ_EX , INT128 = SQL_INT128 ,
  DECFLOAT16 = SQL_DEC16 , DECFLOAT34 = SQL_DEC34 , BOOLEAN = SQL_BOOLEAN
}
 Descriptor adjusted type. More...
 
enum class  StatementType : unsigned {
  SELECT = isc_info_sql_stmt_select , INSERT = isc_info_sql_stmt_insert , UPDATE = isc_info_sql_stmt_update , DELETE = isc_info_sql_stmt_delete ,
  DDL = isc_info_sql_stmt_ddl , GET_SEGMENT = isc_info_sql_stmt_get_segment , PUT_SEGMENT = isc_info_sql_stmt_put_segment , EXEC_PROCEDURE = isc_info_sql_stmt_exec_procedure ,
  START_TRANSACTION = isc_info_sql_stmt_start_trans , COMMIT = isc_info_sql_stmt_commit , ROLLBACK = isc_info_sql_stmt_rollback , SELECT_FOR_UPDATE = isc_info_sql_stmt_select_for_upd ,
  SET_GENERATOR = isc_info_sql_stmt_set_generator , SAVEPOINT = isc_info_sql_stmt_savepoint
}
 Distinguishes the semantic category of the prepared SQL statement. More...
 
enum class  TransactionIsolationLevel { CONSISTENCY , READ_COMMITTED , SNAPSHOT }
 Transaction isolation level. More...
 
enum class  TransactionReadCommittedMode { NO_RECORD_VERSION , RECORD_VERSION }
 Transaction read committed mode. More...
 
enum class  TransactionAccessMode { READ_ONLY , READ_WRITE }
 Transaction access mode. More...
 
enum class  TransactionWaitMode { NO_WAIT , WAIT }
 Transaction wait mode. More...
 

Functions

template<typename T >
FbUniquePtr< T > fbUnique (T *obj) noexcept
 
template<typename T >
FbRef< T > fbRef (T *arg) noexcept
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const fbcpp::ScaledNumber< T > &scaledNumber)
 Stream insertion helper that renders the scaled number as value followed by e and the scale.
 
Convenience template specializations
template<>
std::optional< bool > Statement::get< std::optional< bool > > (unsigned index)
 
template<>
std::optional< BlobIdStatement::get< std::optional< BlobId > > (unsigned index)
 
template<>
std::optional< std::int16_t > Statement::get< std::optional< std::int16_t > > (unsigned index)
 
template<>
std::optional< ScaledInt16Statement::get< std::optional< ScaledInt16 > > (unsigned index)
 
template<>
std::optional< std::int32_t > Statement::get< std::optional< std::int32_t > > (unsigned index)
 
template<>
std::optional< ScaledInt32Statement::get< std::optional< ScaledInt32 > > (unsigned index)
 
template<>
std::optional< std::int64_t > Statement::get< std::optional< std::int64_t > > (unsigned index)
 
template<>
std::optional< ScaledInt64Statement::get< std::optional< ScaledInt64 > > (unsigned index)
 
template<>
std::optional< ScaledOpaqueInt128Statement::get< std::optional< ScaledOpaqueInt128 > > (unsigned index)
 
template<>
std::optional< BoostInt128Statement::get< std::optional< BoostInt128 > > (unsigned index)
 
template<>
std::optional< ScaledBoostInt128Statement::get< std::optional< ScaledBoostInt128 > > (unsigned index)
 
template<>
std::optional< float > Statement::get< std::optional< float > > (unsigned index)
 
template<>
std::optional< double > Statement::get< std::optional< double > > (unsigned index)
 
template<>
std::optional< OpaqueDecFloat16Statement::get< std::optional< OpaqueDecFloat16 > > (unsigned index)
 
template<>
std::optional< BoostDecFloat16Statement::get< std::optional< BoostDecFloat16 > > (unsigned index)
 
template<>
std::optional< OpaqueDecFloat34Statement::get< std::optional< OpaqueDecFloat34 > > (unsigned index)
 
template<>
std::optional< BoostDecFloat34Statement::get< std::optional< BoostDecFloat34 > > (unsigned index)
 
template<>
std::optional< DateStatement::get< std::optional< Date > > (unsigned index)
 
template<>
std::optional< OpaqueDateStatement::get< std::optional< OpaqueDate > > (unsigned index)
 
template<>
std::optional< TimeStatement::get< std::optional< Time > > (unsigned index)
 
template<>
std::optional< OpaqueTimeStatement::get< std::optional< OpaqueTime > > (unsigned index)
 
template<>
std::optional< OpaqueTimestampStatement::get< std::optional< OpaqueTimestamp > > (unsigned index)
 
template<>
std::optional< TimestampStatement::get< std::optional< Timestamp > > (unsigned index)
 
template<>
std::optional< TimeTzStatement::get< std::optional< TimeTz > > (unsigned index)
 
template<>
std::optional< OpaqueTimeTzStatement::get< std::optional< OpaqueTimeTz > > (unsigned index)
 
template<>
std::optional< TimestampTzStatement::get< std::optional< TimestampTz > > (unsigned index)
 
template<>
std::optional< OpaqueTimestampTzStatement::get< std::optional< OpaqueTimestampTz > > (unsigned index)
 
template<>
std::optional< std::string > Statement::get< std::optional< std::string > > (unsigned index)
 

Detailed Description

fb-cpp namespace.

Typedef Documentation

◆ BoostDecFloat16

using fbcpp::BoostDecFloat16 = typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<16> >

16-digit decimal floating point using Boost.Multiprecision.

Definition at line 97 of file types.h.

◆ BoostDecFloat34

using fbcpp::BoostDecFloat34 = typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<34> >

34-digit decimal floating point using Boost.Multiprecision.

Definition at line 102 of file types.h.

◆ BoostInt128

using fbcpp::BoostInt128 = typedef boost::multiprecision::int128_t

128-bit integer using Boost.Multiprecision.

Definition at line 85 of file types.h.

◆ Date

using fbcpp::Date = typedef std::chrono::year_month_day

Firebird SQL calendar date.

Definition at line 108 of file types.h.

◆ FbUniquePtr

template<typename T >
using fbcpp::FbUniquePtr = typedef std::unique_ptr<T, impl::FbDisposeDeleter>

Definition at line 49 of file SmartPtrs.h.

◆ OpaqueDecFloat16

using fbcpp::OpaqueDecFloat16 = typedef FB_DEC16

Opaque 16-digit decimal floating point exposed by the Firebird API.

Definition at line 205 of file types.h.

◆ OpaqueDecFloat34

using fbcpp::OpaqueDecFloat34 = typedef FB_DEC34

Opaque 34-digit decimal floating point exposed by the Firebird API.

Definition at line 210 of file types.h.

◆ OpaqueInt128

using fbcpp::OpaqueInt128 = typedef FB_I128

Opaque 128-bit integer exposed by the Firebird API.

Definition at line 200 of file types.h.

◆ ScaledBoostInt128

Scaled 128-bit integer backed by Boost.Multiprecision.

Definition at line 90 of file types.h.

◆ ScaledInt16

using fbcpp::ScaledInt16 = typedef ScaledNumber<std::int16_t>

Signed 16-bit scaled number.

Definition at line 69 of file types.h.

◆ ScaledInt32

using fbcpp::ScaledInt32 = typedef ScaledNumber<std::int32_t>

Signed 32-bit scaled number.

Definition at line 74 of file types.h.

◆ ScaledInt64

using fbcpp::ScaledInt64 = typedef ScaledNumber<std::int64_t>

Signed 64-bit scaled number.

Definition at line 79 of file types.h.

◆ ScaledOpaqueInt128

Scaled Firebird opaque 128-bit integer.

Definition at line 215 of file types.h.

◆ Time

using fbcpp::Time = typedef std::chrono::hh_mm_ss<std::chrono::microseconds>

Firebird SQL time-of-day with microsecond resolution.

Definition at line 113 of file types.h.

Enumeration Type Documentation

◆ BlobSeekMode

enum class fbcpp::BlobSeekMode : int
strong

Defines the origin used when repositioning a blob.

Definition at line 232 of file Blob.h.

◆ BlobStorage

enum class fbcpp::BlobStorage : std::uint8_t
strong

Blob storage options.

Definition at line 70 of file Blob.h.

◆ BlobType

enum class fbcpp::BlobType : std::uint8_t
strong

Blob type.

Definition at line 79 of file Blob.h.

◆ DescriptorAdjustedType

enum class fbcpp::DescriptorAdjustedType : unsigned
strong

Descriptor adjusted type.

Definition at line 66 of file Descriptor.h.

◆ DescriptorOriginalType

enum class fbcpp::DescriptorOriginalType : unsigned
strong

Descriptor original type.

Definition at line 39 of file Descriptor.h.

◆ StatementType

enum class fbcpp::StatementType : unsigned
strong

Distinguishes the semantic category of the prepared SQL statement.

Enumerator
SELECT 

Server classified the statement as a SELECT.

INSERT 

Server classified the statement as an INSERT.

UPDATE 

Server classified the statement as an UPDATE.

DELETE 

Server classified the statement as a DELETE.

DDL 

Statement performs data definition operations.

GET_SEGMENT 

Statement reads a blob segment - legacy feature.

PUT_SEGMENT 

Statement writes a blob segment - legacy feature.

EXEC_PROCEDURE 

Statement executes a stored procedure.

START_TRANSACTION 

Statement starts a new transaction.

COMMIT 

Statement commits a transaction.

ROLLBACK 

Statement rolls back a transaction.

SELECT_FOR_UPDATE 

Cursor-based SELECT that allows updates.

SET_GENERATOR 

Statement sets a generator (sequence) value.

SAVEPOINT 

Statement manages a savepoint.

Definition at line 119 of file Statement.h.

◆ TransactionAccessMode

enum class fbcpp::TransactionAccessMode
strong

Transaction access mode.

Definition at line 68 of file Transaction.h.

◆ TransactionIsolationLevel

Transaction isolation level.

Definition at line 49 of file Transaction.h.

◆ TransactionReadCommittedMode

Transaction read committed mode.

Definition at line 59 of file Transaction.h.

◆ TransactionWaitMode

enum class fbcpp::TransactionWaitMode
strong

Transaction wait mode.

Definition at line 77 of file Transaction.h.

Function Documentation

◆ fbRef()

template<typename T >
FbRef< T > fbcpp::fbRef ( T *  arg)
noexcept

Definition at line 216 of file SmartPtrs.h.

◆ fbUnique()

template<typename T >
FbUniquePtr< T > fbcpp::fbUnique ( T *  obj)
noexcept

Definition at line 52 of file SmartPtrs.h.

◆ operator<<()

template<typename T >
std::ostream & fbcpp::operator<< ( std::ostream &  os,
const fbcpp::ScaledNumber< T > &  scaledNumber 
)

Stream insertion helper that renders the scaled number as value followed by e and the scale.

Definition at line 298 of file types.h.

◆ Statement::get< std::optional< BlobId > >()

template<>
std::optional< BlobId > fbcpp::Statement::get< std::optional< BlobId > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< bool > >()

template<>
std::optional< bool > fbcpp::Statement::get< std::optional< bool > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< BoostDecFloat16 > >()

template<>
std::optional< BoostDecFloat16 > fbcpp::Statement::get< std::optional< BoostDecFloat16 > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< BoostDecFloat34 > >()

template<>
std::optional< BoostDecFloat34 > fbcpp::Statement::get< std::optional< BoostDecFloat34 > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< BoostInt128 > >()

template<>
std::optional< BoostInt128 > fbcpp::Statement::get< std::optional< BoostInt128 > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< Date > >()

template<>
std::optional< Date > fbcpp::Statement::get< std::optional< Date > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< double > >()

template<>
std::optional< double > fbcpp::Statement::get< std::optional< double > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< float > >()

template<>
std::optional< float > fbcpp::Statement::get< std::optional< float > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< OpaqueDate > >()

template<>
std::optional< OpaqueDate > fbcpp::Statement::get< std::optional< OpaqueDate > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< OpaqueDecFloat16 > >()

template<>
std::optional< OpaqueDecFloat16 > fbcpp::Statement::get< std::optional< OpaqueDecFloat16 > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< OpaqueDecFloat34 > >()

template<>
std::optional< OpaqueDecFloat34 > fbcpp::Statement::get< std::optional< OpaqueDecFloat34 > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< OpaqueTime > >()

template<>
std::optional< OpaqueTime > fbcpp::Statement::get< std::optional< OpaqueTime > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< OpaqueTimestamp > >()

template<>
std::optional< OpaqueTimestamp > fbcpp::Statement::get< std::optional< OpaqueTimestamp > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< OpaqueTimestampTz > >()

template<>
std::optional< OpaqueTimestampTz > fbcpp::Statement::get< std::optional< OpaqueTimestampTz > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< OpaqueTimeTz > >()

template<>
std::optional< OpaqueTimeTz > fbcpp::Statement::get< std::optional< OpaqueTimeTz > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< ScaledBoostInt128 > >()

template<>
std::optional< ScaledBoostInt128 > fbcpp::Statement::get< std::optional< ScaledBoostInt128 > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< ScaledInt16 > >()

template<>
std::optional< ScaledInt16 > fbcpp::Statement::get< std::optional< ScaledInt16 > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< ScaledInt32 > >()

template<>
std::optional< ScaledInt32 > fbcpp::Statement::get< std::optional< ScaledInt32 > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< ScaledInt64 > >()

template<>
std::optional< ScaledInt64 > fbcpp::Statement::get< std::optional< ScaledInt64 > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< ScaledOpaqueInt128 > >()

template<>
std::optional< ScaledOpaqueInt128 > fbcpp::Statement::get< std::optional< ScaledOpaqueInt128 > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< std::int16_t > >()

template<>
std::optional< std::int16_t > fbcpp::Statement::get< std::optional< std::int16_t > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< std::int32_t > >()

template<>
std::optional< std::int32_t > fbcpp::Statement::get< std::optional< std::int32_t > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< std::int64_t > >()

template<>
std::optional< std::int64_t > fbcpp::Statement::get< std::optional< std::int64_t > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< std::string > >()

template<>
std::optional< std::string > fbcpp::Statement::get< std::optional< std::string > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< Time > >()

template<>
std::optional< Time > fbcpp::Statement::get< std::optional< Time > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< Timestamp > >()

template<>
std::optional< Timestamp > fbcpp::Statement::get< std::optional< Timestamp > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< TimestampTz > >()

template<>
std::optional< TimestampTz > fbcpp::Statement::get< std::optional< TimestampTz > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.

◆ Statement::get< std::optional< TimeTz > >()

template<>
std::optional< TimeTz > fbcpp::Statement::get< std::optional< TimeTz > > ( unsigned  index)
inline

Definition at line 182 of file Statement.h.