49 |
|
DBInfoDefaultBufferSize = DefaultBufferSize; {allow for database page} |
50 |
|
|
51 |
|
type |
52 |
< |
TItemDataType = (dtString, dtString2, dtByte, dtBytes, dtInteger, dtIntegerFixed, dtnone, |
53 |
< |
dtList,dtSpecial, dtDateTime, dtOctetString); |
52 |
> |
TItemDataType = (dtString, dtString2, dtByte, dtBytes, dtInteger, dtIntegerFixed, |
53 |
> |
dtTinyInteger, dtShortIntFixed, dtnone, dtList, dtSpecial, dtDateTime, dtOctetString); |
54 |
|
|
55 |
|
POutputBlockItemData = ^TOutputBlockItemData; |
56 |
|
TOutputBlockItemData = record |
79 |
|
procedure FormattedPrint(const aItems: array of POutputBlockItemData; |
80 |
|
Indent: AnsiString); |
81 |
|
{$ENDIF} |
82 |
– |
procedure PrintBuf; |
82 |
|
protected |
83 |
|
FIntegerType: TItemDataType; |
84 |
|
FError: boolean; |
86 |
|
FItems: array of POutputBlockItemData; |
87 |
|
procedure DoParseBuffer; virtual; abstract; |
88 |
|
function AddItem(BufPtr: PByte): POutputBlockItemData; |
89 |
< |
function AddIntegerItem(BufPtr: PByte): POutputBlockItemData; |
89 |
> |
function AddIntegerItem(BufPtr: PByte; IntType: TItemDataType): POutputBlockItemData; overload; |
90 |
> |
function AddIntegerItem(BufPtr: PByte): POutputBlockItemData; overload; |
91 |
|
function AddStringItem(BufPtr: PByte): POutputBlockItemData; |
92 |
|
function AddShortStringItem(BufPtr: PByte): POutputBlockItemData; |
93 |
|
function AddByteItem(BufPtr: PByte): POutputBlockItemData; |
106 |
|
function GetCount: integer; |
107 |
|
function GetItem(index: integer): POutputBlockItemData; |
108 |
|
function Find(ItemType: byte): POutputBlockItemData; |
109 |
+ |
procedure PrintBuf; |
110 |
|
property Count: integer read GetCount; |
111 |
|
property Items[index: integer]: POutputBlockItemData read getItem; default; |
112 |
|
end; |
118 |
|
FOwner: TOutputBlock; |
119 |
|
FOwnerIntf: IUnknown; |
120 |
|
FItemData: POutputBlockItemData; |
120 |
– |
FFirebirdClientAPI: TFBClientAPI; |
121 |
|
protected |
122 |
+ |
FFirebirdClientAPI: TFBClientAPI; |
123 |
|
function GetItem(index: integer): POutputBlockItemData; |
124 |
|
function Find(ItemType: byte): POutputBlockItemData; |
125 |
|
procedure SetString(out S: AnsiString; Buf: PByte; Len: integer; |
133 |
|
function getItemType: byte; |
134 |
|
function getSize: integer; |
135 |
|
procedure getRawBytes(var Buffer); |
136 |
< |
function getAsInteger: integer; |
136 |
> |
function getAsInteger: int64; |
137 |
|
function getParamType: byte; |
138 |
|
function getAsString: AnsiString; |
139 |
|
function getAsByte: byte; |
226 |
|
function getItemType: byte; |
227 |
|
function getSize: integer; |
228 |
|
function getAsString: AnsiString; |
229 |
< |
function getAsInteger: integer; |
229 |
> |
function getAsInteger: int64; |
230 |
|
end; |
231 |
|
|
232 |
|
ISQLInfoItem = interface(ISQLInfoSubItem) |
270 |
|
function getItemType: byte; |
271 |
|
function getSize: integer; |
272 |
|
function getAsString: AnsiString; |
273 |
< |
function getAsInteger: integer; |
273 |
> |
function getAsInteger: int64; |
274 |
|
end; |
275 |
|
|
276 |
|
IBlobInfo = interface |
476 |
|
Move(FBufPtr^,Buffer,FDatalength); |
477 |
|
end; |
478 |
|
|
479 |
< |
function TOutputBlockItem.getAsInteger: integer; |
479 |
> |
function TOutputBlockItem.getAsInteger: int64; |
480 |
|
var len: integer; |
481 |
|
begin |
482 |
|
with FItemData^ do |
485 |
|
with FFirebirdClientAPI do |
486 |
|
Result := DecodeInteger(FBufPtr+1,4); |
487 |
|
|
488 |
+ |
dtShortIntFixed: |
489 |
+ |
with FFirebirdClientAPI do |
490 |
+ |
Result := DecodeInteger(FBufPtr+1,2); |
491 |
+ |
|
492 |
+ |
dtTinyInteger: |
493 |
+ |
with FFirebirdClientAPI do |
494 |
+ |
begin |
495 |
+ |
len := DecodeInteger(FBufPtr+1,1); |
496 |
+ |
Result := DecodeInteger(FBufPtr+2,len); |
497 |
+ |
end; |
498 |
+ |
|
499 |
|
dtByte, |
500 |
|
dtInteger: |
501 |
|
with FFirebirdClientAPI do |
648 |
|
end; |
649 |
|
end; |
650 |
|
|
651 |
< |
function TOutputBlock.AddIntegerItem(BufPtr: PByte): POutputBlockItemData; |
651 |
> |
function TOutputBlock.AddIntegerItem(BufPtr: PByte; IntType: TItemDataType |
652 |
> |
): POutputBlockItemData; |
653 |
|
begin |
654 |
|
new(Result); |
655 |
|
with Result^ do |
656 |
|
begin |
657 |
< |
FDataType := FIntegerType; |
657 |
> |
FDataType := IntType; |
658 |
|
FBufPtr := BufPtr; |
659 |
< |
if FDataType = dtIntegerFixed then |
660 |
< |
begin |
661 |
< |
FDataLength := 4; |
662 |
< |
FSize := 5; |
663 |
< |
end |
664 |
< |
else |
665 |
< |
begin |
666 |
< |
with FFirebirdClientAPI do |
667 |
< |
FDataLength := DecodeInteger(FBufPtr+1, 2); |
668 |
< |
FSize := FDataLength + 3; |
659 |
> |
case FDataType of |
660 |
> |
dtIntegerFixed: |
661 |
> |
begin |
662 |
> |
FDataLength := 4; |
663 |
> |
FSize := 5; |
664 |
> |
end; |
665 |
> |
|
666 |
> |
dtShortIntFixed: |
667 |
> |
begin |
668 |
> |
FDataLength := 2; |
669 |
> |
FSize := 3; |
670 |
> |
end; |
671 |
> |
|
672 |
> |
dtTinyInteger: |
673 |
> |
begin |
674 |
> |
with FFirebirdClientAPI do |
675 |
> |
FDataLength := DecodeInteger(FBufPtr+1, 1); |
676 |
> |
FSize := FDataLength + 2; |
677 |
> |
end; |
678 |
> |
|
679 |
> |
else |
680 |
> |
begin |
681 |
> |
with FFirebirdClientAPI do |
682 |
> |
FDataLength := DecodeInteger(FBufPtr+1, 2); |
683 |
> |
FSize := FDataLength + 3; |
684 |
> |
end; |
685 |
|
end; |
686 |
|
SetLength(FSubItems,0); |
687 |
|
end; |
688 |
|
end; |
689 |
|
|
690 |
+ |
function TOutputBlock.AddIntegerItem(BufPtr: PByte): POutputBlockItemData; |
691 |
+ |
begin |
692 |
+ |
Result := AddIntegerItem(BufPtr,FIntegerType); |
693 |
+ |
end; |
694 |
+ |
|
695 |
|
function TOutputBlock.AddStringItem(BufPtr: PByte): POutputBlockItemData; |
696 |
|
begin |
697 |
|
new(Result); |
917 |
|
write(classname,': '); |
918 |
|
for i := 0 to getBufSize - 1 do |
919 |
|
begin |
920 |
+ |
if byte(FBuffer[i]) = $FF then break; |
921 |
|
write(Format('%x ',[byte(Buffer[i])])); |
922 |
< |
if byte(FBuffer[i]) = isc_info_end then break; |
922 |
> |
// if byte(FBuffer[i]) = isc_info_end then break; |
923 |
|
end; |
924 |
|
writeln; |
925 |
|
for i := 0 to getBufSize - 1 do |
926 |
|
begin |
927 |
+ |
if byte(FBuffer[i]) = $FF then break; |
928 |
|
if chr(FBuffer[i]) in [' '..'~'] then |
929 |
|
write(chr(Buffer[i])) |
930 |
|
else |
931 |
|
write('.'); |
932 |
< |
if byte(FBuffer[i]) = isc_info_end then break; |
932 |
> |
// if byte(FBuffer[i]) = isc_info_end then break; |
933 |
|
end; |
934 |
|
writeln; |
935 |
|
end; |