79 |
|
{ TFB25Status } |
80 |
|
|
81 |
|
TFB25Status = class(TFBStatus,IStatus) |
82 |
+ |
protected |
83 |
+ |
function GetIBMessage: Ansistring; override; |
84 |
|
public |
85 |
|
function StatusVector: PStatusVector; override; |
86 |
|
end; |
166 |
|
isc_prepare_transaction: Tisc_prepare_transaction; |
167 |
|
isc_version: Tisc_Version; |
168 |
|
isc_interprete: Tisc_interprete; |
169 |
+ |
fb_interpret: Tfb_interpret; |
170 |
|
|
171 |
|
public |
172 |
|
{Helper Functions} |
176 |
|
function SQLDecodeTime(bufptr: PByte): TDateTime; override; |
177 |
|
procedure SQLEncodeDateTime(aDateTime: TDateTime; bufptr: PByte); override; |
178 |
|
function SQLDecodeDateTime(bufptr: PByte): TDateTime; override; |
176 |
– |
function FormatStatus(Status: TFBStatus): AnsiString; override; |
179 |
|
public |
180 |
|
{IFirebirdAPI} |
181 |
|
|
323 |
|
|
324 |
|
{ TFB25ActivityReporter } |
325 |
|
|
326 |
+ |
function TFB25Status.GetIBMessage: Ansistring; |
327 |
+ |
var psb: PStatusVector; |
328 |
+ |
local_buffer: array[0..IBHugeLocalBufferLength - 1] of AnsiChar; |
329 |
+ |
begin |
330 |
+ |
psb := StatusVector; |
331 |
+ |
Result := ''; |
332 |
+ |
with FOwner as TFB25ClientAPI do |
333 |
+ |
if assigned(fb_interpret) then |
334 |
+ |
begin |
335 |
+ |
if fb_interpret(@local_buffer,sizeof(local_buffer),@psb) > 0 then |
336 |
+ |
Result := strpas(local_buffer); |
337 |
+ |
end |
338 |
+ |
else |
339 |
+ |
if assigned(isc_interprete) then |
340 |
+ |
while isc_interprete(@local_buffer,@psb) > 0 do |
341 |
+ |
begin |
342 |
+ |
if (Result <> '') and (Result[Length(Result)] <> LF) then |
343 |
+ |
Result := Result + LineEnding + '-'; |
344 |
+ |
Result := Result + strpas(local_buffer); |
345 |
+ |
end; |
346 |
+ |
end; |
347 |
+ |
|
348 |
|
function TFB25Status.StatusVector: PStatusVector; |
349 |
|
begin |
350 |
|
Result := @FStatusVector; |
409 |
|
isc_prepare_transaction := GetProcAddr('isc_prepare_transaction'); {do not localize} |
410 |
|
isc_version := GetProcAddr('isc_version'); {do not localize} |
411 |
|
isc_interprete := GetProcAddr('isc_interprete'); {do not localize} |
412 |
+ |
fb_interpret := GetProcAddr('fb_interpret'); {do not localize} |
413 |
|
|
414 |
|
FIBServiceAPIPresent := true; |
415 |
|
isc_rollback_retaining := GetProcAddress(FFBLibrary.IBLibrary, 'isc_rollback_retaining'); {do not localize} |
695 |
|
end; |
696 |
|
end; |
697 |
|
|
673 |
– |
function TFB25ClientAPI.FormatStatus(Status: TFBStatus): AnsiString; |
674 |
– |
var psb: PStatusVector; |
675 |
– |
local_buffer: array[0..IBHugeLocalBufferLength - 1] of AnsiChar; |
676 |
– |
begin |
677 |
– |
psb := Status.StatusVector; |
678 |
– |
Result := ''; |
679 |
– |
while isc_interprete(@local_buffer,@psb) > 0 do |
680 |
– |
begin |
681 |
– |
if (Result <> '') and (Result[Length(Result)] <> LF) then |
682 |
– |
Result := Result + LineEnding + '-'; |
683 |
– |
Result := Result + strpas(local_buffer); |
684 |
– |
end; |
685 |
– |
end; |
686 |
– |
|
698 |
|
end. |
699 |
|
|
700 |
|
|