ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/client/FBOutputBlock.pas
(Generate patch)

Comparing:
ibx/trunk/fbintf/client/FBOutputBlock.pas (file contents), Revision 345 by tony, Mon Aug 23 14:22:29 2021 UTC vs.
ibx/branches/journaling/fbintf/client/FBOutputBlock.pas (file contents), Revision 362 by tony, Tue Dec 7 13:27:39 2021 UTC

# Line 49 | Line 49 | const
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
# Line 79 | Line 79 | type
79      procedure FormattedPrint(const aItems: array of POutputBlockItemData;
80        Indent: AnsiString);
81      {$ENDIF}
82    procedure PrintBuf;
82    protected
83      FIntegerType: TItemDataType;
84      FError: boolean;
# Line 87 | Line 86 | type
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;
# Line 106 | Line 106 | type
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;
# Line 117 | Line 118 | type
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;
# Line 484 | Line 485 | begin
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
# Line 636 | Line 648 | begin
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);
# Line 883 | Line 917 | begin
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines