You've already forked lazarus-ccr
Preparing Type name and Element disambiguation
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@950 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -50,7 +50,7 @@ type
|
|||||||
{$IFNDEF WST_HAS_TTIMEREMOTABLE}
|
{$IFNDEF WST_HAS_TTIMEREMOTABLE}
|
||||||
time = type string;
|
time = type string;
|
||||||
{$ENDIF WST_HAS_TTIMEREMOTABLE}
|
{$ENDIF WST_HAS_TTIMEREMOTABLE}
|
||||||
|
|
||||||
TScopeType = Integer;
|
TScopeType = Integer;
|
||||||
TArrayStyle = ( asScoped, asEmbeded, asNone );
|
TArrayStyle = ( asScoped, asEmbeded, asNone );
|
||||||
TInstanceOption = ( ioAlwaysSerialize );
|
TInstanceOption = ( ioAlwaysSerialize );
|
||||||
@ -76,7 +76,7 @@ type
|
|||||||
|
|
||||||
EServiceConfigException = class(EServiceException)
|
EServiceConfigException = class(EServiceException)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ETypeRegistryException = class(EServiceConfigException)
|
ETypeRegistryException = class(EServiceConfigException)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ type
|
|||||||
End;
|
End;
|
||||||
|
|
||||||
TSerializationStyle = ( ssNodeSerialization, ssAttibuteSerialization );
|
TSerializationStyle = ( ssNodeSerialization, ssAttibuteSerialization );
|
||||||
|
|
||||||
IFormatterBase = Interface
|
IFormatterBase = Interface
|
||||||
['{2AB3BF54-B7D6-4C46-8245-133C8775E9C1}']
|
['{2AB3BF54-B7D6-4C46-8245-133C8775E9C1}']
|
||||||
function GetPropertyManager():IPropertyManager;
|
function GetPropertyManager():IPropertyManager;
|
||||||
@ -219,7 +219,7 @@ type
|
|||||||
function ReadBuffer(const AName : string; out AResBuffer : string) : Boolean;
|
function ReadBuffer(const AName : string; out AResBuffer : string) : Boolean;
|
||||||
//Please use this method if and _only_ if you do not have another way achieve your aim!
|
//Please use this method if and _only_ if you do not have another way achieve your aim!
|
||||||
procedure WriteBuffer(const AValue : string);
|
procedure WriteBuffer(const AValue : string);
|
||||||
|
|
||||||
procedure SaveToStream(AStream : TStream);
|
procedure SaveToStream(AStream : TStream);
|
||||||
procedure LoadFromStream(AStream : TStream);
|
procedure LoadFromStream(AStream : TStream);
|
||||||
|
|
||||||
@ -383,6 +383,7 @@ type
|
|||||||
class function ToStr(const ADate : TDateTime):string;overload;
|
class function ToStr(const ADate : TDateTime):string;overload;
|
||||||
class function ToStr(const ADate : TDateTimeRec):string;overload;virtual;abstract;
|
class function ToStr(const ADate : TDateTimeRec):string;overload;virtual;abstract;
|
||||||
class function Parse(const ABuffer : string):TDateTimeRec;virtual;abstract;
|
class function Parse(const ABuffer : string):TDateTimeRec;virtual;abstract;
|
||||||
|
class function ParseToUTC(const ABuffer : string):TDateTime;
|
||||||
|
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
function Equal(const ACompareTo : TBaseRemotable) : Boolean;override;
|
function Equal(const ACompareTo : TBaseRemotable) : Boolean;override;
|
||||||
@ -403,8 +404,8 @@ type
|
|||||||
public
|
public
|
||||||
class function ToStr(const ADate : TDateTimeRec):string;override;
|
class function ToStr(const ADate : TDateTimeRec):string;override;
|
||||||
class function Parse(const ABuffer : string):TDateTimeRec;override;
|
class function Parse(const ABuffer : string):TDateTimeRec;override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TDateTimeRemotable }
|
{ TDateTimeRemotable }
|
||||||
|
|
||||||
TDateTimeRemotable = class(TBaseDateRemotable)
|
TDateTimeRemotable = class(TBaseDateRemotable)
|
||||||
@ -417,7 +418,7 @@ type
|
|||||||
property Minute : Integer index 4 read GetDatepart;
|
property Minute : Integer index 4 read GetDatepart;
|
||||||
property Second : Integer index 5 read GetDatepart;
|
property Second : Integer index 5 read GetDatepart;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TDurationRemotable }
|
{ TDurationRemotable }
|
||||||
|
|
||||||
TDurationRemotable = class(TAbstractSimpleRemotable)
|
TDurationRemotable = class(TAbstractSimpleRemotable)
|
||||||
@ -507,7 +508,7 @@ type
|
|||||||
property Data : TTimeRec read FData write FData;
|
property Data : TTimeRec read FData write FData;
|
||||||
property AsString : string read GetAsString write SetAsString;
|
property AsString : string read GetAsString write SetAsString;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TAbstractComplexRemotableClass = class of TAbstractComplexRemotable;
|
TAbstractComplexRemotableClass = class of TAbstractComplexRemotable;
|
||||||
|
|
||||||
{ TAbstractComplexRemotable }
|
{ TAbstractComplexRemotable }
|
||||||
@ -546,7 +547,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TRemotableRecordEncoderClass = class of TRemotableRecordEncoder;
|
TRemotableRecordEncoderClass = class of TRemotableRecordEncoder;
|
||||||
|
|
||||||
{ TRemotableRecordEncoder }
|
{ TRemotableRecordEncoder }
|
||||||
|
|
||||||
TRemotableRecordEncoder = class(TPersistent)
|
TRemotableRecordEncoder = class(TPersistent)
|
||||||
@ -564,7 +565,7 @@ type
|
|||||||
const ATypeInfo : PTypeInfo
|
const ATypeInfo : PTypeInfo
|
||||||
);virtual;
|
);virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TBaseComplexSimpleContentRemotable }
|
{ TBaseComplexSimpleContentRemotable }
|
||||||
|
|
||||||
TBaseComplexSimpleContentRemotable = class(TAbstractComplexRemotable)
|
TBaseComplexSimpleContentRemotable = class(TAbstractComplexRemotable)
|
||||||
@ -599,7 +600,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ TComplexInt8SContentRemotable }
|
{ TComplexInt8SContentRemotable }
|
||||||
|
|
||||||
TComplexInt8SContentRemotable = class(TBaseComplexSimpleContentRemotable)
|
TComplexInt8SContentRemotable = class(TBaseComplexSimpleContentRemotable)
|
||||||
private
|
private
|
||||||
FValue: ShortInt;
|
FValue: ShortInt;
|
||||||
@ -631,7 +632,7 @@ type
|
|||||||
public
|
public
|
||||||
property Value : Word read FValue write FValue;
|
property Value : Word read FValue write FValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TComplexInt32SContentRemotable }
|
{ TComplexInt32SContentRemotable }
|
||||||
|
|
||||||
TComplexInt32SContentRemotable = class(TBaseComplexSimpleContentRemotable)
|
TComplexInt32SContentRemotable = class(TBaseComplexSimpleContentRemotable)
|
||||||
@ -655,7 +656,7 @@ type
|
|||||||
public
|
public
|
||||||
property Value : LongWord read FValue write FValue;
|
property Value : LongWord read FValue write FValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TComplexInt64SContentRemotable }
|
{ TComplexInt64SContentRemotable }
|
||||||
|
|
||||||
TComplexInt64SContentRemotable = class(TBaseComplexSimpleContentRemotable)
|
TComplexInt64SContentRemotable = class(TBaseComplexSimpleContentRemotable)
|
||||||
@ -823,7 +824,7 @@ type
|
|||||||
public
|
public
|
||||||
property Value : Boolean read FValue write FValue;
|
property Value : Boolean read FValue write FValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
THeaderBlockClass = class of THeaderBlock;
|
THeaderBlockClass = class of THeaderBlock;
|
||||||
|
|
||||||
{ THeaderBlock }
|
{ THeaderBlock }
|
||||||
@ -1453,7 +1454,7 @@ type
|
|||||||
property Intf : IInterface read FIntf;
|
property Intf : IInterface read FIntf;
|
||||||
property Used : Boolean read FUsed write FUsed;
|
property Used : Boolean read FUsed write FUsed;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TIntfPool = class
|
TIntfPool = class
|
||||||
private
|
private
|
||||||
FList : TObjectList;
|
FList : TObjectList;
|
||||||
@ -1478,7 +1479,7 @@ type
|
|||||||
property Min : PtrInt read FMin;
|
property Min : PtrInt read FMin;
|
||||||
property Max : PtrInt read FMax;
|
property Max : PtrInt read FMax;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSimpleItemFactoryEx }
|
{ TSimpleItemFactoryEx }
|
||||||
|
|
||||||
TSimpleItemFactoryEx = class(TSimpleItemFactory,IInterface,IItemFactory,IItemFactoryEx)
|
TSimpleItemFactoryEx = class(TSimpleItemFactory,IInterface,IItemFactory,IItemFactoryEx)
|
||||||
@ -1522,7 +1523,7 @@ type
|
|||||||
TTypeRegistry = class;
|
TTypeRegistry = class;
|
||||||
TTypeRegistryItem = class;
|
TTypeRegistryItem = class;
|
||||||
TTypeRegistryItemClass = class of TTypeRegistryItem;
|
TTypeRegistryItemClass = class of TTypeRegistryItem;
|
||||||
|
|
||||||
TRemotableTypeInitializerClass = class of TRemotableTypeInitializer;
|
TRemotableTypeInitializerClass = class of TRemotableTypeInitializer;
|
||||||
|
|
||||||
{ TRemotableTypeInitializer }
|
{ TRemotableTypeInitializer }
|
||||||
@ -1538,7 +1539,7 @@ type
|
|||||||
) : Boolean;virtual;abstract;
|
) : Boolean;virtual;abstract;
|
||||||
{$ENDIF TRemotableTypeInitializer_Initialize}
|
{$ENDIF TRemotableTypeInitializer_Initialize}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TTypeRegistryItem }
|
{ TTypeRegistryItem }
|
||||||
|
|
||||||
TTypeRegistryItem = class
|
TTypeRegistryItem = class
|
||||||
@ -1568,11 +1569,11 @@ type
|
|||||||
function AddExternalSynonym(const ASynonym : string):TTypeRegistryItem;
|
function AddExternalSynonym(const ASynonym : string):TTypeRegistryItem;
|
||||||
function IsSynonym(const APascalTypeName : string):Boolean;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
function IsSynonym(const APascalTypeName : string):Boolean;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
||||||
function IsExternalSynonym(const AExternalName : string):Boolean;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
function IsExternalSynonym(const AExternalName : string):Boolean;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
||||||
|
|
||||||
procedure RegisterExternalPropertyName(const APropName, AExtPropName : string); virtual;
|
procedure RegisterExternalPropertyName(const APropName, AExtPropName : string); virtual;
|
||||||
function GetExternalPropertyName(const APropName : string) : string;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
function GetExternalPropertyName(const APropName : string) : string;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
||||||
function GetInternalPropertyName(const AExtPropName : string) : string;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
function GetInternalPropertyName(const AExtPropName : string) : string;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
||||||
|
|
||||||
procedure RegisterObject(const APropName : string; const AObject : TObject);
|
procedure RegisterObject(const APropName : string; const AObject : TObject);
|
||||||
function GetObject(const APropName : string) : TObject;
|
function GetObject(const APropName : string) : TObject;
|
||||||
|
|
||||||
@ -1624,7 +1625,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TPropStoreType = ( pstNever, pstOptional, pstAlways );
|
TPropStoreType = ( pstNever, pstOptional, pstAlways );
|
||||||
|
|
||||||
EPropertyException = class(Exception)
|
EPropertyException = class(Exception)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1680,7 +1681,7 @@ const
|
|||||||
|
|
||||||
procedure initialize_base_service_intf();
|
procedure initialize_base_service_intf();
|
||||||
procedure finalize_base_service_intf();
|
procedure finalize_base_service_intf();
|
||||||
|
|
||||||
{$IFDEF HAS_FORMAT_SETTINGS}
|
{$IFDEF HAS_FORMAT_SETTINGS}
|
||||||
var
|
var
|
||||||
wst_FormatSettings : TFormatSettings;
|
wst_FormatSettings : TFormatSettings;
|
||||||
@ -1693,7 +1694,7 @@ uses
|
|||||||
|
|
||||||
type
|
type
|
||||||
PObject = ^TObject;
|
PObject = ^TObject;
|
||||||
|
|
||||||
var
|
var
|
||||||
TypeRegistryInstance : TTypeRegistry = Nil;
|
TypeRegistryInstance : TTypeRegistry = Nil;
|
||||||
|
|
||||||
@ -1789,13 +1790,13 @@ begin
|
|||||||
r.Register(sWST_BASE_NS,TypeInfo(TArrayOfFloatDoubleRemotable),'TArrayOfFloatDoubleRemotable').AddPascalSynonym('TArrayOfFloatDoubleRemotable');
|
r.Register(sWST_BASE_NS,TypeInfo(TArrayOfFloatDoubleRemotable),'TArrayOfFloatDoubleRemotable').AddPascalSynonym('TArrayOfFloatDoubleRemotable');
|
||||||
r.Register(sWST_BASE_NS,TypeInfo(TArrayOfFloatExtendedRemotable),'TArrayOfFloatExtendedRemotable').AddPascalSynonym('TArrayOfFloatExtendedRemotable');
|
r.Register(sWST_BASE_NS,TypeInfo(TArrayOfFloatExtendedRemotable),'TArrayOfFloatExtendedRemotable').AddPascalSynonym('TArrayOfFloatExtendedRemotable');
|
||||||
r.Register(sWST_BASE_NS,TypeInfo(TArrayOfFloatCurrencyRemotable),'TArrayOfFloatCurrencyRemotable').AddPascalSynonym('TArrayOfFloatCurrencyRemotable');
|
r.Register(sWST_BASE_NS,TypeInfo(TArrayOfFloatCurrencyRemotable),'TArrayOfFloatCurrencyRemotable').AddPascalSynonym('TArrayOfFloatCurrencyRemotable');
|
||||||
|
|
||||||
r.Register(sXSD_NS,TypeInfo(TComplexInt64SContentRemotable),'long').AddPascalSynonym('TComplexInt64SContentRemotable');
|
r.Register(sXSD_NS,TypeInfo(TComplexInt64SContentRemotable),'long').AddPascalSynonym('TComplexInt64SContentRemotable');
|
||||||
r.Register(sXSD_NS,TypeInfo(TComplexInt64UContentRemotable),'unsignedLong').AddPascalSynonym('TComplexInt64UContentRemotable');
|
r.Register(sXSD_NS,TypeInfo(TComplexInt64UContentRemotable),'unsignedLong').AddPascalSynonym('TComplexInt64UContentRemotable');
|
||||||
|
|
||||||
r.Register(sXSD_NS,TypeInfo(TComplexInt32SContentRemotable),'int').AddPascalSynonym('TComplexInt32SContentRemotable');
|
r.Register(sXSD_NS,TypeInfo(TComplexInt32SContentRemotable),'int').AddPascalSynonym('TComplexInt32SContentRemotable');
|
||||||
r.Register(sXSD_NS,TypeInfo(TComplexInt32UContentRemotable),'unsignedInt').AddPascalSynonym('TComplexInt32UContentRemotable');
|
r.Register(sXSD_NS,TypeInfo(TComplexInt32UContentRemotable),'unsignedInt').AddPascalSynonym('TComplexInt32UContentRemotable');
|
||||||
|
|
||||||
r.Register(sXSD_NS,TypeInfo(TComplexInt16SContentRemotable),'short').AddPascalSynonym('TComplexInt16SContentRemotable');
|
r.Register(sXSD_NS,TypeInfo(TComplexInt16SContentRemotable),'short').AddPascalSynonym('TComplexInt16SContentRemotable');
|
||||||
r.Register(sXSD_NS,TypeInfo(TComplexInt16UContentRemotable),'unsignedShort').AddPascalSynonym('TComplexInt16UContentRemotable');
|
r.Register(sXSD_NS,TypeInfo(TComplexInt16UContentRemotable),'unsignedShort').AddPascalSynonym('TComplexInt16UContentRemotable');
|
||||||
|
|
||||||
@ -1805,7 +1806,7 @@ begin
|
|||||||
r.Register(sXSD_NS,TypeInfo(TComplexFloatExtendedContentRemotable),'decimal').AddPascalSynonym('TComplexFloatExtendedContentRemotable');
|
r.Register(sXSD_NS,TypeInfo(TComplexFloatExtendedContentRemotable),'decimal').AddPascalSynonym('TComplexFloatExtendedContentRemotable');
|
||||||
r.Register(sXSD_NS,TypeInfo(TComplexFloatDoubleContentRemotable),'double').AddPascalSynonym('TComplexFloatDoubleContentRemotable');
|
r.Register(sXSD_NS,TypeInfo(TComplexFloatDoubleContentRemotable),'double').AddPascalSynonym('TComplexFloatDoubleContentRemotable');
|
||||||
r.Register(sXSD_NS,TypeInfo(TComplexFloatSingleContentRemotable),'Single').AddPascalSynonym('TComplexFloatSingleContentRemotable');
|
r.Register(sXSD_NS,TypeInfo(TComplexFloatSingleContentRemotable),'Single').AddPascalSynonym('TComplexFloatSingleContentRemotable');
|
||||||
|
|
||||||
r.Register(sXSD_NS,TypeInfo(TComplexStringContentRemotable),'string').AddPascalSynonym('TComplexStringContentRemotable');
|
r.Register(sXSD_NS,TypeInfo(TComplexStringContentRemotable),'string').AddPascalSynonym('TComplexStringContentRemotable');
|
||||||
r.Register(sXSD_NS,TypeInfo(TComplexWideStringContentRemotable),'widestring').AddPascalSynonym('TComplexWideStringContentRemotable');
|
r.Register(sXSD_NS,TypeInfo(TComplexWideStringContentRemotable),'widestring').AddPascalSynonym('TComplexWideStringContentRemotable');
|
||||||
{$IFDEF WST_UNICODESTRING}
|
{$IFDEF WST_UNICODESTRING}
|
||||||
@ -2018,14 +2019,14 @@ Type
|
|||||||
|
|
||||||
var
|
var
|
||||||
SerializeOptionsRegistryInstance : TSerializeOptionsRegistry = nil;
|
SerializeOptionsRegistryInstance : TSerializeOptionsRegistry = nil;
|
||||||
|
|
||||||
function GetSerializeOptionsRegistry():TSerializeOptionsRegistry;
|
function GetSerializeOptionsRegistry():TSerializeOptionsRegistry;
|
||||||
begin
|
begin
|
||||||
if not Assigned(SerializeOptionsRegistryInstance) then
|
if not Assigned(SerializeOptionsRegistryInstance) then
|
||||||
SerializeOptionsRegistryInstance := TSerializeOptionsRegistry.Create();
|
SerializeOptionsRegistryInstance := TSerializeOptionsRegistry.Create();
|
||||||
Result := SerializeOptionsRegistryInstance;
|
Result := SerializeOptionsRegistryInstance;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSerializeOptionsRegistry }
|
{ TSerializeOptionsRegistry }
|
||||||
|
|
||||||
function TSerializeOptionsRegistry.GetCount: Integer;
|
function TSerializeOptionsRegistry.GetCount: Integer;
|
||||||
@ -2094,7 +2095,7 @@ begin
|
|||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSerializeOptions }
|
{ TSerializeOptions }
|
||||||
|
|
||||||
procedure TSerializeOptions.AddAttributeField(const AAttributeField: string);
|
procedure TSerializeOptions.AddAttributeField(const AAttributeField: string);
|
||||||
@ -2132,10 +2133,10 @@ begin
|
|||||||
Result := ( FAttributeFieldList.IndexOf(AField) >= 0 );
|
Result := ( FAttributeFieldList.IndexOf(AField) >= 0 );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TBaseComplexRemotable.Destroy();
|
destructor TBaseComplexRemotable.Destroy();
|
||||||
begin
|
begin
|
||||||
FreeObjectProperties();
|
FreeObjectProperties();
|
||||||
inherited Destroy();
|
inherited Destroy();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TBaseComplexRemotable.Save(
|
class procedure TBaseComplexRemotable.Save(
|
||||||
@ -2511,10 +2512,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$ENDIF USE_SERIALIZE}
|
{$ENDIF USE_SERIALIZE}
|
||||||
|
|
||||||
procedure TBaseComplexRemotable.FreeObjectProperties();
|
procedure TBaseComplexRemotable.FreeObjectProperties();
|
||||||
begin
|
begin
|
||||||
//Derived classes should override this method to free their object(s) and array(s).
|
//Derived classes should override this method to free their object(s) and array(s).
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TBaseObjectArrayRemotable }
|
{ TBaseObjectArrayRemotable }
|
||||||
|
|
||||||
@ -3095,7 +3096,7 @@ destructor TTypeRegistryItem.Destroy();
|
|||||||
obj.Free();
|
obj.Free();
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if ( FExternalNames <> nil ) and ( FExternalNames.Count > 0 ) then
|
if ( FExternalNames <> nil ) and ( FExternalNames.Count > 0 ) then
|
||||||
FreeObjects();
|
FreeObjects();
|
||||||
@ -3279,13 +3280,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TTypeRegistry.IndexOf(Const ATypeInfo: PTypeInfo): Integer;
|
function TTypeRegistry.IndexOf(Const ATypeInfo: PTypeInfo): Integer;
|
||||||
|
var
|
||||||
|
i : Integer;
|
||||||
begin
|
begin
|
||||||
For Result := 0 To Pred(Count) Do Begin
|
for i := 0 to Pred(Count) do begin
|
||||||
If ( ATypeInfo^.Kind = Item[Result].DataType^.Kind ) And
|
if ( ATypeInfo = Item[i].DataType ) then begin
|
||||||
|
Result := i;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
{If ( ATypeInfo^.Kind = Item[Result].DataType^.Kind ) And
|
||||||
AnsiSameText(ATypeInfo^.Name,Item[Result].DataType^.Name)
|
AnsiSameText(ATypeInfo^.Name,Item[Result].DataType^.Name)
|
||||||
Then
|
Then
|
||||||
Exit;
|
Exit;}
|
||||||
End;
|
end;
|
||||||
Result := -1;
|
Result := -1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -4733,10 +4740,12 @@ class procedure TSimpleContentHeaderBlock.Save(
|
|||||||
);
|
);
|
||||||
var
|
var
|
||||||
locSerializer : TObjectSerializer;
|
locSerializer : TObjectSerializer;
|
||||||
|
locOptionChanged : Boolean;
|
||||||
begin
|
begin
|
||||||
locSerializer := TBaseComplexTypeRegistryItem(GetTypeRegistry().ItemByTypeInfo[ATypeInfo]).GetSerializer();
|
locSerializer := TBaseComplexTypeRegistryItem(GetTypeRegistry().ItemByTypeInfo[ATypeInfo]).GetSerializer();
|
||||||
if ( locSerializer <> nil ) then begin
|
if ( locSerializer <> nil ) then begin
|
||||||
if not ( osoDontDoBeginWrite in locSerializer.Options ) then
|
locOptionChanged := not ( osoDontDoBeginWrite in locSerializer.Options );
|
||||||
|
if locOptionChanged then
|
||||||
locSerializer.Options := locSerializer.Options + [osoDontDoBeginWrite];
|
locSerializer.Options := locSerializer.Options + [osoDontDoBeginWrite];
|
||||||
AStore.BeginObject(AName,ATypeInfo);
|
AStore.BeginObject(AName,ATypeInfo);
|
||||||
try
|
try
|
||||||
@ -4745,6 +4754,8 @@ begin
|
|||||||
locSerializer.Save(AObject,AStore,AName,ATypeInfo);
|
locSerializer.Save(AObject,AStore,AName,ATypeInfo);
|
||||||
finally
|
finally
|
||||||
AStore.EndScope();
|
AStore.EndScope();
|
||||||
|
if locOptionChanged then
|
||||||
|
locSerializer.Options := locSerializer.Options - [osoDontDoBeginWrite];
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
raise ETypeRegistryException.CreateFmt(SERR_NoSerializerFoThisType,[ATypeInfo^.Name])
|
raise ETypeRegistryException.CreateFmt(SERR_NoSerializerFoThisType,[ATypeInfo^.Name])
|
||||||
@ -5655,12 +5666,12 @@ end;
|
|||||||
|
|
||||||
{ TDateRemotable }
|
{ TDateRemotable }
|
||||||
|
|
||||||
class function TDateRemotable.ToStr(const ADate : TDateTimeRec) : string;
|
class function TDateRemotable.ToStr(const ADate : TDateTimeRec) : string;
|
||||||
begin
|
begin
|
||||||
Result := xsd_DateTimeToStr(ADate,xdkDate);
|
Result := xsd_DateTimeToStr(ADate,xdkDate);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TDateRemotable.Parse(const ABuffer : string) : TDateTimeRec;
|
class function TDateRemotable.Parse(const ABuffer : string) : TDateTimeRec;
|
||||||
begin
|
begin
|
||||||
Result := xsd_StrToDate(ABuffer,xdkDate);
|
Result := xsd_StrToDate(ABuffer,xdkDate);
|
||||||
end;
|
end;
|
||||||
@ -5822,6 +5833,11 @@ begin
|
|||||||
Result := ToStr(locTemp);
|
Result := ToStr(locTemp);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TBaseDateRemotable.ParseToUTC(const ABuffer : string) : TDateTime;
|
||||||
|
begin
|
||||||
|
Result := NormalizeToUTC(Parse(ABuffer));
|
||||||
|
end;
|
||||||
|
|
||||||
{ TComplexInt8SContentRemotable }
|
{ TComplexInt8SContentRemotable }
|
||||||
|
|
||||||
class procedure TComplexInt8SContentRemotable.SaveValue(
|
class procedure TComplexInt8SContentRemotable.SaveValue(
|
||||||
@ -6590,7 +6606,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TComplexWideCharContentRemotable.SaveValue(
|
class procedure TComplexWideCharContentRemotable.SaveValue(
|
||||||
AObject: TBaseRemotable;
|
AObject: TBaseRemotable;
|
||||||
AStore: IFormatterBase
|
AStore: IFormatterBase
|
||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
|
@ -67,6 +67,10 @@ const
|
|||||||
|
|
||||||
type
|
type
|
||||||
TXsdDateKind = ( xdkDateTime, xdkDate );
|
TXsdDateKind = ( xdkDateTime, xdkDate );
|
||||||
|
TValueCompareKind = (
|
||||||
|
vckEqual, vckLessThan, vckGreaterThan, vckNotEqual,
|
||||||
|
vckEqualOrLessThan, vckEqualOrGreaterThan
|
||||||
|
);
|
||||||
|
|
||||||
function xsd_TryStrToDate(
|
function xsd_TryStrToDate(
|
||||||
const AStr : string;
|
const AStr : string;
|
||||||
@ -123,6 +127,11 @@ type
|
|||||||
function ValueEquals(const AA,AB: TTimeRec) : Boolean; overload;
|
function ValueEquals(const AA,AB: TTimeRec) : Boolean; overload;
|
||||||
function ValueEquals(const AA,AB: TDurationRec) : Boolean; overload;
|
function ValueEquals(const AA,AB: TDurationRec) : Boolean; overload;
|
||||||
|
|
||||||
|
function CompareValue(
|
||||||
|
const AA,AB : TDateTimeRec;
|
||||||
|
const ACompareKind : TValueCompareKind
|
||||||
|
) : Boolean;
|
||||||
|
|
||||||
resourcestring
|
resourcestring
|
||||||
SERR_InvalidDate = '"%s" is not a valid date.';
|
SERR_InvalidDate = '"%s" is not a valid date.';
|
||||||
SERR_InvalidTime = '"%s" is not a valid time.';
|
SERR_InvalidTime = '"%s" is not a valid time.';
|
||||||
@ -200,6 +209,27 @@ begin
|
|||||||
( a.MinuteOffset = b.MinuteOffset );
|
( a.MinuteOffset = b.MinuteOffset );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function CompareValue(
|
||||||
|
const AA,AB : TDateTimeRec;
|
||||||
|
const ACompareKind : TValueCompareKind
|
||||||
|
) : Boolean;
|
||||||
|
var
|
||||||
|
locA, locB : TDateTime;
|
||||||
|
begin
|
||||||
|
case ACompareKind of
|
||||||
|
vckEqual : Result := ValueEquals(AA,AB);
|
||||||
|
vckLessThan : Result := ( NormalizeToUTC(AA) < NormalizeToUTC(AB) );
|
||||||
|
vckGreaterThan : Result := ( NormalizeToUTC(AA) > NormalizeToUTC(AB) );
|
||||||
|
vckNotEqual : Result := not ValueEquals(AA,AB);
|
||||||
|
vckEqualOrLessThan : Result := ValueEquals(AA,AB) or ( NormalizeToUTC(AA) < NormalizeToUTC(AB) );
|
||||||
|
vckEqualOrGreaterThan : Result := ValueEquals(AA,AB) or ( NormalizeToUTC(AA) > NormalizeToUTC(AB) );
|
||||||
|
else begin
|
||||||
|
Assert(False); // To suppress the warning
|
||||||
|
Result := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function xsd_TryStrToDate(
|
function xsd_TryStrToDate(
|
||||||
const AStr : string;
|
const AStr : string;
|
||||||
out ADate : TDateTimeRec;
|
out ADate : TDateTimeRec;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<Version Value="8"/>
|
<Version Value="8"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<SearchPaths>
|
<SearchPaths>
|
||||||
<OtherUnitFiles Value="..\..\"/>
|
<OtherUnitFiles Value="..\..\;$(LazarusDir)\others_package\indy-10.2.0.3\fpc\"/>
|
||||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
</SearchPaths>
|
</SearchPaths>
|
||||||
<Parsing>
|
<Parsing>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
This file is provide under modified LGPL licence
|
This file is provide under modified LGPL licence
|
||||||
( the files COPYING.modifiedLGPL and COPYING.LGPL).
|
( the files COPYING.modifiedLGPL and COPYING.LGPL).
|
||||||
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -24,7 +24,7 @@ uses
|
|||||||
|
|
||||||
Const
|
Const
|
||||||
sTRANSPORT_NAME = 'HTTP';
|
sTRANSPORT_NAME = 'HTTP';
|
||||||
|
|
||||||
Type
|
Type
|
||||||
|
|
||||||
{$M+}
|
{$M+}
|
||||||
@ -36,12 +36,15 @@ Type
|
|||||||
FConnection : TidHttp;
|
FConnection : TidHttp;
|
||||||
FSoapAction: string;
|
FSoapAction: string;
|
||||||
FContentType: string;
|
FContentType: string;
|
||||||
|
private
|
||||||
function GetAddress: string;
|
function GetAddress: string;
|
||||||
|
function GetProtocolVersion : string;
|
||||||
function GetProxyPassword: string;
|
function GetProxyPassword: string;
|
||||||
function GetProxyPort: Integer;
|
function GetProxyPort: Integer;
|
||||||
function GetProxyServer: string;
|
function GetProxyServer: string;
|
||||||
function GetProxyUsername: string;
|
function GetProxyUsername: string;
|
||||||
procedure SetAddress(const AValue: string);
|
procedure SetAddress(const AValue: string);
|
||||||
|
procedure SetProtocolVersion(const AValue : string);
|
||||||
procedure SetProxyPassword(const AValue: string);
|
procedure SetProxyPassword(const AValue: string);
|
||||||
procedure SetProxyPort(const AValue: Integer);
|
procedure SetProxyPort(const AValue: Integer);
|
||||||
procedure SetProxyServer(const AValue: string);
|
procedure SetProxyServer(const AValue: string);
|
||||||
@ -60,13 +63,37 @@ Type
|
|||||||
property ProxyPassword : string read GetProxyPassword write SetProxyPassword;
|
property ProxyPassword : string read GetProxyPassword write SetProxyPassword;
|
||||||
property SoapAction : string read FSoapAction write FSoapAction;
|
property SoapAction : string read FSoapAction write FSoapAction;
|
||||||
property Format : string read FFormat write FFormat;
|
property Format : string read FFormat write FFormat;
|
||||||
|
property ProtocolVersion : string read GetProtocolVersion write SetProtocolVersion;
|
||||||
End;
|
End;
|
||||||
{$M+}
|
{$M+}
|
||||||
|
|
||||||
procedure INDY_RegisterHTTP_Transport();
|
procedure INDY_RegisterHTTP_Transport();
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
uses
|
||||||
|
wst_consts;
|
||||||
|
|
||||||
|
const
|
||||||
|
ProtocolVersionMAP : array[TIdHTTPProtocolVersion] of string = ('1.0', '1.1');
|
||||||
|
|
||||||
|
function TryStrToProtocolVersion(
|
||||||
|
const AStr : string;
|
||||||
|
out ARes : TIdHTTPProtocolVersion
|
||||||
|
) : Boolean;
|
||||||
|
var
|
||||||
|
i : TIdHTTPProtocolVersion;
|
||||||
|
begin
|
||||||
|
for i := Low(TIdHTTPProtocolVersion) to High(TIdHTTPProtocolVersion) do begin
|
||||||
|
if ( AStr = ProtocolVersionMAP[i] ) then begin
|
||||||
|
ARes := i;
|
||||||
|
Result := True;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Result := False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ THTTPTransport }
|
{ THTTPTransport }
|
||||||
|
|
||||||
function THTTPTransport.GetAddress: string;
|
function THTTPTransport.GetAddress: string;
|
||||||
@ -74,6 +101,11 @@ begin
|
|||||||
Result := FConnection.Request.URL;
|
Result := FConnection.Request.URL;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function THTTPTransport.GetProtocolVersion : string;
|
||||||
|
begin
|
||||||
|
Result := ProtocolVersionMAP[FConnection.ProtocolVersion];
|
||||||
|
end;
|
||||||
|
|
||||||
function THTTPTransport.GetProxyPassword: string;
|
function THTTPTransport.GetProxyPassword: string;
|
||||||
begin
|
begin
|
||||||
Result := FConnection.ProxyParams.ProxyPassword;
|
Result := FConnection.ProxyParams.ProxyPassword;
|
||||||
@ -99,6 +131,17 @@ begin
|
|||||||
FConnection.Request.URL := AValue;
|
FConnection.Request.URL := AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure THTTPTransport.SetProtocolVersion(const AValue : string);
|
||||||
|
var
|
||||||
|
locValue : TIdHTTPProtocolVersion;
|
||||||
|
begin
|
||||||
|
if not TryStrToProtocolVersion(AValue,locValue) then
|
||||||
|
raise ETransportExecption.CreateFmt(SERR_InvalidPropertyValue,['ProtocolVersion',AValue]);
|
||||||
|
FConnection.ProtocolVersion := locValue;
|
||||||
|
if not ( hoKeepOrigProtocol in FConnection.HTTPOptions ) then
|
||||||
|
FConnection.HTTPOptions := FConnection.HTTPOptions + [hoKeepOrigProtocol];
|
||||||
|
end;
|
||||||
|
|
||||||
procedure THTTPTransport.SetProxyPassword(const AValue: string);
|
procedure THTTPTransport.SetProxyPassword(const AValue: string);
|
||||||
begin
|
begin
|
||||||
FConnection.ProxyParams.ProxyPassword := AValue;
|
FConnection.ProxyParams.ProxyPassword := AValue;
|
||||||
@ -151,8 +194,11 @@ begin
|
|||||||
FConnection.ProxyParams.BasicAuthentication := True;
|
FConnection.ProxyParams.BasicAuthentication := True;
|
||||||
end;
|
end;
|
||||||
FConnection.Request.CustomHeaders.Clear();
|
FConnection.Request.CustomHeaders.Clear();
|
||||||
FConnection.Request.CustomHeaders.Values['soapAction'] := SoapAction;
|
FConnection.Request.CustomHeaders.Values['SOAPAction'] := SoapAction;
|
||||||
FConnection.Request.ContentType := ContentType;
|
FConnection.Request.ContentType := ContentType;
|
||||||
|
{$IFDEF WST_DBG}
|
||||||
|
TMemoryStream(ARequest).SaveToFile('request.log');
|
||||||
|
{$ENDIF WST_DBG}
|
||||||
FConnection.Post(Address,ARequest, AResponse);
|
FConnection.Post(Address,ARequest, AResponse);
|
||||||
{$IFDEF WST_DBG}
|
{$IFDEF WST_DBG}
|
||||||
i := AResponse.Size;
|
i := AResponse.Size;
|
||||||
|
@ -163,7 +163,7 @@ procedure THTTPTransport.SendAndReceive(ARequest, AResponse: TStream);
|
|||||||
{else
|
{else
|
||||||
ShowMessage(AStr)};
|
ShowMessage(AStr)};
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
s : TBinaryString;
|
s : TBinaryString;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
@ -310,10 +310,10 @@ begin
|
|||||||
RegisterExternalPropertyName('__FIELDS__','fieldSmallint;fieldWord;fieldString');
|
RegisterExternalPropertyName('__FIELDS__','fieldSmallint;fieldWord;fieldString');
|
||||||
end;
|
end;
|
||||||
{$IFNDEF WST_RECORD_RTTI}
|
{$IFNDEF WST_RECORD_RTTI}
|
||||||
typeReg.ItemByTypeInfo[TypeInfo(TTestSmallRecord)].RegisterObject(FIELDS_STRING,TRecordRttiDataObject.Create(MakeRecordTypeInfo(TypeInfo(TTestSmallRecord)),GetTypeRegistry().ItemByTypeInfo[TypeInfo(TTestSmallRecord)].GetExternalPropertyName('__FIELDS__')));
|
typeReg.ItemByTypeInfo[TypeInfo(TTestSmallRecord)].RegisterObject(FIELDS_STRING,TRecordRttiDataObject.Create(MakeRecordTypeInfo(TypeInfo(TTestSmallRecord)),typeReg.ItemByTypeInfo[TypeInfo(TTestSmallRecord)].GetExternalPropertyName('__FIELDS__')));
|
||||||
{$ENDIF WST_RECORD_RTTI}
|
{$ENDIF WST_RECORD_RTTI}
|
||||||
{$IFDEF WST_RECORD_RTTI}
|
{$IFDEF WST_RECORD_RTTI}
|
||||||
typeReg.ItemByTypeInfo[TypeInfo(TTestSmallRecord)].RegisterObject(FIELDS_STRING,TRecordRttiDataObject.Create(MakeRecordTypeInfo(__TTestSmallRecord_TYPEINFO_FUNC__()),GetTypeRegistry().ItemByTypeInfo[TypeInfo(TTestSmallRecord)].GetExternalPropertyName('__FIELDS__')));
|
typeReg.ItemByTypeInfo[TypeInfo(TTestSmallRecord)].RegisterObject(FIELDS_STRING,TRecordRttiDataObject.Create(MakeRecordTypeInfo(__TTestSmallRecord_TYPEINFO_FUNC__()),typeReg.ItemByTypeInfo[TypeInfo(TTestSmallRecord)].GetExternalPropertyName('__FIELDS__')));
|
||||||
{$ENDIF WST_RECORD_RTTI}
|
{$ENDIF WST_RECORD_RTTI}
|
||||||
(typeReg.ItemByTypeInfo[TypeInfo(TTestSmallRecord)].GetObject(FIELDS_STRING) as TRecordRttiDataObject).GetField('fieldWord')^.IsAttribute := True;
|
(typeReg.ItemByTypeInfo[TypeInfo(TTestSmallRecord)].GetObject(FIELDS_STRING) as TRecordRttiDataObject).GetField('fieldWord')^.IsAttribute := True;
|
||||||
handlerReg := CreateWsdlTypeHandlerRegistry(typeReg);
|
handlerReg := CreateWsdlTypeHandlerRegistry(typeReg);
|
||||||
|
@ -20,6 +20,7 @@ uses
|
|||||||
pparser, pastree;
|
pparser, pastree;
|
||||||
|
|
||||||
const
|
const
|
||||||
|
sEMBEDDED_TYPE = '_E_T_';
|
||||||
sEXTERNAL_NAME = '_E_N_';
|
sEXTERNAL_NAME = '_E_N_';
|
||||||
sATTRIBUTE = '_ATTRIBUTE_';
|
sATTRIBUTE = '_ATTRIBUTE_';
|
||||||
sARRAY_ITEM_NAME = 'ARRAY_ITEM_NAME';
|
sARRAY_ITEM_NAME = 'ARRAY_ITEM_NAME';
|
||||||
@ -409,6 +410,7 @@ begin
|
|||||||
AddSystemSymbol(Result,AContainer);
|
AddSystemSymbol(Result,AContainer);
|
||||||
AddClassDef(Result,'TBaseRemotable','',TPasNativeClassType);
|
AddClassDef(Result,'TBaseRemotable','',TPasNativeClassType);
|
||||||
AddClassDef(Result,'TAbstractSimpleRemotable','TBaseRemotable',TPasNativeClassType);
|
AddClassDef(Result,'TAbstractSimpleRemotable','TBaseRemotable',TPasNativeClassType);
|
||||||
|
AContainer.RegisterExternalAlias(AddClassDef(Result,'schema_Type','TAbstractSimpleRemotable'),'schema');
|
||||||
AContainer.RegisterExternalAlias(AddClassDef(Result,'TDateRemotable','TAbstractSimpleRemotable'),'date');
|
AContainer.RegisterExternalAlias(AddClassDef(Result,'TDateRemotable','TAbstractSimpleRemotable'),'date');
|
||||||
AContainer.RegisterExternalAlias(AddClassDef(Result,'TDateTimeRemotable','TAbstractSimpleRemotable'),'dateTime');
|
AContainer.RegisterExternalAlias(AddClassDef(Result,'TDateTimeRemotable','TAbstractSimpleRemotable'),'dateTime');
|
||||||
{$IFDEF WST_HAS_TDURATIONREMOTABLE}
|
{$IFDEF WST_HAS_TDURATIONREMOTABLE}
|
||||||
|
@ -51,6 +51,8 @@ type
|
|||||||
) : TPasElement;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
) : TPasElement;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
||||||
function FindElementWithHint(const AName, AHint : string; const ASpace : TSearchSpace) : TPasElement;
|
function FindElementWithHint(const AName, AHint : string; const ASpace : TSearchSpace) : TPasElement;
|
||||||
function ExtractTypeHint(AElement : TDOMNode) : string;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
function ExtractTypeHint(AElement : TDOMNode) : string;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
||||||
|
procedure SetAsEmbeddedType(AType : TPasType);
|
||||||
|
function IsEmbeddedType(AType : TPasType) : Boolean;
|
||||||
{$IFDEF WST_HANDLE_DOC}
|
{$IFDEF WST_HANDLE_DOC}
|
||||||
procedure ParseDocumentation(AType : TPasType);
|
procedure ParseDocumentation(AType : TPasType);
|
||||||
{$ENDIF WST_HANDLE_DOC}
|
{$ENDIF WST_HANDLE_DOC}
|
||||||
@ -353,6 +355,16 @@ begin
|
|||||||
Result := '';
|
Result := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TAbstractTypeParser.SetAsEmbeddedType(AType : TPasType);
|
||||||
|
begin
|
||||||
|
FSymbols.Properties.SetValue(AType,sEMBEDDED_TYPE,'1');
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TAbstractTypeParser.IsEmbeddedType(AType : TPasType) : Boolean;
|
||||||
|
begin
|
||||||
|
Result := ( FSymbols.Properties.GetValue(AType,sEMBEDDED_TYPE) = '1' );
|
||||||
|
end;
|
||||||
|
|
||||||
{$IFDEF WST_HANDLE_DOC}
|
{$IFDEF WST_HANDLE_DOC}
|
||||||
procedure TAbstractTypeParser.ParseDocumentation(AType : TPasType);
|
procedure TAbstractTypeParser.ParseDocumentation(AType : TPasType);
|
||||||
var
|
var
|
||||||
@ -1049,10 +1061,10 @@ begin
|
|||||||
internalName := ExtractIdentifier(ATypeName);
|
internalName := ExtractIdentifier(ATypeName);
|
||||||
hasInternalName := IsReservedKeyWord(internalName) or
|
hasInternalName := IsReservedKeyWord(internalName) or
|
||||||
( not IsValidIdent(internalName) ) or
|
( not IsValidIdent(internalName) ) or
|
||||||
//( FSymbols.IndexOf(internalName) <> -1 ) or
|
( FSymbols.FindElementInModule(internalName,Self.Module,[elkName]) <> nil ) or
|
||||||
( not AnsiSameText(internalName,ATypeName) );
|
( not AnsiSameText(internalName,ATypeName) );
|
||||||
if hasInternalName then begin
|
if hasInternalName then begin
|
||||||
internalName := Format('_%s',[internalName]);
|
internalName := Format('%s_Type',[internalName]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if ( pthDeriveFromSoapArray in FHints ) or
|
if ( pthDeriveFromSoapArray in FHints ) or
|
||||||
@ -1379,7 +1391,8 @@ begin
|
|||||||
if Assigned(locSym) then begin
|
if Assigned(locSym) then begin
|
||||||
if not locSym.InheritsFrom(TPasType) then
|
if not locSym.InheritsFrom(TPasType) then
|
||||||
raise EXsdParserException.CreateFmt('Symbol found in the symbol table but is not a type definition : %s.',[FTypeName]);
|
raise EXsdParserException.CreateFmt('Symbol found in the symbol table but is not a type definition : %s.',[FTypeName]);
|
||||||
locContinue := locSym.InheritsFrom(TPasUnresolvedTypeRef);
|
locContinue := locSym.InheritsFrom(TPasUnresolvedTypeRef) or
|
||||||
|
( IsEmbeddedType(TPasType(locSym)) <> FEmbededDef );
|
||||||
if not locContinue then;
|
if not locContinue then;
|
||||||
Result := locSym as TPasType;
|
Result := locSym as TPasType;
|
||||||
end;
|
end;
|
||||||
|
@ -75,7 +75,11 @@ type
|
|||||||
const ASoapBindingStyle : string
|
const ASoapBindingStyle : string
|
||||||
) : TPasProcedure;
|
) : TPasProcedure;
|
||||||
function GetParser(const ANamespace : string) : IXsdPaser;
|
function GetParser(const ANamespace : string) : IXsdPaser;
|
||||||
function ParseType(const AName : string; const AHint : string = '') : TPasType;
|
function ParseType(
|
||||||
|
const AName : string;
|
||||||
|
const AHint : string = '';
|
||||||
|
const ATypeOrElement : string = ''
|
||||||
|
) : TPasType;
|
||||||
procedure ParseTypes();
|
procedure ParseTypes();
|
||||||
protected
|
protected
|
||||||
function GetXsShortNames() : TStrings;
|
function GetXsShortNames() : TStrings;
|
||||||
@ -300,6 +304,7 @@ procedure TWsdlParser.Execute(const AMode: TParserMode; const AModuleName: strin
|
|||||||
schmNode, tmpNode : TDOMNode;
|
schmNode, tmpNode : TDOMNode;
|
||||||
s : string;
|
s : string;
|
||||||
typeList : TList;
|
typeList : TList;
|
||||||
|
locXsdParser : IXsdPaser;
|
||||||
begin
|
begin
|
||||||
if Assigned(FSchemaCursor) then begin
|
if Assigned(FSchemaCursor) then begin
|
||||||
FSchemaCursor.Reset();
|
FSchemaCursor.Reset();
|
||||||
@ -323,7 +328,8 @@ procedure TWsdlParser.Execute(const AMode: TParserMode; const AModuleName: strin
|
|||||||
tmpNode := FindNamedNode(typeCursor,FSymbols.GetExternalName(sym));
|
tmpNode := FindNamedNode(typeCursor,FSymbols.GetExternalName(sym));
|
||||||
if Assigned(tmpNode) then begin
|
if Assigned(tmpNode) then begin
|
||||||
//symNew := ParseType(FSymbols.GetExternalName(sym));
|
//symNew := ParseType(FSymbols.GetExternalName(sym));
|
||||||
symNew := GetParser(schmNode.Attributes.GetNamedItem(s_targetNamespace).NodeValue).ParseType(FSymbols.GetExternalName(sym));
|
locXsdParser := GetParser(schmNode.Attributes.GetNamedItem(s_targetNamespace).NodeValue);
|
||||||
|
symNew := locXsdParser.ParseType(FSymbols.GetExternalName(sym),tmpNode);
|
||||||
//symNew := ParseType(tmpNode.Attributes.GetNamedItem(s_name).NodeValue);
|
//symNew := ParseType(tmpNode.Attributes.GetNamedItem(s_name).NodeValue);
|
||||||
if ( sym <> symNew ) then begin
|
if ( sym <> symNew ) then begin
|
||||||
FModule.InterfaceSection.Declarations.Extract(sym);
|
FModule.InterfaceSection.Declarations.Extract(sym);
|
||||||
@ -460,7 +466,7 @@ function TWsdlParser.ParseOperation(
|
|||||||
function GetDataType(const AName, ATypeOrElement : string; const ATypeHint : string = ''):TPasType;
|
function GetDataType(const AName, ATypeOrElement : string; const ATypeHint : string = ''):TPasType;
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
Result := ParseType(AName,ATypeHint);
|
Result := ParseType(AName,ATypeHint,ATypeOrElement);
|
||||||
except
|
except
|
||||||
on e : Exception do begin
|
on e : Exception do begin
|
||||||
DoOnMessage(mtError, e.Message + ' ' + AName + ' ' + ATypeOrElement);
|
DoOnMessage(mtError, e.Message + ' ' + AName + ' ' + ATypeOrElement);
|
||||||
@ -578,7 +584,9 @@ function TWsdlParser.ParseOperation(
|
|||||||
prmName := ExtractNameFromQName(prmTypeName);
|
prmName := ExtractNameFromQName(prmTypeName);
|
||||||
end;
|
end;
|
||||||
prmInternameName := Trim(prmName);
|
prmInternameName := Trim(prmName);
|
||||||
if AnsiSameText(prmInternameName,tmpMthd.Name) then begin
|
if AnsiSameText(prmInternameName,tmpMthd.Name) or
|
||||||
|
AnsiSameText(prmInternameName,ExtractNameFromQName(prmTypeName))
|
||||||
|
then begin
|
||||||
prmInternameName := prmInternameName + 'Param';
|
prmInternameName := prmInternameName + 'Param';
|
||||||
end;
|
end;
|
||||||
prmHasInternameName := IsReservedKeyWord(prmInternameName) or
|
prmHasInternameName := IsReservedKeyWord(prmInternameName) or
|
||||||
@ -1176,11 +1184,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TWsdlParser.ParseType(const AName : string; const AHint : string) : TPasType;
|
function TWsdlParser.ParseType(
|
||||||
|
const AName : string;
|
||||||
|
const AHint : string;
|
||||||
|
const ATypeOrElement : string
|
||||||
|
) : TPasType;
|
||||||
var
|
var
|
||||||
localName, spaceShort, spaceLong : string;
|
localName, spaceShort, spaceLong : string;
|
||||||
locPrs : IXsdPaser;
|
locPrs : IXsdPaser;
|
||||||
xsdModule : TPasModule;
|
xsdModule : TPasModule;
|
||||||
|
locTypeKind : string;
|
||||||
begin
|
begin
|
||||||
ExplodeQName(AName,localName,spaceShort);
|
ExplodeQName(AName,localName,spaceShort);
|
||||||
if ( FXSShortNames.IndexOf(spaceShort) >= 0 ) then begin
|
if ( FXSShortNames.IndexOf(spaceShort) >= 0 ) then begin
|
||||||
@ -1196,7 +1209,11 @@ begin
|
|||||||
if not FindNameSpace(spaceShort,spaceLong) then
|
if not FindNameSpace(spaceShort,spaceLong) then
|
||||||
raise EXsdParserAssertException.CreateFmt('Unable to resolve the namespace : "%s".',[spaceShort]);
|
raise EXsdParserAssertException.CreateFmt('Unable to resolve the namespace : "%s".',[spaceShort]);
|
||||||
locPrs := GetParser(spaceLong);
|
locPrs := GetParser(spaceLong);
|
||||||
Result := locPrs.ParseType(AName);
|
if ( ATypeOrElement = s_element ) then
|
||||||
|
locTypeKind := s_element
|
||||||
|
else
|
||||||
|
locTypeKind := '';
|
||||||
|
Result := locPrs.ParseType(AName,locTypeKind);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -55,7 +55,14 @@ type
|
|||||||
|
|
||||||
IXsdPaser = interface
|
IXsdPaser = interface
|
||||||
['{F0CEC726-A068-4CCC-B1E7-D31F018415B2}']
|
['{F0CEC726-A068-4CCC-B1E7-D31F018415B2}']
|
||||||
function ParseType(const AName : string) : TPasType;
|
function ParseType(
|
||||||
|
const AName,
|
||||||
|
ATypeKind : string { ATypeKind "ComplexType", "SimpleType", "Element" }
|
||||||
|
) : TPasType; overload;
|
||||||
|
function ParseType(
|
||||||
|
const AName : string;
|
||||||
|
const ATypeNode : TDOMNode
|
||||||
|
) : TPasType; overload;
|
||||||
procedure ParseTypes();
|
procedure ParseTypes();
|
||||||
procedure SetNotifier(ANotifier : TOnParserMessage);
|
procedure SetNotifier(ANotifier : TOnParserMessage);
|
||||||
end;
|
end;
|
||||||
@ -90,6 +97,10 @@ type
|
|||||||
function FindShortNamesForNameSpaceLocal(const ANameSpace : string) : TStrings;
|
function FindShortNamesForNameSpaceLocal(const ANameSpace : string) : TStrings;
|
||||||
function FindShortNamesForNameSpace(const ANameSpace : string) : TStrings;
|
function FindShortNamesForNameSpace(const ANameSpace : string) : TStrings;
|
||||||
procedure SetNotifier(ANotifier : TOnParserMessage);
|
procedure SetNotifier(ANotifier : TOnParserMessage);
|
||||||
|
function InternalParseType(
|
||||||
|
const AName : string;
|
||||||
|
const ATypeNode : TDOMNode
|
||||||
|
) : TPasType;
|
||||||
public
|
public
|
||||||
constructor Create(
|
constructor Create(
|
||||||
ADoc : TXMLDocument;
|
ADoc : TXMLDocument;
|
||||||
@ -98,7 +109,15 @@ type
|
|||||||
AParentContext : IParserContext
|
AParentContext : IParserContext
|
||||||
);
|
);
|
||||||
destructor Destroy();override;
|
destructor Destroy();override;
|
||||||
function ParseType(const AName : string) : TPasType;
|
function ParseType(
|
||||||
|
const AName,
|
||||||
|
ATypeKind : string { ATypeKind "ComplexType", "SimpleType", "Element" }
|
||||||
|
) : TPasType; overload;
|
||||||
|
function ParseType(
|
||||||
|
const AName : string;
|
||||||
|
const ATypeNode : TDOMNode
|
||||||
|
) : TPasType; overload;
|
||||||
|
|
||||||
procedure ParseTypes();
|
procedure ParseTypes();
|
||||||
|
|
||||||
function GetTargetNameSpace() : string;
|
function GetTargetNameSpace() : string;
|
||||||
@ -296,7 +315,23 @@ begin
|
|||||||
Result := FXSShortNames;
|
Result := FXSShortNames;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomXsdSchemaParser.ParseType(const AName: string): TPasType;
|
function TCustomXsdSchemaParser.ParseType(const AName, ATypeKind : string): TPasType;
|
||||||
|
begin
|
||||||
|
Result := InternalParseType(AName,nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCustomXsdSchemaParser.ParseType(
|
||||||
|
const AName : string;
|
||||||
|
const ATypeNode : TDOMNode
|
||||||
|
) : TPasType;
|
||||||
|
begin
|
||||||
|
Result := InternalParseType(AName,ATypeNode);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCustomXsdSchemaParser.InternalParseType(
|
||||||
|
const AName : string;
|
||||||
|
const ATypeNode : TDOMNode
|
||||||
|
): TPasType;
|
||||||
var
|
var
|
||||||
crsSchemaChild : IObjectCursor;
|
crsSchemaChild : IObjectCursor;
|
||||||
typNd : TDOMNode;
|
typNd : TDOMNode;
|
||||||
@ -324,7 +359,10 @@ var
|
|||||||
begin
|
begin
|
||||||
ASimpleTypeAlias := nil;
|
ASimpleTypeAlias := nil;
|
||||||
Result := True;
|
Result := True;
|
||||||
typNd := FindNamedNode(crsSchemaChild,localTypeName);
|
if ( ATypeNode <> nil ) then
|
||||||
|
typNd := ATypeNode
|
||||||
|
else
|
||||||
|
typNd := FindNamedNode(crsSchemaChild,localTypeName);
|
||||||
if not Assigned(typNd) then
|
if not Assigned(typNd) then
|
||||||
raise EXsdTypeNotFoundException.CreateFmt('Type definition not found 1 : "%s"',[AName]);
|
raise EXsdTypeNotFoundException.CreateFmt('Type definition not found 1 : "%s"',[AName]);
|
||||||
if AnsiSameText(ExtractNameFromQName(typNd.NodeName),s_element) then begin
|
if AnsiSameText(ExtractNameFromQName(typNd.NodeName),s_element) then begin
|
||||||
@ -432,6 +470,7 @@ var
|
|||||||
sct : TPasSection;
|
sct : TPasSection;
|
||||||
shortNameSpace, longNameSpace : string;
|
shortNameSpace, longNameSpace : string;
|
||||||
typeModule : TPasModule;
|
typeModule : TPasModule;
|
||||||
|
locTypeNodeFound : Boolean;
|
||||||
begin
|
begin
|
||||||
sct := nil;
|
sct := nil;
|
||||||
DoOnMessage(mtInfo, Format('Parsing "%s" ...',[AName]));
|
DoOnMessage(mtInfo, Format('Parsing "%s" ...',[AName]));
|
||||||
@ -449,6 +488,14 @@ begin
|
|||||||
if ( typeModule = nil ) then
|
if ( typeModule = nil ) then
|
||||||
raise EXsdTypeNotFoundException.Create(AName);
|
raise EXsdTypeNotFoundException.Create(AName);
|
||||||
Result := SymbolTable.FindElementInModule(localTypeName,typeModule) as TPasType;
|
Result := SymbolTable.FindElementInModule(localTypeName,typeModule) as TPasType;
|
||||||
|
Init();
|
||||||
|
locTypeNodeFound := FindTypeNode(aliasType);
|
||||||
|
if ( Result <> nil ) and ( typeModule = FModule ) and
|
||||||
|
( not Result.InheritsFrom(TPasUnresolvedTypeRef) )
|
||||||
|
then begin
|
||||||
|
if locTypeNodeFound and ( embededType <> ( SymbolTable.Properties.GetValue(Result,sEMBEDDED_TYPE) = '1' ) ) then
|
||||||
|
Result := nil;
|
||||||
|
end;
|
||||||
if ( ( Result = nil ) or Result.InheritsFrom(TPasUnresolvedTypeRef) ) and
|
if ( ( Result = nil ) or Result.InheritsFrom(TPasUnresolvedTypeRef) ) and
|
||||||
( typeModule = FModule )
|
( typeModule = FModule )
|
||||||
then begin
|
then begin
|
||||||
@ -456,7 +503,7 @@ begin
|
|||||||
frwType := Result;
|
frwType := Result;
|
||||||
Result := nil;
|
Result := nil;
|
||||||
Init();
|
Init();
|
||||||
if FindTypeNode(aliasType) then begin
|
if locTypeNodeFound {FindTypeNode(aliasType)} then begin
|
||||||
if AnsiSameText(ExtractNameFromQName(typNd.NodeName),s_complexType) then begin
|
if AnsiSameText(ExtractNameFromQName(typNd.NodeName),s_complexType) then begin
|
||||||
Result := ParseComplexType();
|
Result := ParseComplexType();
|
||||||
end else if AnsiSameText(ExtractNameFromQName(typNd.NodeName),s_simpleType) then begin
|
end else if AnsiSameText(ExtractNameFromQName(typNd.NodeName),s_simpleType) then begin
|
||||||
@ -520,8 +567,9 @@ begin
|
|||||||
typTmpCrs := CreateCursorOn(typTmpCrs,ParseFilter(Format('%s=%s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer));
|
typTmpCrs := CreateCursorOn(typTmpCrs,ParseFilter(Format('%s=%s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer));
|
||||||
typTmpCrs.Reset();
|
typTmpCrs.Reset();
|
||||||
if typTmpCrs.MoveNext() then begin
|
if typTmpCrs.MoveNext() then begin
|
||||||
ParseType(
|
InternalParseType(
|
||||||
(typTmpCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue
|
(typTmpCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue,
|
||||||
|
typNode
|
||||||
);
|
);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user