Changeset 25 for trunk/Compiler/UCompiler.pas
- Timestamp:
- Feb 13, 2012, 9:47:18 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/UCompiler.pas
r20 r25 6 6 7 7 uses 8 Classes, SysUtils, StrUtils ;8 Classes, SysUtils, StrUtils, Registry, URegistry, SpecializedList; 9 9 10 10 type … … 23 23 Output: string; 24 24 Optimization: TCompilerOptimization; 25 CompilerPath: string; 26 SourceExtension: string; 27 CompiledExtension: string; 25 28 constructor Create; virtual; 26 29 procedure OptimizeSource; … … 28 31 end; 29 32 33 { TCompilerList } 34 35 TCompilerList = class(TListObject) 36 procedure LoadFromRegistry(Root: HKEY; Key: string); 37 procedure SaveToRegistry(Root: HKEY; Key: string); 38 end; 39 30 40 31 41 implementation 42 43 { TCompilerList } 44 45 procedure TCompilerList.LoadFromRegistry(Root: HKEY; Key: string); 46 var 47 I: Integer; 48 begin 49 with TRegistryEx.Create do 50 try 51 RootKey := Root; 52 OpenKey(Key + '\Compiler', True); 53 for I := 0 to Count - 1 do 54 with TBrainFuckCompiler(Items[I]) do 55 if ValueExists(Name) then CompilerPath := ReadString(Name); 56 finally 57 Free; 58 end; 59 end; 60 61 procedure TCompilerList.SaveToRegistry(Root: HKEY; Key: string); 62 var 63 I: Integer; 64 begin 65 with TRegistryEx.Create do 66 try 67 RootKey := Root; 68 OpenKey(Key + '\Compiler', True); 69 for I := 0 to Count - 1 do 70 with TBrainFuckCompiler(Items[I]) do 71 if CompilerPath <> '' then WriteString(Name, CompilerPath) 72 else DeleteValue(Name); 73 finally 74 Free; 75 end; 76 end; 32 77 33 78 { TBrainFuckCompiler }
Note:
See TracChangeset
for help on using the changeset viewer.