Changeset 458 for Generics/NativeGenerics/Units/GenericList.pas
- Timestamp:
- Nov 28, 2012, 7:50:19 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/NativeGenerics/Units/GenericList.pas
r425 r458 95 95 function Get(Index: TIndex): TItem; override; 96 96 function GetInternal(Index: TIndex): TItem; override; 97 function GetCount: TIndex; override; 97 98 function GetCapacity: TIndex; 98 function GetCount: TIndex; override;99 procedure SetCount(const AValue: TIndex); override; 99 100 procedure SetCapacity(const AValue: TIndex); 100 101 procedure SetCapacityOptimized(const NewCapacity: TIndex); 101 procedure SetCount(const AValue: TIndex); override;102 102 procedure Put(Index: TIndex; const AValue: TItem); override; 103 103 procedure PutInternal(Index: TIndex; const AValue: TItem); override; … … 141 141 TGFileList<TItem> = class(TGList<TItem>) 142 142 private 143 FFileName: string; 143 144 FHandle: THandle; 145 FMode: Word; 146 function GetOpenned: Boolean; 147 procedure SetFileName(AValue: string); 148 procedure SetMode(AValue: Word); 144 149 protected 145 150 function GetCount: TIndex; override; … … 150 155 procedure Put(Index: TIndex; const AValue: TItem); override; 151 156 public 152 procedure Open (FileName: string; Mode: Integer);157 procedure Open; 153 158 procedure Close; 154 159 constructor Create; 155 160 destructor Destroy; override; 161 property FileName: string read FFileName write SetFileName; 162 property Mode: Word read FMode write SetMode; 163 property Openned: Boolean read GetOpenned; 156 164 end; 157 165 … … 865 873 { TGFileList<TItem> } 866 874 875 procedure TGFileList<TItem>.SetFileName(AValue: string); 876 begin 877 if FFileName = AValue then Exit; 878 FFileName := AValue; 879 if Openned then begin 880 Close; 881 Open; 882 end; 883 end; 884 885 function TGFileList<TItem>.GetOpenned: Boolean; 886 begin 887 Result := FHandle <> feInvalidHandle; 888 end; 889 890 procedure TGFileList<TItem>.SetMode(AValue: Word); 891 begin 892 if FMode = AValue then Exit; 893 FMode := AValue; 894 if Openned then begin 895 Close; 896 Open; 897 end; 898 end; 899 867 900 function TGFileList<TItem>.GetCount: TIndex; 868 901 var … … 901 934 end; 902 935 903 procedure TGFileList<TItem>.Open (FileName: string; Mode: Integer);936 procedure TGFileList<TItem>.Open; 904 937 begin 905 938 Close;
Note:
See TracChangeset
for help on using the changeset viewer.