67 |
|
private |
68 |
|
FBlobIntf: Firebird.IBlob; |
69 |
|
FEOB: boolean; |
70 |
+ |
FFirebird30ClientAPI: TFB30ClientAPI; |
71 |
|
protected |
72 |
|
procedure CheckReadable; override; |
73 |
|
procedure CheckWritable; override; |
192 |
|
if FBlobIntf = nil then |
193 |
|
IBError(ibxeBlobNotOpen,[nil]); |
194 |
|
|
195 |
< |
with Firebird30ClientAPI, Response as TBlobInfo do |
195 |
> |
with FFirebird30ClientAPI, Response as TBlobInfo do |
196 |
|
begin |
197 |
|
FBlobIntf.getInfo(StatusIntf,Length(Request),BytePtr(@Request), |
198 |
|
GetBufSize, BytePtr(Buffer)); |
205 |
|
begin |
206 |
|
if FBlobIntf = nil then |
207 |
|
Exit; |
208 |
< |
with Firebird30ClientAPI do |
208 |
> |
with FFirebird30ClientAPI do |
209 |
|
begin |
210 |
|
FBlobIntf.close(StatusIntf); |
211 |
|
if not Force then Check4DataBaseError; |
218 |
|
begin |
219 |
|
if FBlobIntf = nil then |
220 |
|
Exit; |
221 |
< |
with Firebird30ClientAPI do |
221 |
> |
with FFirebird30ClientAPI do |
222 |
|
begin |
223 |
|
FBlobIntf.cancel(StatusIntf); |
224 |
|
if not Force then Check4DataBaseError; |
231 |
|
MetaData: IBlobMetaData; BPB: IBPB); |
232 |
|
begin |
233 |
|
inherited Create(Attachment,Transaction,MetaData,BPB); |
234 |
< |
with Firebird30ClientAPI do |
234 |
> |
FFirebird30ClientAPI := Attachment.Firebird30ClientAPI; |
235 |
> |
with FFirebird30ClientAPI do |
236 |
|
begin |
237 |
|
if BPB = nil then |
238 |
|
FBlobIntf := Attachment.AttachmentIntf.createBlob(StatusIntf,Transaction.TransactionIntf, |
254 |
|
MetaData.FCharSetID := CharSetID; |
255 |
|
MetaData.FHasFullMetaData := true; |
256 |
|
inherited Create(Attachment,Transaction,MetaData,BPB); |
257 |
< |
with Firebird30ClientAPI do |
257 |
> |
FFirebird30ClientAPI := Attachment.Firebird30ClientAPI; |
258 |
> |
with FFirebird30ClientAPI do |
259 |
|
begin |
260 |
|
if BPB = nil then |
261 |
|
FBlobIntf := Attachment.AttachmentIntf.createBlob(StatusIntf,Transaction.TransactionIntf, |
272 |
|
Transaction: TFBTransaction; MetaData: IBlobMetaData; BlobID: TISC_QUAD; BPB: IBPB); |
273 |
|
begin |
274 |
|
inherited Create(Attachment,Transaction,MetaData,BlobID,BPB); |
275 |
+ |
FFirebird30ClientAPI := Attachment.Firebird30ClientAPI; |
276 |
|
if (BlobID.gds_quad_high = 0) and (BlobID.gds_quad_low = 0) then |
277 |
|
Exit; |
278 |
|
|
279 |
< |
with Firebird30ClientAPI do |
279 |
> |
with FFirebird30ClientAPI do |
280 |
|
begin |
281 |
|
if BPB = nil then |
282 |
|
FBlobIntf := Attachment.AttachmentIntf.openBlob(StatusIntf,(Transaction as TFB30Transaction).TransactionIntf, |
304 |
|
LocalBuffer := PAnsiChar(@Buffer); |
305 |
|
repeat |
306 |
|
localCount := Min(Count,MaxuShort); |
307 |
< |
with Firebird30ClientAPI do |
307 |
> |
with FFirebird30ClientAPI do |
308 |
|
returnCode := FBlobIntf.getSegment(StatusIntf,localCount, LocalBuffer, @BytesRead); |
309 |
|
SignalActivity; |
310 |
|
Inc(LocalBuffer,BytesRead); |
317 |
|
if (returnCode <> Firebird.IStatus.Result_OK) and |
318 |
|
(returnCode <> Firebird.IStatus.Result_SEGMENT) and |
319 |
|
(returnCode <> Firebird.IStatus.RESULT_NO_DATA) then |
320 |
< |
Firebird30ClientAPI.IBDataBaseError |
320 |
> |
FFirebird30ClientAPI.IBDataBaseError |
321 |
|
end; |
322 |
|
|
323 |
|
function TFB30Blob.Write(const Buffer; Count: Longint): Longint; |
332 |
|
LocalBuffer := PAnsiChar(@Buffer); |
333 |
|
repeat |
334 |
|
localCount := Min(Count,MaxuShort); |
335 |
< |
with Firebird30ClientAPI do |
335 |
> |
with FFirebird30ClientAPI do |
336 |
|
begin |
337 |
|
FBlobIntf.putSegment(StatusIntf,localCount,LocalBuffer); |
338 |
|
Check4DataBaseError; |