Changeset 97 for oup/rewrite/DataAccess


Ignore:
Timestamp:
Jan 23, 2007, 12:05:45 AM (18 years ago)
Author:
alloc
Message:
 
Location:
oup/rewrite/DataAccess
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • oup/rewrite/DataAccess/ConnectionManager.pas

    r93 r97  
    1818    function GetConnection(ConnectionID: Integer): TDataAccess;
    1919    function GetConnectionByIndex(Index: Integer): TDataAccess;
     20    function GetConnectionIndex(ConnectionID: Integer): Integer;
    2021    procedure RemoveConnection(ArrayIndex: Integer);
    2122  protected
     
    2425    property Connection[ConnectionID: Integer]: TDataAccess read GetConnection;
    2526    property ConnectionByIndex[Index: Integer]: TDataAccess read GetConnectionByIndex;
     27    property ConnectionIndexByID[ConnectionID: Integer]: Integer read GetConnectionIndex;
    2628    property OnCoonnectionListChanged: TConnectionListChangedEvent read FConnectionListChanged write FConnectionListChanged;
    2729
     
    3739
    3840
     41var
     42  ConManager: TConnectionManager;
     43
     44
    3945implementation
    4046uses
     
    4955begin
    5056  Result := Length(FConnections);
     57end;
     58
     59function TConnectionManager.GetConnectionIndex(ConnectionID: Integer): Integer;
     60var
     61  i: Integer;
     62begin
     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;
    5171end;
    5272
     
    240260
    241261
     262initialization
     263  ConManager := TConnectionManager.Create;
     264finalization
     265  ConManager.Free;
    242266end.
  • oup/rewrite/DataAccess/DataAccess.pas

    r93 r97  
    1313    FFileName:      String;
    1414    FBackend:       TDataBackend;
     15    FDataOS:        TDataOS;
    1516    FLevelNumber:   Integer;
    1617    FChangeRights:  TChangeRights;
     18    procedure SetDataOS(DataOS: TDataOS);
    1719  protected
    1820  public
    1921    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;
    2326
    2427    constructor Create(FileName: String; ConnectionID: Integer; var Msg: TStatusMessages); virtual; abstract;
     
    3437
    3538    procedure LoadDatFile(FileID: Integer; var Target: TStream); overload; virtual; abstract;
    36     procedure LoadDatFile(FileID: Integer; var Target: TByteArray); overload; virtual; abstract;
     39    procedure LoadDatFile(FileID: Integer; var Target: TByteData); overload; virtual; abstract;
    3740    procedure UpdateDatFile(FileID: Integer; Src: TStream); overload; virtual; abstract;
    38     procedure UpdateDatFile(FileID: Integer; Src: TByteArray); overload; virtual; abstract;
     41    procedure UpdateDatFile(FileID: Integer; Src: TByteData); overload; virtual; abstract;
    3942    procedure LoadDatFilePart(FileID, Offset, Size: Integer; var Target: TStream); overload; virtual; abstract;
    40     procedure LoadDatFilePart(FileID, Offset, Size: Integer; var Target: TByteArray); overload; virtual; abstract;
     43    procedure LoadDatFilePart(FileID, Offset, Size: Integer; var Target: TByteData); overload; virtual; abstract;
    4144    procedure LoadDatFilePart(FileID, Offset, Size: Integer; Target: Pointer); overload; virtual; abstract;
    4245    procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TStream); overload; virtual; abstract;
    43     procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TByteArray); overload; virtual; abstract;
     46    procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TByteData); overload; virtual; abstract;
    4447    procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: Pointer); overload; virtual; abstract;
    4548
     
    4851
    4952    procedure LoadRawFile(FileID, DatOffset: Integer; var Target: TStream); overload; virtual; abstract;
    50     procedure LoadRawFile(FileID, DatOffset: Integer; var Target: TByteArray); overload; virtual; abstract;
     53    procedure LoadRawFile(FileID, DatOffset: Integer; var Target: TByteData); overload; virtual; abstract;
    5154    procedure UpdateRawFile(FileID, DatOffset, Size: Integer; Src: TStream); overload; virtual; abstract;
    52     procedure UpdateRawFile(FileID, DatOffset, Size: Integer; Src: TByteArray); overload; virtual; abstract;
     55    procedure UpdateRawFile(FileID, DatOffset, Size: Integer; Src: TByteData); overload; virtual; abstract;
    5356    procedure LoadRawFilePart(FileID, DatOffset, Offset, Size: Integer; var Target: TStream); overload; virtual; abstract;
    54     procedure LoadRawFilePart(FileID, DatOffset, Offset, Size: Integer; var Target: TByteArray); overload; virtual; abstract;
     57    procedure LoadRawFilePart(FileID, DatOffset, Offset, Size: Integer; var Target: TByteData); overload; virtual; abstract;
    5558    procedure LoadRawFilePart(FileID, DatOffset, Offset, Size: Integer; Target: Pointer); overload; virtual; abstract;
    5659    procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TStream); overload; virtual; abstract;
    57     procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TByteArray); overload; virtual; abstract;
     60    procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TByteData); overload; virtual; abstract;
    5861    procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: Pointer); overload; virtual; abstract;
    5962
    6063    function AppendRawFile(LocSep: Boolean; Size: Integer; Src: TStream): Integer; overload; virtual; abstract;
    61     function AppendRawFile(LocSep: Boolean; Size: Integer; Src: TByteArray): Integer; overload; virtual; abstract;
     64    function AppendRawFile(LocSep: Boolean; Size: Integer; Src: TByteData): Integer; overload; virtual; abstract;
    6265    function AppendRawFile(LocSep: Boolean; Size: Integer; Src: Pointer): Integer; overload; virtual; abstract;
    6366  published
    6467  end;
    6568
    66 
    67 
    68 
    69 
    70 {
    71 var
    72   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 }
    7969
    8070
     
    158148
    159149
     150procedure TDataAccess.SetDataOS(DataOS: TDataOS);
     151begin
     152  raise ENotImplemented.Create('TDataAccess.SetDataOS: TBD!');
     153end;
    160154
    161155end.
Note: See TracChangeset for help on using the changeset viewer.