Changeset 241 for oup/current/FileClasses/_DataTypes.pas
- Timestamp:
- Jul 18, 2007, 12:27:16 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/FileClasses/_DataTypes.pas
r240 r241 10 10 11 11 TDataField = class(TTreeElement) 12 function GetChildCount: Integer; override;13 function GetChild(ID: Integer): TTreeElement; override;14 function GetCaption: String; override;15 12 protected 16 13 FOffset: Integer; 17 14 FName: String; 15 FType: String; 18 16 FDescription: String; 19 17 FDataLength: Integer; … … 22 20 FChanged: Boolean; 23 21 FExtraArgs: array of TVarRec; 22 function GetChildCount: Integer; override; 23 function GetChild(ID: Integer): TTreeElement; override; 24 function GetCaption: String; override; 25 function GetType: String; override; 24 26 function GetValueAsString: String; virtual; 25 27 public … … 47 49 48 50 TBlock = class(TContainer) 49 pr ivate51 protected 50 52 FDataFields: array of TDataField; 51 53 function GetChildCount: Integer; override; … … 67 69 68 70 TInt = class(TDataField) 69 pr ivate71 protected 70 72 FInt: Integer; 71 73 function GetValueAsString: String; override; … … 80 82 81 83 TFloat = class(TDataField) 82 pr ivate84 protected 83 85 FFloat: Single; 84 86 function GetValueAsString: String; override; … … 93 95 94 96 TBitSet = class(TDataField) 95 pr ivate97 protected 96 98 FBits: Byte; 97 99 FNames: TStringList; … … 107 109 108 110 TLevelID = class(TDataField) 109 pr ivate111 protected 110 112 FLevelID: Integer; 111 113 function GetValueAsString: String; override; … … 120 122 121 123 TFileID = class(TDataField) 122 pr ivate124 protected 123 125 FFileID: Integer; 124 126 function GetValueAsString: String; override; … … 133 135 134 136 TDatLink = class(TDataField) 135 private 137 protected 138 FPosExts: String; 136 139 function GetTarget: TObject; virtual; abstract; 137 140 public 141 property PosExts: String read FPosExts; 138 142 property TargetFile: TObject read GetTarget; 139 143 end; … … 141 145 142 146 TLinkByID = class(TDatLink) 147 protected 148 FFileID: Integer; 143 149 function GetChildCount: Integer; override; 144 150 function GetChild(ID: Integer): TTreeElement; override; 145 private146 FFileID: Integer;147 FPosExts: String;148 151 function GetValueAsString: String; override; 149 152 function GetTarget: TObject; override; … … 158 161 159 162 TString = class(TDataField) 160 pr ivate163 protected 161 164 FString: String; 162 165 function GetValueAsString: String; override; … … 171 174 172 175 TArray = class(TContainer) 173 pr ivate176 protected 174 177 FDataFields: array of TBlock; 175 178 FTemplate: TBlock; … … 197 200 198 201 TRawLink = class(TDataField) 199 pr ivate202 protected 200 203 FRawAddress: Integer; 204 FRawType: String; 205 FSep: Boolean; 201 206 function GetValueAsString: String; override; 202 207 public 203 // ExtraArgs: keine 204 constructor Create(ParentFile: TObject; ParentBlock: TContainer; 205 Name, Description: String; ExtraArgs: array of const); override; 206 procedure Update(Offset, Length: Integer); override; 207 procedure WriteData(stream: TStream); override; 208 // ExtraArgs: String: RawType; Bool: Sep 209 constructor Create(ParentFile: TObject; ParentBlock: TContainer; 210 Name, Description: String; ExtraArgs: array of const); override; 211 procedure Update(Offset, Length: Integer); override; 212 procedure WriteData(stream: TStream); override; 213 214 property RawType: String read FRawType; 208 215 end; 209 216 210 217 211 218 TUnused = class(TDataField) 212 pr ivate219 protected 213 220 function GetValueAsString: String; override; 214 221 public … … 268 275 end; 269 276 277 function TDataField.GetType: String; 278 begin 279 Result := FType; 280 end; 281 270 282 function TDataField.GetValueAsString: String; 271 283 begin … … 280 292 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 281 293 FDataLength := ExtraArgs[0].VInteger; 294 FType := 'String[' + IntToStr(FDataLength) + ']'; 282 295 end; 283 296 … … 325 338 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 326 339 FDataLength := ExtraArgs[0].VInteger; 340 FType := 'Int' + IntToStr(FDataLength * 8); 327 341 FInt := 0; 328 342 end; … … 364 378 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 365 379 FCounterSize := ExtraArgs[0].VInteger; 380 FType := ''; 366 381 if Length(ExtraArgs) = 2 then 367 382 FBlockCount := ExtraArgs[1].VInteger … … 521 536 begin 522 537 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 538 FType := ''; 523 539 end; 524 540 … … 593 609 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 594 610 FDataLength := 4; 611 FType := 'LevelID'; 595 612 FLevelID := 0; 596 613 end; … … 628 645 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 629 646 FDataLength := 4; 647 FType := 'FileID'; 630 648 FFileID := -1; 631 649 end; … … 673 691 vtAnsiString: FPosExts := String(ExtraArgs[0].VAnsiString); 674 692 end; 693 FType := 'LinkByID(' + FPosExts + ')'; 675 694 FFileID := -1; 676 695 end; … … 740 759 begin 741 760 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 761 case ExtraArgs[0].VType of 762 vtChar: FRawType := ExtraArgs[0].VChar; 763 vtAnsiString: FRawType := String(ExtraArgs[0].VAnsiString); 764 end; 765 if Length(ExtraArgs) > 1 then 766 FSep := ExtraArgs[1].VBoolean; 767 FType := 'RawLink(' + FRawType + ')'; 742 768 FDataLength := 4; 743 769 end; … … 774 800 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 775 801 FDataLength := ExtraArgs[0].VInteger; 802 FType := 'Unused'; 776 803 end; 777 804 … … 813 840 end; 814 841 FDataLength := 1; 842 FType := 'BitSet'; 815 843 FBits := 0; 816 844 end; … … 854 882 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 855 883 FDataLength := 4; 884 FType := 'Float'; 856 885 FFloat := 0; 857 886 end;
Note:
See TracChangeset
for help on using the changeset viewer.