Ignore:
Timestamp:
Feb 13, 2012, 9:47:18 AM (13 years ago)
Author:
chronos
Message:
  • Added: List of supported compiler targets.
  • Added: Action to compile and run project.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/UCompiler.pas

    r20 r25  
    66
    77uses
    8   Classes, SysUtils, StrUtils;
     8  Classes, SysUtils, StrUtils, Registry, URegistry, SpecializedList;
    99
    1010type
     
    2323    Output: string;
    2424    Optimization: TCompilerOptimization;
     25    CompilerPath: string;
     26    SourceExtension: string;
     27    CompiledExtension: string;
    2528    constructor Create; virtual;
    2629    procedure OptimizeSource;
     
    2831  end;
    2932
     33  { TCompilerList }
     34
     35  TCompilerList = class(TListObject)
     36    procedure LoadFromRegistry(Root: HKEY; Key: string);
     37    procedure SaveToRegistry(Root: HKEY; Key: string);
     38  end;
     39
    3040
    3141implementation
     42
     43{ TCompilerList }
     44
     45procedure TCompilerList.LoadFromRegistry(Root: HKEY; Key: string);
     46var
     47  I: Integer;
     48begin
     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;
     59end;
     60
     61procedure TCompilerList.SaveToRegistry(Root: HKEY; Key: string);
     62var
     63  I: Integer;
     64begin
     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;
     76end;
    3277
    3378{ TBrainFuckCompiler }
Note: See TracChangeset for help on using the changeset viewer.