unit TMS.ServerWizard.Types;

{$I bcl.inc}

interface

{$IFDEF DELPHIXE2_LVL}

uses
  System.Generics.Collections;

type
  TServerKind = (skSparkle, skXData, skRemoteDB, skStandAloneConnModule);
  TProjectKind = (pkVCL, pkFMX, pkService, pkConsole);
  TProjectKinds = set of TProjectKind;

  // For replacing strings inside the templates
  TIdentifierMap = TDictionary<string, string>; // From -> To

  function ServerKindToString(const Kind : TServerKind) : string;
  function ProjectKindToString(const Kind : TProjectKind) : string;

resourcestring
  strMyCustomCategory = 'TMS Business';
  strAuthor = 'TMS Software';
  strComment = 'Creates a TMS %s server'; // Eg, 'Creates a TMS Sparkle server'
  strName = 'TMS %s Server Application'; // Eg, 'TMS Sparkle Server'
  strIDString = 'TMS.Software.%s'; // Eg, 'TMS.Software.Sparkle'

{$ENDIF}

implementation

{$IFDEF DELPHIXE2_LVL}

function ServerKindToString(const Kind : TServerKind) : string;
begin
  Result := 'ERROR';
  case Kind of
    TServerKind.skSparkle: Result := 'Sparkle';
    TServerKind.skXData: Result := 'XData';
    TServerKind.skRemoteDB: Result := 'RemoteDB';
    TServerKind.skStandAloneConnModule : Result := 'Connection';
  end;
end;

function ProjectKindToString(const Kind : TProjectKind) : string;
begin
  Result := 'ERROR';
  case Kind of
    TProjectKind.pkVCL: Result := 'VCL';
    TProjectKind.pkFMX: Result := 'FMX';
    TProjectKind.pkService: Result := 'Service';
    TProjectKind.pkConsole: Result := 'Console';
  end;
end;

{$ENDIF}

end.
