ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/fbintf/client/2.5/FB25Blob.pas
(Generate patch)

Comparing ibx/trunk/fbintf/client/2.5/FB25Blob.pas (file contents):
Revision 60 by tony, Mon Mar 27 15:21:02 2017 UTC vs.
Revision 263 by tony, Thu Dec 6 15:55:01 2018 UTC

# Line 84 | Line 84 | type
84       FHasFullMetaData: boolean;
85       FAttachment: TFB25Attachment;
86       FTransaction: TFB25Transaction;
87 +     FFirebird25ClientAPI: TFB25ClientAPI;
88     protected
89       function Attachment: IAttachment; override;
90       procedure NeedFullMetadata; override;
# Line 101 | Line 102 | type
102    private
103      FHandle: TISC_BLOB_HANDLE;
104      FEOB: boolean;
105 +    FFirebird25ClientAPI: TFB25ClientAPI;
106    protected
107      procedure CheckReadable; override;
108      procedure CheckWritable; override;
# Line 147 | Line 149 | begin
149    ColName := AnsiUpperCase(GetColumnName);
150    if (ColName <> '') and (RelName <> '') then
151    begin
152 <    with Firebird25ClientAPI do
152 >    with FFirebird25ClientAPI do
153        Call(isc_blob_lookup_desc(StatusVector,@(FAttachment.Handle),
154                                              @(FTransaction.Handle),
155                  PAnsiChar(RelName),PAnsiChar(ColName),@BlobDesc,@Global));
# Line 174 | Line 176 | begin
176    inherited Create(Transaction,RelationName,ColumnName);
177    FAttachment := Attachment;
178    FTransaction := Transaction;
179 +  FFirebird25ClientAPI := Attachment.Firebird25ClientAPI;
180 +  OnDatabaseError := FFirebird25ClientAPI.IBDataBaseError;
181   end;
182  
183   constructor TFB25BlobMetaData.Create(Attachment: TFB25Attachment;
# Line 209 | Line 213 | begin
213    if FHandle = nil then
214      IBError(ibxeBlobNotOpen,[nil]);
215  
216 <  with Firebird25ClientAPI, Response as TBlobInfo do
216 >  with FFirebird25ClientAPI, Response as TBlobInfo do
217      Call(isc_blob_info(StatusVector, @FHandle, Length(Request),@Request,
218                                                 GetBufSize, Buffer));
219   end;
# Line 218 | Line 222 | procedure TFB25Blob.InternalClose(Force:
222   begin
223    if FHandle = nil then
224      Exit;
225 <  with Firebird25ClientAPI do
225 >  with FFirebird25ClientAPI do
226      Call(isc_close_blob(StatusVector, @FHandle), not Force);
227    FHandle := nil;
228   end;
# Line 227 | Line 231 | procedure TFB25Blob.InternalCancel(Force
231   begin
232    if FHandle = nil then
233      Exit;
234 <  with Firebird25ClientAPI do
234 >  with FFirebird25ClientAPI do
235      Call(isc_cancel_blob(StatusVector,@FHandle),not Force);
236    FHandle := nil;
237   end;
# Line 240 | Line 244 | begin
244    inherited Create(Attachment,Transaction,MetaData,BPB);
245    DBHandle := Attachment.Handle;
246    TRHandle := Transaction.Handle;
247 <  with Firebird25ClientAPI do
247 >  FFirebird25ClientAPI := Attachment.Firebird25ClientAPI;
248 >  OnDatabaseError := FFirebird25ClientAPI.IBDataBaseError;
249 >  with FFirebird25ClientAPI do
250    if BPB = nil then
251      Call(isc_create_blob2(StatusVector, @DBHandle, @TRHandle, @FHandle, @FBlobID,
252                             0, nil))
# Line 263 | Line 269 | begin
269    inherited Create(Attachment,Transaction,MetaData,BPB);
270    DBHandle := Attachment.Handle;
271    TRHandle := Transaction.Handle;
272 <  with Firebird25ClientAPI do
272 >  FFirebird25ClientAPI := Attachment.Firebird25ClientAPI;
273 >  OnDatabaseError := FFirebird25ClientAPI.IBDataBaseError;
274 >  with FFirebird25ClientAPI do
275    if BPB = nil then
276      Call(isc_create_blob2(StatusVector, @DBHandle, @TRHandle, @FHandle, @FBlobID,
277                             0, nil))
# Line 281 | Line 289 | begin
289    inherited Create(Attachment,Transaction,MetaData,BlobID,BPB);
290    DBHandle := Attachment.Handle;
291    TRHandle := Transaction.Handle;
292 +  FFirebird25ClientAPI := Attachment.Firebird25ClientAPI;
293 +  OnDatabaseError := FFirebird25ClientAPI.IBDataBaseError;
294    if (BlobID.gds_quad_high = 0) and (BlobID.gds_quad_low = 0) then
295      Exit;
296  
297 <  with Firebird25ClientAPI do
297 >  with FFirebird25ClientAPI do
298    if BPB = nil then
299      Call(isc_open_blob2(StatusVector,  @DBHandle, @TRHandle, @FHandle,
300                       @FBlobID, 0, nil))
# Line 312 | Line 322 | begin
322        localCount := MaxuShort
323      else
324        localCount := Count;
325 <    with Firebird25ClientAPI do
325 >    with FFirebird25ClientAPI do
326        returnCode := isc_get_segment(StatusVector, @FHandle, @BytesRead, localCount,
327                             LocalBuffer);
328      Inc(LocalBuffer,BytesRead);
# Line 323 | Line 333 | begin
333    FEOB := returnCode = isc_segstr_eof;
334    ClearStringCache;
335    if (returnCode <> 0) and (returnCode <> isc_segment) and (returnCode <> isc_segstr_eof) then
336 <    Firebird25ClientAPI.IBDataBaseError
336 >    FFirebird25ClientAPI.IBDataBaseError
337   end;
338  
339   function TFB25Blob.Write(const Buffer; Count: Longint): Longint;
# Line 341 | Line 351 | begin
351        localCount := MaxuShort
352      else
353        localCount := Count;
354 <    with Firebird25ClientAPI do
354 >    with FFirebird25ClientAPI do
355        Call(isc_put_segment(StatusVector,@FHandle,localCount,LocalBuffer));
356      Dec(Count,localCount);
357      Inc(LocalBuffer,localCount);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines