![]() |
fb-cpp 0.0.2
A modern C++ wrapper for the Firebird database API
|
Describes the fields of a Firebird request message. More...
#include <RequestMessageFormat.h>
Public Member Functions | |
| RequestMessageFormat & | addBool (bool isNullable) |
| Appends a boolean field, optionally nullable. | |
| RequestMessageFormat & | addInt16 (bool isNullable) |
| Appends a 16-bit signed integer field, optionally nullable. | |
| RequestMessageFormat & | addScaledInt16 (bool isNullable, int scale) |
| Appends a scaled 16-bit signed integer field, optionally nullable. | |
| RequestMessageFormat & | addInt32 (bool isNullable) |
| Appends a 32-bit signed integer field, optionally nullable. | |
| RequestMessageFormat & | addScaledInt32 (bool isNullable, int scale) |
| Appends a scaled 32-bit signed integer field, optionally nullable. | |
| RequestMessageFormat & | addInt64 (bool isNullable) |
| Appends a 64-bit signed integer field, optionally nullable. | |
| RequestMessageFormat & | addScaledInt64 (bool isNullable, int scale) |
| Appends a scaled 64-bit signed integer field, optionally nullable. | |
| RequestMessageFormat & | addScaledOpaqueInt128 (bool isNullable, int scale) |
| Appends a scaled 128-bit integer field in Firebird's representation, optionally nullable. | |
| RequestMessageFormat & | addScaledBoostInt128 (bool isNullable, int scale) |
| Appends a scaled 128-bit integer field expressed with Boost.Multiprecision, optionally nullable. | |
| RequestMessageFormat & | addFloat (bool isNullable) |
| Appends a single precision floating-point field, optionally nullable. | |
| RequestMessageFormat & | addDouble (bool isNullable) |
| Appends a double precision floating-point field, optionally nullable. | |
| RequestMessageFormat & | addDecFloat16 (bool isNullable) |
| Appends a 16-digit decimal floating-point field, optionally nullable. | |
| RequestMessageFormat & | addDecFloat34 (bool isNullable) |
| Appends a 34-digit decimal floating-point field, optionally nullable. | |
| RequestMessageFormat & | addDate (bool isNullable) |
| Appends a date field, optionally nullable. | |
| RequestMessageFormat & | addTime (bool isNullable) |
| Appends a time-of-day field without timezone, optionally nullable. | |
| RequestMessageFormat & | addTimestamp (bool isNullable) |
| Appends a timestamp field without timezone, optionally nullable. | |
| RequestMessageFormat & | addTimeTz (bool isNullable) |
| Appends a time-of-day field with timezone, optionally nullable. | |
| RequestMessageFormat & | addTimestampTz (bool isNullable) |
| Appends a timestamp field with timezone, optionally nullable. | |
| RequestMessageFormat & | addBlobId (bool isNullable) |
| Appends a blob identifier field, optionally nullable. | |
| RequestMessageFormat & | addString (bool isNullable, unsigned length, std::optional< unsigned > charSetId={}) |
| Appends a variable-length string field with the given maximum length in bytes, optionally nullable. | |
| unsigned | getCount () const noexcept |
| Returns the number of fields. | |
| const std::vector< Descriptor > & | getDescriptors () const noexcept |
| Returns the descriptors of the appended fields, in declaration order. | |
| unsigned | getLength () const noexcept |
| Returns the total message length in bytes. | |
| unsigned | getBlrFieldIndex (unsigned index) const |
| Returns the index of the field inside the BLR message, which interleaves null indicators as extra entries. | |
| std::vector< std::byte > | buildBlrMessageClause (unsigned messageNumber) const |
Generates the blr_message clause describing this message. | |
Describes the fields of a Firebird request message.
Firebird requests (compiled BLR programs) have no server-side message metadata: the layout of each message is defined by the blr_message clause declared inside the BLR itself. RequestMessageFormat is the client-side counterpart of such a clause. Fields are appended with typed add methods that compute the same offsets and alignments used by the engine when it parses blr_message, and buildBlrMessageClause() generates the actual clause bytes, so declarations and accessors cannot get out of sync.
Non-nullable fields occupy only their value bytes. Nullable fields reserve an additional 16-bit null indicator right after the value, exactly like DSQL messages do.
Definition at line 61 of file RequestMessageFormat.h.
|
inline |
Appends a blob identifier field, optionally nullable.
Definition at line 213 of file RequestMessageFormat.h.
|
inline |
Appends a boolean field, optionally nullable.
Definition at line 67 of file RequestMessageFormat.h.
|
inline |
Appends a date field, optionally nullable.
Definition at line 173 of file RequestMessageFormat.h.
|
inline |
Appends a 16-digit decimal floating-point field, optionally nullable.
Definition at line 157 of file RequestMessageFormat.h.
|
inline |
Appends a 34-digit decimal floating-point field, optionally nullable.
Definition at line 165 of file RequestMessageFormat.h.
|
inline |
Appends a double precision floating-point field, optionally nullable.
Definition at line 149 of file RequestMessageFormat.h.
|
inline |
Appends a single precision floating-point field, optionally nullable.
Definition at line 141 of file RequestMessageFormat.h.
|
inline |
Appends a 16-bit signed integer field, optionally nullable.
Definition at line 75 of file RequestMessageFormat.h.
|
inline |
Appends a 32-bit signed integer field, optionally nullable.
Definition at line 91 of file RequestMessageFormat.h.
|
inline |
Appends a 64-bit signed integer field, optionally nullable.
Definition at line 107 of file RequestMessageFormat.h.
|
inline |
Appends a scaled 128-bit integer field expressed with Boost.Multiprecision, optionally nullable.
Definition at line 132 of file RequestMessageFormat.h.
|
inline |
Appends a scaled 16-bit signed integer field, optionally nullable.
Definition at line 83 of file RequestMessageFormat.h.
|
inline |
Appends a scaled 32-bit signed integer field, optionally nullable.
Definition at line 99 of file RequestMessageFormat.h.
|
inline |
Appends a scaled 64-bit signed integer field, optionally nullable.
Definition at line 115 of file RequestMessageFormat.h.
|
inline |
Appends a scaled 128-bit integer field in Firebird's representation, optionally nullable.
Definition at line 123 of file RequestMessageFormat.h.
|
inline |
Appends a variable-length string field with the given maximum length in bytes, optionally nullable.
When charSetId is not given, the connection character set is used.
Definition at line 222 of file RequestMessageFormat.h.
|
inline |
Appends a time-of-day field without timezone, optionally nullable.
Definition at line 181 of file RequestMessageFormat.h.
|
inline |
Appends a timestamp field without timezone, optionally nullable.
Definition at line 189 of file RequestMessageFormat.h.
|
inline |
Appends a timestamp field with timezone, optionally nullable.
Definition at line 205 of file RequestMessageFormat.h.
|
inline |
Appends a time-of-day field with timezone, optionally nullable.
Definition at line 197 of file RequestMessageFormat.h.
| std::vector< std::byte > fbcpp::request::RequestMessageFormat::buildBlrMessageClause | ( | unsigned | messageNumber | ) | const |
Generates the blr_message clause describing this message.
Embed the returned bytes in your BLR before the body statements.
Definition at line 72 of file RequestMessageFormat.cpp.
|
inline |
Returns the index of the field inside the BLR message, which interleaves null indicators as extra entries.
Use it to write blr_parameter references for non-nullable fields and blr_parameter2 references for nullable fields, whose null indicator is the next entry.
Definition at line 261 of file RequestMessageFormat.h.
|
inlinenoexcept |
Returns the number of fields.
Definition at line 235 of file RequestMessageFormat.h.
|
inlinenoexcept |
Returns the descriptors of the appended fields, in declaration order.
Definition at line 243 of file RequestMessageFormat.h.
|
inlinenoexcept |
Returns the total message length in bytes.
Definition at line 251 of file RequestMessageFormat.h.