- Notifications
You must be signed in to change notification settings - Fork 234
/
Copy pathBlobUtil.h
127 lines (95 loc) · 3.6 KB
/
BlobUtil.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
*
* Software distributed under the License is distributed AS IS,
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
* See the License for the specific language governing rights
* and limitations under the License.
*
* The Original Code was created by Adriano dos Santos Fernandes
* for the Firebird Open Source RDBMS project.
*
* Copyright (c) 2020 Adriano dos Santos Fernandes <adrianosf@gmail.com>
* and all contributors signed below.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*/
#ifndef JRD_BLOB_UTIL_H
#defineJRD_BLOB_UTIL_H
#include"firebird.h"
#include"firebird/Message.h"
#include"../common/classes/fb_string.h"
#include"../common/classes/ImplementHelper.h"
#include"../common/status.h"
#include"../jrd/SystemPackages.h"
namespaceJrd {
classBlobUtilPackage : publicSystemPackage
{
public:
BlobUtilPackage(Firebird::MemoryPool& pool);
private:
FB_MESSAGE(BinaryMessage, Firebird::ThrowStatusExceptionWrapper,
(FB_INTL_VARCHAR(MAX_VARY_COLUMN_SIZE, 0), data)
);
FB_MESSAGE(BlobMessage, Firebird::ThrowStatusExceptionWrapper,
(FB_BLOB, blob)
);
FB_MESSAGE(HandleMessage, Firebird::ThrowStatusExceptionWrapper,
(FB_INTEGER, handle)
);
FB_MESSAGE(BooleanMessage, Firebird::ThrowStatusExceptionWrapper,
(FB_BOOLEAN, boolean)
);
//----------
static Firebird::IExternalResultSet* cancelBlobProcedure(Firebird::ThrowStatusExceptionWrapper* status,
Firebird::IExternalContext* context, const BlobMessage::Type* in, void* out);
//----------
static Firebird::IExternalResultSet* closeHandleProcedure(Firebird::ThrowStatusExceptionWrapper* status,
Firebird::IExternalContext* context, const HandleMessage::Type* in, void* out);
//----------
staticvoidisWritableFunction(Firebird::ThrowStatusExceptionWrapper* status,
Firebird::IExternalContext* context,
const BlobMessage::Type* in, BooleanMessage::Type* out);
//----------
FB_MESSAGE(NewBlobInput, Firebird::ThrowStatusExceptionWrapper,
(FB_BOOLEAN, segmented)
(FB_BOOLEAN, tempStorage)
);
staticvoidnewBlobFunction(Firebird::ThrowStatusExceptionWrapper* status,
Firebird::IExternalContext* context,
const NewBlobInput::Type* in, BlobMessage::Type* out);
//----------
staticvoidopenBlobFunction(Firebird::ThrowStatusExceptionWrapper* status,
Firebird::IExternalContext* context,
const BlobMessage::Type* in, HandleMessage::Type* out);
//----------
FB_MESSAGE(SeekInput, Firebird::ThrowStatusExceptionWrapper,
(FB_INTEGER, handle)
(FB_INTEGER, mode)
(FB_INTEGER, offset)
);
FB_MESSAGE(SeekOutput, Firebird::ThrowStatusExceptionWrapper,
(FB_INTEGER, offset)
);
staticvoidseekFunction(Firebird::ThrowStatusExceptionWrapper* status,
Firebird::IExternalContext* context, const SeekInput::Type* in, SeekOutput::Type* out);
//----------
FB_MESSAGE(ReadDataInput, Firebird::ThrowStatusExceptionWrapper,
(FB_INTEGER, handle)
(FB_INTEGER, length)
);
staticvoidreadDataFunction(Firebird::ThrowStatusExceptionWrapper* status,
Firebird::IExternalContext* context,
const ReadDataInput::Type* in, BinaryMessage::Type* out);
//----------
staticvoidmakeBlobFunction(Firebird::ThrowStatusExceptionWrapper* status,
Firebird::IExternalContext* context,
const HandleMessage::Type* in, BlobMessage::Type* out);
};
} // namespace
#endif// JRD_BLOB_UTIL_H