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

Comparing ibx/trunk/fbintf/client/FBArray.pas (file contents):
Revision 56 by tony, Mon Mar 6 10:20:02 2017 UTC vs.
Revision 291 by tony, Fri Apr 17 10:26:08 2020 UTC

# Line 108 | Line 108 | type
108    protected
109     FArrayDesc: TISC_ARRAY_DESC;
110     FCharSetID: integer;
111 +   FAttachment: IAttachment;
112     procedure LoadMetaData(aAttachment: IAttachment; aTransaction: ITransaction;
113                 relationName, columnName: AnsiString); virtual; abstract;
114     function NumOfElements: integer;
115    public
116     constructor Create(aAttachment: IAttachment; aTransaction: ITransaction;
117       relationName, columnName: AnsiString); overload;
118 <   constructor Create(SQLType: cardinal; tableName: AnsiString; columnName: AnsiString;
118 >   constructor Create(aAttachment: IAttachment;SQLType: cardinal; tableName: AnsiString; columnName: AnsiString;
119       Scale: integer; size: cardinal; charSetID: cardinal;
120       dimensions: cardinal; bounds: TArrayBounds); overload;
121     function GetCodePage: TSystemCodePage; virtual; abstract;
# Line 137 | Line 138 | type
138  
139    TFBArray = class(TActivityReporter,IArray)
140    private
141 +    FFirebirdClientAPI: TFBClientAPI;
142      FMetaData: IArrayMetaData;
143      FIsNew: boolean;
144      FLoaded: boolean;
# Line 159 | Line 161 | type
161      FBufSize: ISC_LONG;
162      FArrayID: TISC_QUAD;
163      procedure AllocateBuffer; virtual;
164 <    procedure Changing;
165 <    procedure Changed;
164 >    procedure Changing; virtual;
165 >    procedure Changed;  virtual;
166      function GetArrayDesc: PISC_ARRAY_DESC;
167      procedure InternalGetSlice; virtual; abstract;
168      procedure InternalPutSlice(Force: boolean); virtual; abstract;
# Line 273 | Line 275 | end;
275  
276   constructor TFBArrayElement.Create(anArray: TFBArray; P: PByte);
277   begin
278 <  inherited Create;
278 >  inherited Create(anArray.FFirebirdClientAPI);
279    FArray := anArray;
280    FBufPtr := P;
281   end;
# Line 398 | Line 400 | begin
400      if trim(Value) = '' then
401        SetAsInt64(0)
402      else
403 <      SetAsInt64(StrToInt(Value));
403 >      SetAsInt64(AdjustScaleFromCurrency(StrToCurr(Value),GetScale));
404  
405    SQL_D_FLOAT,
406    SQL_DOUBLE,
# Line 486 | Line 488 | constructor TFBArrayMetaData.Create(aAtt
488    aTransaction: ITransaction; relationName, columnName: AnsiString);
489   begin
490    inherited Create;
491 +  FAttachment := aAttachment;
492    LoadMetaData(aAttachment,aTransaction,relationName, columnName);
493   end;
494  
495 < constructor TFBArrayMetaData.Create(SQLType: cardinal; tableName: AnsiString;
496 <  columnName: AnsiString; Scale: integer; size: cardinal; charSetID: cardinal;
497 <  dimensions: cardinal; bounds: TArrayBounds);
495 > constructor TFBArrayMetaData.Create(aAttachment: IAttachment;
496 >  SQLType: cardinal; tableName: AnsiString; columnName: AnsiString;
497 >  Scale: integer; size: cardinal; charSetID: cardinal; dimensions: cardinal;
498 >  bounds: TArrayBounds);
499   var i: integer;
500   begin
501    inherited Create;
502 +  FAttachment := aAttachment;
503    with FArrayDesc do
504    begin
505      array_desc_dtype := GetDType(SQLType);
# Line 652 | Line 657 | begin
657      end;
658      FBufSize := FElementSize * l;
659  
660 <    with FirebirdClientAPI do
660 >    with FFirebirdClientAPI do
661        IBAlloc(FBuffer,0,FBufSize);
662  
663      Dims := GetDimensions;
# Line 741 | Line 746 | begin
746    inherited Create(aTransaction);
747    FMetaData := aField;
748    FAttachment := aAttachment;
749 +  FFirebirdClientAPI := aTransaction.FirebirdAPI;
750    FTransactionIntf :=  aTransaction;
751    FTransactionSeqNo := aTransaction.TransactionSeqNo;
752    FIsNew := true;
# Line 759 | Line 765 | begin
765    FMetaData := aField;
766    FArrayID := ArrayID;
767    FAttachment := aAttachment;
768 +  FFirebirdClientAPI := aTransaction.FirebirdAPI;
769    FTransactionIntf :=  aTransaction;
770    FTransactionSeqNo := aTransaction.TransactionSeqNo;
771    FIsNew := false;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines