- Recompilación de RO para poner RemObjects_Core_D10 como paquete de runtime/designtime. git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.RemObjects@3 b6239004-a887-0f4b-9937-50029ccdca16
234 lines
8.1 KiB
ObjectPascal
234 lines
8.1 KiB
ObjectPascal
unit uRODLDelphiConverters;
|
|
|
|
{----------------------------------------------------------------------------}
|
|
{ RemObjects SDK Library - CodeGen2 }
|
|
{ }
|
|
{ compiler: Delphi 5 and up, Kylix 2 and up }
|
|
{ platform: Win32, Linux }
|
|
{ }
|
|
{ (c)opyright RemObjects Software. all rights reserved. }
|
|
{ }
|
|
{ Using this code requires a valid license of the RemObjects SDK }
|
|
{ which can be obtained at http://www.remobjects.com. }
|
|
{----------------------------------------------------------------------------}
|
|
|
|
{$IFDEF LINUX}
|
|
{$I ../RemObjects.inc}
|
|
{$ELSE}
|
|
{$I ..\RemObjects.inc}
|
|
{$ENDIF LINUX}
|
|
|
|
interface
|
|
|
|
uses
|
|
uRODLTemplateBasedConverter,
|
|
uRODLImplConverter, uRODLIntfConverter, uRODLInvkConverter, uRODLAsyncConverter,
|
|
uRODL;
|
|
|
|
type
|
|
TRODLDelphiImplConverter = class(TRODLImplConverter)
|
|
protected
|
|
function GetParamFrontModifier(flag: TRODLParamFlag): string; override;
|
|
function GetTypeIdentifier(const originalType: string): string; override;
|
|
public
|
|
constructor Create(const aLibrary: TRODLLibrary; const aTemplateFileName: string; const aUnitName: string; const aServerClassName: string; const aTargetEntity: string = ''; const aRequiredUnits: string = ''); override;
|
|
end;
|
|
|
|
TRODLDelphiIntfConverter = class(TRODLIntfConverter)
|
|
protected
|
|
function GetParamFrontModifier(flag: TRODLParamFlag): string; override;
|
|
function GetTypeIdentifier(const originalType: string): string; override;
|
|
|
|
function GetServicesSectionClass: TServicesSectionClass; override;
|
|
function GetEventSinksSectionClass: TEventSinksSectionClass; override;
|
|
public
|
|
constructor Create(const aLibrary: TRODLLibrary; const aTemplateFileName: string; const aUnitName: string;
|
|
const ASplit: Boolean = False; const AOutputDir: string = '';
|
|
const AWrapperTemplateName: string = ''; const aTargetEntity: string = ''); override;
|
|
end;
|
|
|
|
TRODLDelphiInvkConverter = class(TRODLInvkConverter)
|
|
protected
|
|
function GetParamFrontModifier(flag: TRODLParamFlag): string; override;
|
|
function GetTypeIdentifier(const originalType: string): string; override;
|
|
public
|
|
constructor Create(const aLibrary: TRODLLibrary; const aTemplateFileName: string; const aUnitName: string;
|
|
const ASplit: Boolean = False; const AOutputDir: string = '';
|
|
const AWrapperTemplateName: string = ''; const aTargetEntity: string = ''); override;
|
|
end;
|
|
|
|
TRODLDelphiAsyncConverter = class(TRODLAsyncConverter)
|
|
protected
|
|
function GetParamFrontModifier(flag: TRODLParamFlag): string; override;
|
|
function GetTypeIdentifier(const originalType: string): string; override;
|
|
|
|
function GetServicesSectionClass: TServicesSectionClass; override;
|
|
public
|
|
constructor Create(const aLibrary: TRODLLibrary; const aTemplateFileName: string; const aUnitName: string;
|
|
const ASplit: Boolean = False; const AOutputDir: string = '';
|
|
const AWrapperTemplateName: string = ''; const aTargetEntity: string = ''); override;
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
uRODLGenTools, uRODLTemplateBasedConverterUtils;
|
|
|
|
type
|
|
TDelphiIntfServicesSection = class (TIntfServicesSection)
|
|
protected
|
|
function GetAncestorName(const aService: TRODLBaseService): string; override;
|
|
end;
|
|
|
|
TDelphiIntfEventSinksSection = class (TIntfEventSinksSection)
|
|
protected
|
|
function GetAncestorName(const aService: TRODLBaseService): string; override;
|
|
end;
|
|
|
|
TDelphiAsyncServicesSection = class (TAsyncServicesSection)
|
|
protected
|
|
function GetAncestorName(const aService: TRODLBaseService): string; override;
|
|
end;
|
|
|
|
|
|
{ TRODLDelphiConverter }
|
|
|
|
constructor TRODLDelphiImplConverter.Create(const aLibrary: TRODLLibrary;
|
|
const aTemplateFileName, aUnitName, aServerClassName, aTargetEntity: string;
|
|
const aRequiredUnits: string);
|
|
begin
|
|
FileExtension := '.pas';
|
|
|
|
inherited Create(aLibrary, aTemplateFileName, aUnitName, aServerClassName, aTargetEntity, aRequiredUnits);
|
|
end;
|
|
|
|
function TRODLDelphiImplConverter.GetParamFrontModifier(
|
|
flag: TRODLParamFlag): string;
|
|
begin
|
|
Result := DelphiFlagNames[Flag];
|
|
end;
|
|
|
|
function TRODLDelphiImplConverter.GetTypeIdentifier(
|
|
const originalType: string): string;
|
|
begin
|
|
Result := CachedDataTypeToDelphiType(originalType, FLibrary);
|
|
end;
|
|
|
|
{ TRODLDelphiIntfConverter }
|
|
|
|
constructor TRODLDelphiIntfConverter.Create(const aLibrary: TRODLLibrary;
|
|
const aTemplateFileName, aUnitName: string;
|
|
const ASplit: Boolean = False; const AOutputDir: string = '';
|
|
const AWrapperTemplateName: string = ''; const aTargetEntity: string = '');
|
|
begin
|
|
FileExtension := '.pas';
|
|
|
|
inherited Create(aLibrary, aTemplateFileName, aUnitName, ASplit, AOutputDir, AWrapperTemplateName, aTargetEntity);
|
|
end;
|
|
|
|
function TRODLDelphiIntfConverter.GetEventSinksSectionClass: TEventSinksSectionClass;
|
|
begin
|
|
Result := TDelphiIntfEventSinksSection;
|
|
end;
|
|
|
|
function TRODLDelphiIntfConverter.GetParamFrontModifier(
|
|
flag: TRODLParamFlag): string;
|
|
begin
|
|
Result := DelphiFlagNames[Flag];
|
|
end;
|
|
|
|
function TRODLDelphiIntfConverter.GetServicesSectionClass: TServicesSectionClass;
|
|
begin
|
|
Result := TDelphiIntfServicesSection;
|
|
end;
|
|
|
|
function TRODLDelphiIntfConverter.GetTypeIdentifier(
|
|
const originalType: string): string;
|
|
begin
|
|
Result := CachedDataTypeToDelphiType(originalType, FLibrary);
|
|
end;
|
|
|
|
{ TRODLDelphiInvkConverter }
|
|
|
|
constructor TRODLDelphiInvkConverter.Create(const aLibrary: TRODLLibrary;
|
|
const aTemplateFileName, aUnitName: string; const ASplit: Boolean = False;
|
|
const AOutputDir: string = ''; const AWrapperTemplateName: string = '';
|
|
const aTargetEntity: string = '');
|
|
begin
|
|
FileExtension := '.pas';
|
|
|
|
inherited Create(aLibrary, aTemplateFileName, aUnitName, ASplit, AOutputDir, AWrapperTemplateName, aTargetEntity);
|
|
end;
|
|
|
|
function TRODLDelphiInvkConverter.GetParamFrontModifier(
|
|
flag: TRODLParamFlag): string;
|
|
begin
|
|
Result := DelphiFlagNames[Flag];
|
|
end;
|
|
|
|
function TRODLDelphiInvkConverter.GetTypeIdentifier(
|
|
const originalType: string): string;
|
|
begin
|
|
Result := CachedDataTypeToDelphiType(originalType, FLibrary);
|
|
end;
|
|
|
|
{ TDelphiIntfServicesSection }
|
|
|
|
function TDelphiIntfServicesSection.GetAncestorName(
|
|
const aService: TRODLBaseService): string;
|
|
begin
|
|
Result := inherited GetAncestorName(aService);
|
|
if Length(Result) > 0 then
|
|
Result := '(' + Result + ')';
|
|
end;
|
|
|
|
{ TDelphiIntfEventSinksSection }
|
|
|
|
function TDelphiIntfEventSinksSection.GetAncestorName(
|
|
const aService: TRODLBaseService): string;
|
|
begin
|
|
Result := inherited GetAncestorName(aService);
|
|
if Length(Result) > 0 then
|
|
Result := '(' + Result + ')';
|
|
end;
|
|
|
|
{ TRODLDelphiAsyncConverter }
|
|
|
|
constructor TRODLDelphiAsyncConverter.Create(const aLibrary: TRODLLibrary;
|
|
const aTemplateFileName, aUnitName: string; const ASplit: Boolean;
|
|
const AOutputDir, AWrapperTemplateName, aTargetEntity: string);
|
|
begin
|
|
FileExtension := '.pas';
|
|
|
|
inherited Create(aLibrary, aTemplateFileName, aUnitNAme, ASplit, AOutputDir, AWrapperTemplateName, aTargetEntity);
|
|
end;
|
|
|
|
function TRODLDelphiAsyncConverter.GetParamFrontModifier(
|
|
flag: TRODLParamFlag): string;
|
|
begin
|
|
Result := DelphiFlagNames[Flag];
|
|
end;
|
|
|
|
function TRODLDelphiAsyncConverter.GetServicesSectionClass: TServicesSectionClass;
|
|
begin
|
|
Result := TDelphiAsyncServicesSection;
|
|
end;
|
|
|
|
function TRODLDelphiAsyncConverter.GetTypeIdentifier(
|
|
const originalType: string): string;
|
|
begin
|
|
Result := CachedDataTypeToDelphiType(originalType, FLibrary);
|
|
end;
|
|
|
|
{ TDelphiAsyncServicesSection }
|
|
|
|
function TDelphiAsyncServicesSection.GetAncestorName(
|
|
const aService: TRODLBaseService): string;
|
|
begin
|
|
Result := inherited GetAncestorName(aService);
|
|
if Length(Result) > 0 then
|
|
Result := '(' + Result + ')';
|
|
end;
|
|
|
|
end.
|