1 | /* |
2 | * PROGRAM: JRD Access Method |
3 | * MODULE: blb_proto.h |
4 | * DESCRIPTION: Prototype header file for Jrd::blb.cpp |
5 | * |
6 | * The contents of this file are subject to the Interbase Public |
7 | * License Version 1.0 (the "License"); you may not use this file |
8 | * except in compliance with the License. You may obtain a copy |
9 | * of the License at http://www.Inprise.com/IPL.html |
10 | * |
11 | * Software distributed under the License is distributed on an |
12 | * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express |
13 | * or implied. See the License for the specific language governing |
14 | * rights and limitations under the License. |
15 | * |
16 | * The Original Code was created by Inprise Corporation |
17 | * and its predecessors. Portions created by Inprise Corporation are |
18 | * Copyright (C) Inprise Corporation. |
19 | * |
20 | * All Rights Reserved. |
21 | * Contributor(s): ______________________________________. |
22 | */ |
23 | |
24 | #ifndef JRD_BLB_PROTO_H |
25 | #define JRD_BLB_PROTO_H |
26 | |
27 | #include "../jrd/jrd.h" |
28 | #include "../jrd/blb.h" |
29 | #include "../jrd/exe.h" |
30 | #include "../jrd/lls.h" |
31 | #include "../jrd/val.h" |
32 | #include "../jrd/req.h" |
33 | #include "../common/classes/array.h" |
34 | |
35 | void BLB_garbage_collect(Jrd::thread_db*, Jrd::RecordStack&, Jrd::RecordStack&, ULONG, Jrd::jrd_rel*); |
36 | void BLB_gen_bpb(SSHORT source, SSHORT target, UCHAR sourceCharset, UCHAR targetCharset, Firebird::UCharBuffer& bpb); |
37 | void BLB_gen_bpb_from_descs(const dsc*, const dsc*, Firebird::UCharBuffer&); |
38 | |
39 | |
40 | class AutoBlb |
41 | { |
42 | public: |
43 | AutoBlb(Jrd::thread_db* atdbb, Jrd::blb* ablob) |
44 | : tdbb(atdbb), |
45 | blob(ablob) |
46 | { |
47 | } |
48 | |
49 | ~AutoBlb() |
50 | { |
51 | blob->BLB_close(tdbb); |
52 | } |
53 | |
54 | Jrd::blb* getBlb() |
55 | { |
56 | return blob; |
57 | } |
58 | |
59 | Jrd::blb* operator ->() |
60 | { |
61 | return blob; |
62 | } |
63 | |
64 | private: |
65 | AutoBlb(const AutoBlb&); // not implemented |
66 | AutoBlb& operator =(const AutoBlb&); // not implemented |
67 | |
68 | private: |
69 | Jrd::thread_db* tdbb; |
70 | Jrd::blb* blob; |
71 | }; |
72 | |
73 | #endif // JRD_BLB_PROTO_H |
74 | |