Changeset 97 for oup/rewrite/DataAccess
- Timestamp:
- Jan 23, 2007, 12:05:45 AM (18 years ago)
- Location:
- oup/rewrite/DataAccess
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/rewrite/DataAccess/ConnectionManager.pas
r93 r97 18 18 function GetConnection(ConnectionID: Integer): TDataAccess; 19 19 function GetConnectionByIndex(Index: Integer): TDataAccess; 20 function GetConnectionIndex(ConnectionID: Integer): Integer; 20 21 procedure RemoveConnection(ArrayIndex: Integer); 21 22 protected … … 24 25 property Connection[ConnectionID: Integer]: TDataAccess read GetConnection; 25 26 property ConnectionByIndex[Index: Integer]: TDataAccess read GetConnectionByIndex; 27 property ConnectionIndexByID[ConnectionID: Integer]: Integer read GetConnectionIndex; 26 28 property OnCoonnectionListChanged: TConnectionListChangedEvent read FConnectionListChanged write FConnectionListChanged; 27 29 … … 37 39 38 40 41 var 42 ConManager: TConnectionManager; 43 44 39 45 implementation 40 46 uses … … 49 55 begin 50 56 Result := Length(FConnections); 57 end; 58 59 function TConnectionManager.GetConnectionIndex(ConnectionID: Integer): Integer; 60 var 61 i: Integer; 62 begin 63 Result := -1; 64 if Count > 0 then 65 for i := 0 to Count - 1 do 66 if ConnectionByIndex[i].ConnectionID = ConnectionID then 67 begin 68 Result := i; 69 Break; 70 end; 51 71 end; 52 72 … … 240 260 241 261 262 initialization 263 ConManager := TConnectionManager.Create; 264 finalization 265 ConManager.Free; 242 266 end. -
oup/rewrite/DataAccess/DataAccess.pas
r93 r97 13 13 FFileName: String; 14 14 FBackend: TDataBackend; 15 FDataOS: TDataOS; 15 16 FLevelNumber: Integer; 16 17 FChangeRights: TChangeRights; 18 procedure SetDataOS(DataOS: TDataOS); 17 19 protected 18 20 public 19 21 property ConnectionID: Integer read FConnectionID; 20 property FileName: String read FFileName; 21 property Backend: TDataBackend read FBackend; 22 property LevelNumber: Integer read FLevelNumber; 22 property FileName: String read FFileName; 23 property Backend: TDataBackend read FBackend; 24 property DataOS: TDataOS read FDataOS write SetDataOS; 25 property LevelNumber: Integer read FLevelNumber; 23 26 24 27 constructor Create(FileName: String; ConnectionID: Integer; var Msg: TStatusMessages); virtual; abstract; … … 34 37 35 38 procedure LoadDatFile(FileID: Integer; var Target: TStream); overload; virtual; abstract; 36 procedure LoadDatFile(FileID: Integer; var Target: TByte Array); overload; virtual; abstract;39 procedure LoadDatFile(FileID: Integer; var Target: TByteData); overload; virtual; abstract; 37 40 procedure UpdateDatFile(FileID: Integer; Src: TStream); overload; virtual; abstract; 38 procedure UpdateDatFile(FileID: Integer; Src: TByte Array); overload; virtual; abstract;41 procedure UpdateDatFile(FileID: Integer; Src: TByteData); overload; virtual; abstract; 39 42 procedure LoadDatFilePart(FileID, Offset, Size: Integer; var Target: TStream); overload; virtual; abstract; 40 procedure LoadDatFilePart(FileID, Offset, Size: Integer; var Target: TByte Array); overload; virtual; abstract;43 procedure LoadDatFilePart(FileID, Offset, Size: Integer; var Target: TByteData); overload; virtual; abstract; 41 44 procedure LoadDatFilePart(FileID, Offset, Size: Integer; Target: Pointer); overload; virtual; abstract; 42 45 procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TStream); overload; virtual; abstract; 43 procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TByte Array); overload; virtual; abstract;46 procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TByteData); overload; virtual; abstract; 44 47 procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: Pointer); overload; virtual; abstract; 45 48 … … 48 51 49 52 procedure LoadRawFile(FileID, DatOffset: Integer; var Target: TStream); overload; virtual; abstract; 50 procedure LoadRawFile(FileID, DatOffset: Integer; var Target: TByte Array); overload; virtual; abstract;53 procedure LoadRawFile(FileID, DatOffset: Integer; var Target: TByteData); overload; virtual; abstract; 51 54 procedure UpdateRawFile(FileID, DatOffset, Size: Integer; Src: TStream); overload; virtual; abstract; 52 procedure UpdateRawFile(FileID, DatOffset, Size: Integer; Src: TByte Array); overload; virtual; abstract;55 procedure UpdateRawFile(FileID, DatOffset, Size: Integer; Src: TByteData); overload; virtual; abstract; 53 56 procedure LoadRawFilePart(FileID, DatOffset, Offset, Size: Integer; var Target: TStream); overload; virtual; abstract; 54 procedure LoadRawFilePart(FileID, DatOffset, Offset, Size: Integer; var Target: TByte Array); overload; virtual; abstract;57 procedure LoadRawFilePart(FileID, DatOffset, Offset, Size: Integer; var Target: TByteData); overload; virtual; abstract; 55 58 procedure LoadRawFilePart(FileID, DatOffset, Offset, Size: Integer; Target: Pointer); overload; virtual; abstract; 56 59 procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TStream); overload; virtual; abstract; 57 procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TByte Array); overload; virtual; abstract;60 procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TByteData); overload; virtual; abstract; 58 61 procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: Pointer); overload; virtual; abstract; 59 62 60 63 function AppendRawFile(LocSep: Boolean; Size: Integer; Src: TStream): Integer; overload; virtual; abstract; 61 function AppendRawFile(LocSep: Boolean; Size: Integer; Src: TByte Array): Integer; overload; virtual; abstract;64 function AppendRawFile(LocSep: Boolean; Size: Integer; Src: TByteData): Integer; overload; virtual; abstract; 62 65 function AppendRawFile(LocSep: Boolean; Size: Integer; Src: Pointer): Integer; overload; virtual; abstract; 63 66 published 64 67 end; 65 68 66 67 68 69 70 {71 var72 DataConnections: array of TOniData;73 74 function CreateDataConnection(filename: String; backend: Integer): TOniData;75 function ConnectionExists(filename: String): TOniData;76 procedure CloseDataConnection(connection: TOniData);77 function GetEmptyFileInfo: TFileInfo;78 }79 69 80 70 … … 158 148 159 149 150 procedure TDataAccess.SetDataOS(DataOS: TDataOS); 151 begin 152 raise ENotImplemented.Create('TDataAccess.SetDataOS: TBD!'); 153 end; 160 154 161 155 end.
Note:
See TracChangeset
for help on using the changeset viewer.