Skip to content

Commit 6560fe2

Browse files
asfernandesclaude
andauthored
Add comprehensive Doxygen documentation for public API (#15)
Document all previously undocumented public classes, methods, enums, and struct members: - Transaction.h: Document all enum values for TransactionIsolationLevel, TransactionReadCommittedMode, TransactionAccessMode, and TransactionWaitMode - Blob.h: Document enum values for BlobStorage, BlobType, and BlobSeekMode - Descriptor.h: Document all enum values for DescriptorOriginalType and DescriptorAdjustedType, plus all Descriptor struct members - Exception.h: Document FbCppException and DatabaseException classes - SmartPtrs.h: Document FbUniquePtr, fbUnique, FbRef, and fbRef template types and functions All documentation follows the existing triple-slash (///) style used throughout the codebase. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9c7734d commit 6560fe2

5 files changed

Lines changed: 262 additions & 0 deletions

File tree

src/fb-cpp/Blob.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,14 @@ namespace fbcpp
6969
///
7070
enum class BlobStorage : std::uint8_t
7171
{
72+
///
73+
/// Blob is stored in the main database file.
74+
///
7275
MAIN = isc_bpb_storage_main,
76+
77+
///
78+
/// Blob is stored in temporary storage and will not persist beyond the transaction.
79+
///
7380
TEMPORARY = isc_bpb_storage_temp
7481
};
7582

@@ -78,7 +85,14 @@ namespace fbcpp
7885
///
7986
enum class BlobType : std::uint8_t
8087
{
88+
///
89+
/// Blob is stored and accessed as discrete segments.
90+
///
8191
SEGMENTED = isc_bpb_type_segmented,
92+
93+
///
94+
/// Blob is treated as a continuous stream of bytes.
95+
///
8296
STREAM = isc_bpb_type_stream
8397
};
8498

@@ -231,8 +245,19 @@ namespace fbcpp
231245
///
232246
enum class BlobSeekMode : int
233247
{
248+
///
249+
/// Offset is relative to the beginning of the blob.
250+
///
234251
FROM_BEGIN = 0,
252+
253+
///
254+
/// Offset is relative to the current position in the blob.
255+
///
235256
FROM_CURRENT = blb_seek_relative,
257+
258+
///
259+
/// Offset is relative to the end of the blob.
260+
///
236261
FROM_END = blb_seek_from_tail
237262
};
238263

src/fb-cpp/Descriptor.h

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,104 @@ namespace fbcpp
3838
///
3939
enum class DescriptorOriginalType : unsigned
4040
{
41+
///
42+
/// Null type indicator.
43+
///
4144
NULL_TYPE = SQL_NULL,
45+
46+
///
47+
/// Fixed-length text.
48+
///
4249
TEXT = SQL_TEXT,
50+
51+
///
52+
/// Variable-length text.
53+
///
4354
VARYING = SQL_VARYING,
55+
56+
///
57+
/// 16-bit signed integer.
58+
///
4459
SHORT = SQL_SHORT,
60+
61+
///
62+
/// 32-bit signed integer.
63+
///
4564
LONG = SQL_LONG,
65+
66+
///
67+
/// Single-precision floating point.
68+
///
4669
FLOAT = SQL_FLOAT,
70+
71+
///
72+
/// Double-precision floating point.
73+
///
4774
DOUBLE = SQL_DOUBLE,
75+
76+
///
77+
/// Timestamp without time zone.
78+
///
4879
TIMESTAMP = SQL_TIMESTAMP,
80+
81+
///
82+
/// Binary large object.
83+
///
4984
BLOB = SQL_BLOB,
85+
86+
///
87+
/// Time of day without time zone.
88+
///
5089
TIME = SQL_TYPE_TIME,
90+
91+
///
92+
/// Calendar date.
93+
///
5194
DATE = SQL_TYPE_DATE,
95+
96+
///
97+
/// 64-bit signed integer.
98+
///
5299
INT64 = SQL_INT64,
100+
101+
///
102+
/// Timestamp with time zone.
103+
///
53104
TIMESTAMP_TZ = SQL_TIMESTAMP_TZ,
105+
106+
///
107+
/// Extended timestamp with time zone.
108+
///
54109
TIMESTAMP_TZ_EX = SQL_TIMESTAMP_TZ_EX,
110+
111+
///
112+
/// Time of day with time zone.
113+
///
55114
TIME_TZ = SQL_TIME_TZ,
115+
116+
///
117+
/// Extended time of day with time zone.
118+
///
56119
TIME_TZ_EX = SQL_TIME_TZ_EX,
120+
121+
///
122+
/// 128-bit signed integer.
123+
///
57124
INT128 = SQL_INT128,
125+
126+
///
127+
/// 16-digit decimal floating point.
128+
///
58129
DEC16 = SQL_DEC16,
130+
131+
///
132+
/// 34-digit decimal floating point.
133+
///
59134
DEC34 = SQL_DEC34,
135+
136+
///
137+
/// Boolean value.
138+
///
60139
BOOLEAN = SQL_BOOLEAN,
61140
};
62141

@@ -65,24 +144,99 @@ namespace fbcpp
65144
///
66145
enum class DescriptorAdjustedType : unsigned
67146
{
147+
///
148+
/// Null type indicator.
149+
///
68150
NULL_TYPE = SQL_NULL,
151+
152+
///
153+
/// String type (variable-length).
154+
///
69155
STRING = SQL_VARYING,
156+
157+
///
158+
/// 16-bit signed integer.
159+
///
70160
INT16 = SQL_SHORT,
161+
162+
///
163+
/// 32-bit signed integer.
164+
///
71165
INT32 = SQL_LONG,
166+
167+
///
168+
/// Single-precision floating point.
169+
///
72170
FLOAT = SQL_FLOAT,
171+
172+
///
173+
/// Double-precision floating point.
174+
///
73175
DOUBLE = SQL_DOUBLE,
176+
177+
///
178+
/// Timestamp without time zone.
179+
///
74180
TIMESTAMP = SQL_TIMESTAMP,
181+
182+
///
183+
/// Binary large object.
184+
///
75185
BLOB = SQL_BLOB,
186+
187+
///
188+
/// Time of day without time zone.
189+
///
76190
TIME = SQL_TYPE_TIME,
191+
192+
///
193+
/// Calendar date.
194+
///
77195
DATE = SQL_TYPE_DATE,
196+
197+
///
198+
/// 64-bit signed integer.
199+
///
78200
INT64 = SQL_INT64,
201+
202+
///
203+
/// Timestamp with time zone.
204+
///
79205
TIMESTAMP_TZ = SQL_TIMESTAMP_TZ,
206+
207+
///
208+
/// Extended timestamp with time zone.
209+
///
80210
TIMESTAMP_TZ_EX = SQL_TIMESTAMP_TZ_EX,
211+
212+
///
213+
/// Time of day with time zone.
214+
///
81215
TIME_TZ = SQL_TIME_TZ,
216+
217+
///
218+
/// Extended time of day with time zone.
219+
///
82220
TIME_TZ_EX = SQL_TIME_TZ_EX,
221+
222+
///
223+
/// 128-bit signed integer.
224+
///
83225
INT128 = SQL_INT128,
226+
227+
///
228+
/// 16-digit decimal floating point.
229+
///
84230
DECFLOAT16 = SQL_DEC16,
231+
232+
///
233+
/// 34-digit decimal floating point.
234+
///
85235
DECFLOAT34 = SQL_DEC34,
236+
237+
///
238+
/// Boolean value.
239+
///
86240
BOOLEAN = SQL_BOOLEAN,
87241
};
88242

@@ -91,12 +245,39 @@ namespace fbcpp
91245
///
92246
struct Descriptor final
93247
{
248+
///
249+
/// Original SQL type as reported by Firebird.
250+
///
94251
DescriptorOriginalType originalType;
252+
253+
///
254+
/// Adjusted type after normalization for easier handling.
255+
///
95256
DescriptorAdjustedType adjustedType;
257+
258+
///
259+
/// Decimal scale for numeric types; zero for non-numeric types.
260+
///
96261
int scale;
262+
263+
///
264+
/// Length in bytes of the column or parameter data.
265+
///
97266
unsigned length;
267+
268+
///
269+
/// Byte offset of this field within the message buffer.
270+
///
98271
unsigned offset;
272+
273+
///
274+
/// Byte offset of the null indicator within the message buffer.
275+
///
99276
unsigned nullOffset;
277+
278+
///
279+
/// Indicates whether the column or parameter can contain null values.
280+
///
100281
bool isNullable;
101282
// FIXME: more things
102283
};

src/fb-cpp/Exception.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,22 +176,34 @@ namespace fbcpp::impl
176176
///
177177
namespace fbcpp
178178
{
179+
///
180+
/// Base exception class for all fb-cpp exceptions.
181+
///
179182
class FbCppException : public std::runtime_error
180183
{
181184
public:
182185
using std::runtime_error::runtime_error;
183186

187+
///
188+
/// Constructs an FbCppException with the specified error message.
189+
///
184190
explicit FbCppException(const std::string& message)
185191
: std::runtime_error{message}
186192
{
187193
}
188194
};
189195

196+
///
197+
/// Exception thrown when a Firebird database operation fails.
198+
///
190199
class DatabaseException final : public FbCppException
191200
{
192201
public:
193202
using FbCppException::FbCppException;
194203

204+
///
205+
/// Constructs a DatabaseException from a Firebird status vector.
206+
///
195207
explicit DatabaseException(Client& client, const std::intptr_t* status)
196208
: FbCppException{buildMessage(client, status)}
197209
{

src/fb-cpp/SmartPtrs.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,25 @@ namespace fbcpp
4545
};
4646
} // namespace impl
4747

48+
///
49+
/// Unique pointer type for Firebird disposable objects.
50+
///
4851
template <typename T>
4952
using FbUniquePtr = std::unique_ptr<T, impl::FbDisposeDeleter>;
5053

54+
///
55+
/// Creates a unique pointer for a Firebird disposable object.
56+
///
5157
template <typename T>
5258
FbUniquePtr<T> fbUnique(T* obj) noexcept
5359
{
5460
return FbUniquePtr<T>{obj};
5561
}
5662

5763
// FIXME: Review every usage to see if is not leaking one reference count.
64+
///
65+
/// Reference-counted smart pointer for Firebird objects using addRef/release semantics.
66+
///
5867
template <typename T>
5968
class FbRef final
6069
{
@@ -212,6 +221,9 @@ namespace fbcpp
212221
T* ptr;
213222
};
214223

224+
///
225+
/// Creates a reference-counted smart pointer for a Firebird object.
226+
///
215227
template <typename T>
216228
FbRef<T> fbRef(T* arg) noexcept
217229
{

0 commit comments

Comments
 (0)