Delphi6 compatibility fix

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@285 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2007-11-12 09:21:46 +00:00
parent 03259ab9d6
commit 56ce4246c0
9 changed files with 867 additions and 395 deletions

View File

@ -21,6 +21,7 @@ uses
{$DEFINE wst_binary_header}
const
sBINARY_FORMAT_NAME = 'wst-binary';
sROOT = 'ROOT';
sSCOPE_INNER_NAME = 'INNER_VAL';
sFORMAT = 'format';
@ -123,6 +124,8 @@ type
function IsCurrentScopeNil():Boolean;virtual;abstract;
property ScopeObject : PDataBuffer Read FScopeObject;
property ScopeType : TScopeType Read FScopeType;
function GetScopeItemNames(const AReturnList : TStrings) : Integer;virtual;abstract;
End;
{ TObjectStackItem }
@ -141,6 +144,7 @@ type
function GetInnerBuffer():PDataBuffer;override;
procedure NilCurrentScope();override;
function IsCurrentScopeNil():Boolean;override;
function GetScopeItemNames(const AReturnList : TStrings) : Integer;override;
End;
{ TArrayStackItem }
@ -161,6 +165,7 @@ type
function GetInnerBuffer():PDataBuffer;overload;override;
procedure NilCurrentScope();override;
function IsCurrentScopeNil():Boolean;override;
function GetScopeItemNames(const AReturnList : TStrings) : Integer;override;
End;
{ TBaseBinaryFormatter }
@ -272,7 +277,8 @@ type
public
constructor Create();override;
destructor Destroy();override;
function GetFormatName() : string;
procedure Clear();
procedure BeginObject(
@ -327,6 +333,7 @@ type
var AData
);
function ReadBuffer(const AName : string) : string;
procedure WriteBuffer(const AValue : string);
procedure SaveToStream(AStream : TStream);
procedure LoadFromStream(AStream : TStream);
@ -776,6 +783,21 @@ begin
end;
//----------------------------------------------------------------
function TObjectStackItem.GetScopeItemNames(const AReturnList: TStrings): Integer;
var
locBuffer : PObjectBufferItem;
begin
AReturnList.Clear();
if Assigned(ScopeObject) and ( ScopeObject^.ObjectData^.Count > 0 ) then begin
locBuffer := ScopeObject^.ObjectData^.Head;
while Assigned(locBuffer) do begin
AReturnList.Add(locBuffer^.Data^.Name);
locBuffer := locBuffer^.Next;
end;
end;
Result := AReturnList.Count;
end;
{ TBaseBinaryFormatter }
procedure TBaseBinaryFormatter.ClearStack();
@ -1122,10 +1144,10 @@ begin
Result := StackTop().GetItemCount();
end;
function TBaseBinaryFormatter.GetScopeItemNames(const AReturnList : TStrings
) : Integer;
function TBaseBinaryFormatter.GetScopeItemNames(const AReturnList : TStrings) : Integer;
begin
CheckScope();
Result := StackTop.GetScopeItemNames(AReturnList);
end;
procedure TBaseBinaryFormatter.EndScopeRead();
@ -1600,6 +1622,29 @@ begin
inherited Destroy();
end;
function TBaseBinaryFormatter.GetFormatName() : string;
begin
Result := sBINARY_FORMAT_NAME;
end;
procedure TBaseBinaryFormatter.WriteBuffer(const AValue: string);
var
locStore : IDataStoreReader;
bffr : PDataBuffer;
locStream : TStringStream;
begin
CheckScope();
locStream := TStringStream.Create(AValue);
try
locStream.Position := 0;
locStore := CreateBinaryReader(locStream);
bffr := LoadObjectFromStream(locStore);
AddObj(StackTop.ScopeObject,bffr);
finally
locStream.Free();
end;
end;
{ TArrayStackItem }
constructor TArrayStackItem.Create(const AScopeObject: PDataBuffer);
@ -1662,4 +1707,19 @@ begin
Result := False;
end;
function TArrayStackItem.GetScopeItemNames(const AReturnList: TStrings): Integer;
var
locBuffer : PDataBufferList;
i : PtrInt;
begin
AReturnList.Clear();
if Assigned(ScopeObject) and ( ScopeObject^.ArrayData^.Count > 0 ) then begin
locBuffer := ScopeObject^.ArrayData^.Items;
for i := 0 to Pred(ScopeObject^.ArrayData^.Count) do begin
AReturnList.Add(locBuffer^[i]^.Name);
end;
end;
Result := AReturnList.Count;
end;
end.

View File

@ -110,6 +110,7 @@ type
public
procedure SetSerializationStyle(const ASerializationStyle : TSerializationStyle);
function GetSerializationStyle():TSerializationStyle;
function GetFormatName() : string;
procedure Clear();
procedure BeginObject(
@ -163,6 +164,7 @@ type
var AData
);
function ReadBuffer(const AName : string) : string;
procedure WriteBuffer(const AValue : string);
procedure SaveToStream(AStream : TStream);
procedure LoadFromStream(AStream : TStream);
@ -231,7 +233,12 @@ begin
Result := FSerializationStyle;
end;
function TJsonRpcBaseFormatter.GetCurrentScope() : string;
function TJsonRpcBaseFormatter.GetFormatName(): string;
begin
Result := 'json';
end;
function TJsonRpcBaseFormatter.GetCurrentScope : string;
begin
CheckScope();
Result := '';
@ -349,6 +356,11 @@ begin
end;
procedure TJsonRpcBaseFormatter.WriteBuffer(const AValue: string);
begin
end;
procedure TJsonRpcBaseFormatter.SaveToStream(AStream : TStream);
begin

View File

@ -132,6 +132,7 @@ type
IFormatterBase = Interface
['{2AB3BF54-B7D6-4C46-8245-133C8775E9C1}']
function GetFormatName() : string;
procedure SetSerializationStyle(const ASerializationStyle : TSerializationStyle);
function GetSerializationStyle():TSerializationStyle;
function GetCurrentScope():string;
@ -188,6 +189,8 @@ type
var AData
);
function ReadBuffer(const AName : string) : string;
//Please use this method if and _only_ if you do not have another way achieve your aim!
procedure WriteBuffer(const AValue : string);
procedure SaveToStream(AStream : TStream);
procedure LoadFromStream(AStream : TStream);
@ -1238,15 +1241,10 @@ const
function IsStoredPropClass(AClass : TClass;PropInfo : PPropInfo) : TPropStoreType;
{$IFDEF FPC}
{$IFDEF FPC_211}
{$IFDEF HAS_FORMAT_SETTINGS}
var
wst_FormatSettings : TFormatSettings;
{$ENDIF}
{$ELSE}
var
wst_FormatSettings : TFormatSettings;
{$ENDIF}
{$ENDIF HAS_FORMAT_SETTINGS}
implementation
uses imp_utils, record_rtti;
@ -3512,7 +3510,7 @@ begin
lst.Delimiter := PROP_LIST_DELIMITER;
lst.DelimitedText := APropsStr;
for i := 0 to Pred(lst.Count) do
SetProperty(lst.Names[i],lst.ValueFromIndex[i]);
SetProperty(lst.Names[i],lst.Values[lst.Names[i]]);
finally
lst.Free();
end;
@ -4860,15 +4858,15 @@ begin
end;
initialization
{$IFDEF FPC}
{$IFDEF FPC_211}
wst_FormatSettings := DefaultFormatSettings;
wst_FormatSettings.DecimalSeparator := '.';
{$IFDEF HAS_FORMAT_SETTINGS}
{$IFDEF FPC}
wst_FormatSettings := DefaultFormatSettings;
wst_FormatSettings.DecimalSeparator := '.';
{$ELSE}
GetLocaleFormatSettings(GetThreadLocale(),wst_FormatSettings);
wst_FormatSettings.DecimalSeparator := '.';
{$ENDIF}
{$ELSE}
GetLocaleFormatSettings(GetThreadLocale(),wst_FormatSettings);
wst_FormatSettings.DecimalSeparator := '.';
{$ENDIF}
{$ENDIF HAS_FORMAT_SETTINGS}
TypeRegistryInstance := TTypeRegistry.Create();
SerializeOptionsRegistryInstance := TSerializeOptionsRegistry.Create();

View File

@ -73,6 +73,8 @@ type
property EmbeddedScopeCount : Integer read FEmbeddedScopeCount;
function BeginEmbeddedScope() : Integer;
function EndEmbeddedScope() : Integer;
function GetScopeItemNames(const AReturnList : TStrings) : Integer;virtual;
End;
{ TObjectStackItem }
@ -286,6 +288,7 @@ type
public
constructor Create();override;
destructor Destroy();override;
function GetFormatName() : string;
procedure Clear();
procedure BeginObject(
@ -339,6 +342,7 @@ type
var AData
);
function ReadBuffer(const AName : string) : string;
procedure WriteBuffer(const AValue : string);
procedure SaveToStream(AStream : TStream);
procedure LoadFromStream(AStream : TStream);
@ -390,6 +394,17 @@ begin
Result := FEmbeddedScopeCount;
end;
function TStackItem.GetScopeItemNames(const AReturnList: TStrings): Integer;
var
i : Integer;
begin
AReturnList.Clear();
for i := 0 to Pred(GetItemsCount()) do begin
AReturnList.Add(ScopeObject.childNodes.Item[i].nodeName);
end;
Result := AReturnList.Count;
end;
{ TObjectStackItem }
function TObjectStackItem.FindNode(var ANodeName: string): TDOMNode;
@ -497,7 +512,8 @@ end;
function TSOAPBaseFormatter.GetScopeItemNames(const AReturnList : TStrings) : Integer;
begin
CheckScope();
Result := StackTop().GetScopeItemNames(AReturnList);
end;
procedure TSOAPBaseFormatter.EndScopeRead();
@ -769,7 +785,9 @@ function TSOAPBaseFormatter.PutFloat(
Var
s, frmt : string;
prcsn : Integer;
{$IFDEF FPC} {$IFNDEF FPC_211} i : Integer; {$ENDIF}{$ENDIF}
{$IFNDEF HAS_FORMAT_SETTINGS}
i : Integer;
{$ENDIF HAS_FORMAT_SETTINGS}
begin
Case GetTypeData(ATypeInfo)^.FloatType Of
ftSingle,
@ -779,18 +797,14 @@ begin
ftExtended : prcsn := 15;
End;
frmt := '#.' + StringOfChar('#',prcsn) + 'E-0';
{$IFDEF FPC}
{$IFDEF FPC_211}
{$IFDEF HAS_FORMAT_SETTINGS}
s := FormatFloat(frmt,AData,wst_FormatSettings);
{$ELSE}
{$ELSE}
s := FormatFloat(frmt,AData);
i := Pos(',',s);
If ( i > 0 ) Then
if ( i > 0 ) then
s[i] := '.';
{$ENDIF}
{$ELSE}
s := FormatFloat(frmt,AData,wst_FormatSettings);
{$ENDIF}
{$ENDIF HAS_FORMAT_SETTINGS}
Result := InternalPutData(AName,ATypeInfo,s);
end;
@ -881,16 +895,11 @@ procedure TSOAPBaseFormatter.GetFloat(
var AData : Extended
);
begin
{$IFDEF FPC}
{$IFDEF FPC_211}
AData := StrToFloatDef(Trim(GetNodeValue(AName)),0,wst_FormatSettings);
{$ELSE}
AData := StrToFloatDef(Trim(GetNodeValue(AName)),0);
{$ENDIF}
{$IFDEF HAS_FORMAT_SETTINGS}
AData := StrToFloatDef(Trim(GetNodeValue(AName)),0,wst_FormatSettings);
{$ELSE}
AData := StrToFloatDef(Trim(GetNodeValue(AName)),0,wst_FormatSettings);
{$ENDIF}
//AData := StrToFloatDef(Trim(GetNodeValue(AName)),0,wst_FormatSettings);
AData := StrToFloatDef(TranslateDotToDecimalSeperator(Trim(GetNodeValue(AName))),0);
{$ENDIF HAS_FORMAT_SETTINGS}
end;
procedure TSOAPBaseFormatter.GetStr(
@ -1729,15 +1738,11 @@ begin
end;
tkFloat :
begin
{$IFDEF FPC}
{$IFDEF FPC_211}
{$IFDEF HAS_FORMAT_SETTINGS}
floatDt := StrToFloatDef(Trim(dataBuffer),0,wst_FormatSettings);
{$ELSE}
floatDt := StrToFloatDef(Trim(dataBuffer),0);
{$ENDIF}
{$ELSE}
floatDt := StrToFloatDef(Trim(dataBuffer),0,wst_FormatSettings);
{$ENDIF}
floatDt := StrToFloatDef(TranslateDotToDecimalSeperator(Trim(dataBuffer)),0);
{$ENDIF HAS_FORMAT_SETTINGS}
case GetTypeData(ATypeInfo)^.FloatType of
ftSingle : Single(AData) := floatDt;
ftDouble : Double(AData) := floatDt;
@ -1805,6 +1810,30 @@ begin
Raise ESOAPException.CreateFmt(AMsg,AArgs);
end;
function TSOAPBaseFormatter.GetFormatName() : string;
begin
Result := sPROTOCOL_NAME;
end;
procedure TSOAPBaseFormatter.WriteBuffer(const AValue: string);
var
strm : TStringStream;
locDoc : TwstXMLDocument;
locNode : TDOMNode;
begin
CheckScope();
locDoc := nil;
strm := TStringStream.Create(AValue);
try
ReadXMLFile(locDoc,strm);
locNode := locDoc.DocumentElement.CloneNode(True {$IFDEF FPC}, StackTop().ScopeObject.OwnerDocument{$ENDIF});
StackTop().ScopeObject.AppendChild(locNode);
finally
ReleaseDomNode(locDoc);
strm.Free();
end;
end;
{ TScopedArrayStackItem }
function TScopedArrayStackItem.CreateList(const ANodeName : string): TDOMNodeList;

View File

@ -57,7 +57,7 @@ const
'string', 'int', 'boolean', 'double', 'dateTime.iso8601', 'base64',
'struct', 'array'
);
type
{ ESOAPException }
@ -65,7 +65,7 @@ type
end;
TFoundState = ( fsNone, fsFoundNonNil, fsFoundNil );
{ TStackItem }
TStackItem = class
@ -87,6 +87,8 @@ type
property ScopeType : TScopeType Read FScopeType;
property ItemsCount : Integer read GetItemsCount;
property FoundState : TFoundState read FFoundState;
function GetScopeItemNames(const AReturnList : TStrings) : Integer;virtual;abstract;
end;
{ TObjectStackItem }
@ -98,21 +100,36 @@ type
Const AName : string;
const ADataType : TXmlRpcDataType
):TDOMNode;override;
function GetScopeItemNames(const AReturnList : TStrings) : Integer;override;
end;
TBaseArrayStackItem = class(TStackItem)
private
FItemList : TDOMNodeList;
FIndex : Integer;
FIndexStack : array of Integer;
FIndexStackIDX : Integer;
private
function PushIndex(const AValue : Integer) : Integer;
function PopIndex() : Integer;
public
destructor Destroy();override;
function GetScopeItemNames(const AReturnList : TStrings) : Integer;override;
end;
{ TArrayStackItem }
TArrayStackItem = class(TStackItem)
TArrayStackItem = class(TBaseArrayStackItem)
private
FItemList : TDOMNodeList;
FIndex : Integer;
FDataScope : TDOMNode;
protected
procedure EnsureListCreated();
function GetItemsCount() : Integer;override;
function CreateList():TDOMNodeList;
function PushIndex(const AValue : Integer) : Integer;
function PopIndex() : Integer;
public
destructor Destroy();override;
function FindNode(var ANodeName : string):TDOMNode;override;
function CreateBuffer(
Const AName : string;
@ -122,16 +139,12 @@ type
{ TParamsArrayStackItem }
TParamsArrayStackItem = class(TStackItem)
private
FItemList : TDOMNodeList;
FIndex : Integer;
TParamsArrayStackItem = class(TBaseArrayStackItem)
protected
procedure EnsureListCreated();
function GetItemsCount() : Integer;override;
function CreateList():TDOMNodeList;
public
destructor Destroy();override;
function FindNode(var ANodeName : string):TDOMNode;override;
function CreateBuffer(
Const AName : string;
@ -287,6 +300,7 @@ type
public
constructor Create();override;
destructor Destroy();override;
function GetFormatName() : string;
procedure Clear();
procedure BeginObject(
@ -340,6 +354,7 @@ type
var AData
);
function ReadBuffer(const AName : string) : string;
procedure WriteBuffer(const AValue : string);
procedure SaveToStream(AStream : TStream);
procedure LoadFromStream(AStream : TStream);
@ -444,6 +459,35 @@ begin
nd.AppendChild(Result);
end;
function TObjectStackItem.GetScopeItemNames(const AReturnList: TStrings): Integer;
var
memberNode, tmpNode : TDOMNode;
i : Integer;
chilNodes : TDOMNodeList;
begin
AReturnList.Clear();
if ScopeObject.HasChildNodes() then begin
memberNode := ScopeObject.FirstChild;
while ( memberNode <> nil ) do begin
if memberNode.HasChildNodes() then begin
chilNodes := memberNode.ChildNodes;
for i := 0 to Pred(GetNodeListCount(chilNodes)) do begin
tmpNode := chilNodes.Item[i];
if AnsiSameText(sNAME,tmpNode.NodeName) then begin
if ( tmpNode.FirstChild <> nil ) then
AReturnList.Add(tmpNode.FirstChild.NodeValue)
else
AReturnList.Add('');
Break;
end;
end;
end;
memberNode := memberNode.NextSibling;
end;
end;
Result := AReturnList.Count;
end;
{ TArrayStackItem }
procedure TArrayStackItem.EnsureListCreated();
@ -472,13 +516,6 @@ begin
end;
end;
destructor TArrayStackItem.Destroy();
begin
if Assigned(FItemList) then
ReleaseDomNode(FItemList);
inherited Destroy();
end;
function TArrayStackItem.FindNode(var ANodeName: string): TDOMNode;
begin
EnsureListCreated();
@ -516,6 +553,26 @@ begin
nd.AppendChild(Result);
end;
function TArrayStackItem.PushIndex(const AValue: Integer): Integer;
begin
if ( FIndexStackIDX = Length(FIndexStack) ) then begin
if ( Length(FIndexStack) = 0 ) then
FIndexStackIDX := -1;
SetLength(FIndexStack, Length(FIndexStack) + 4);
end;
Result := FIndex;
Inc(FIndexStackIDX);
FIndexStack[FIndexStackIDX] := AValue;
end;
function TArrayStackItem.PopIndex() : Integer;
begin
if ( Length(FIndexStack) = 0 ) or ( FIndexStackIDX < 0 ) then
raise EXmlRpcException.Create('TArrayStackItem.PopIndex() >> No saved index.');
FIndex := FIndexStack[FIndexStackIDX];
Dec(FIndexStackIDX);
end;
{ TXmlRpcBaseFormatter }
procedure TXmlRpcBaseFormatter.ClearStack();
@ -564,10 +621,10 @@ begin
Result := InternalBeginScopeRead(AScopeName,ATypeInfo,stArray,AStyle,AItemName);
end;
function TXmlRpcBaseFormatter.GetScopeItemNames(const AReturnList : TStrings
) : Integer;
function TXmlRpcBaseFormatter.GetScopeItemNames(const AReturnList : TStrings) : Integer;
begin
CheckScope();
Result := StackTop.GetScopeItemNames(AReturnList);
end;
procedure TXmlRpcBaseFormatter.EndScopeRead();
@ -858,16 +915,11 @@ procedure TXmlRpcBaseFormatter.GetFloat(
var AData : Extended
);
begin
{$IFDEF FPC}
{$IFDEF FPC_211}
AData := StrToFloatDef(Trim(GetNodeValue(AName)),0,wst_FormatSettings);
{$ELSE}
AData := StrToFloatDef(Trim(GetNodeValue(AName)),0);
{$ENDIF}
{$IFDEF HAS_FORMAT_SETTINGS}
AData := StrToFloatDef(Trim(GetNodeValue(AName)),0,wst_FormatSettings);
{$ELSE}
AData := StrToFloatDef(Trim(GetNodeValue(AName)),0,wst_FormatSettings);
{$ENDIF}
//AData := StrToFloatDef(Trim(GetNodeValue(AName)),0,wst_FormatSettings);
AData := StrToFloatDef(TranslateDotToDecimalSeperator(Trim(GetNodeValue(AName))),0);
{$ENDIF HAS_FORMAT_SETTINGS}
end;
procedure TXmlRpcBaseFormatter.GetStr(
@ -1375,16 +1427,11 @@ begin
end;
tkFloat :
begin
{$IFDEF FPC}
{$IFDEF FPC_211}
{$IFDEF HAS_FORMAT_SETTINGS}
floatDt := StrToFloatDef(Trim(dataBuffer),0,wst_FormatSettings);
{$ELSE}
floatDt := StrToFloatDef(Trim(dataBuffer),0);
{$ENDIF}
{$ELSE}
floatDt := StrToFloatDef(Trim(dataBuffer),0,wst_FormatSettings);
{$ENDIF}
//floatDt := StrToFloatDef(Trim(dataBuffer),0,wst_FormatSettings);
floatDt := StrToFloatDef(TranslateDotToDecimalSeperator(Trim(dataBuffer)),0);
{$ENDIF HAS_FORMAT_SETTINGS}
case GetTypeData(ATypeInfo)^.FloatType of
ftSingle : Single(AData) := floatDt;
ftDouble : Double(AData) := floatDt;
@ -1440,7 +1487,30 @@ procedure TXmlRpcBaseFormatter.Error(const AMsg: string;const AArgs: array of co
begin
Raise EXmlRpcException.CreateFmt(AMsg,AArgs);
end;
function TXmlRpcBaseFormatter.GetFormatName() : string;
begin
Result := sPROTOCOL_NAME;
end;
procedure TXmlRpcBaseFormatter.WriteBuffer(const AValue: string);
var
strm : TStringStream;
locDoc : TwstXMLDocument;
locNode : TDOMNode;
begin
CheckScope();
locDoc := nil;
strm := TStringStream.Create(AValue);
try
ReadXMLFile(locDoc,strm);
locNode := locDoc.DocumentElement.CloneNode(True {$IFDEF FPC}, StackTop().ScopeObject.OwnerDocument{$ENDIF});
StackTop().ScopeObject.AppendChild(locNode);
finally
ReleaseDomNode(locDoc);
strm.Free();
end;
end;
{ TParamsArrayStackItem }
@ -1470,13 +1540,6 @@ begin
end;
end;
destructor TParamsArrayStackItem.Destroy();
begin
if Assigned(FItemList) then
ReleaseDomNode(FItemList);
inherited Destroy();
end;
function TParamsArrayStackItem.FindNode(var ANodeName: string): TDOMNode;
begin
EnsureListCreated();
@ -1511,4 +1574,55 @@ begin
valueNode.AppendChild(Result);
end;
{ TBaseArrayStackItem }
destructor TBaseArrayStackItem.Destroy;
begin
SetLength(FIndexStack,0);
if Assigned(FItemList) then
ReleaseDomNode(FItemList);
inherited Destroy();
end;
function TBaseArrayStackItem.GetScopeItemNames(const AReturnList: TStrings): Integer;
var
i : Integer;
locName : string;
begin
AReturnList.Clear();
PushIndex(0);
try
locName := '';
for i := 0 to Pred(GetItemsCount()) do begin
FindNode(locName);
AReturnList.Add(locName);
end;
finally
PopIndex();
end;
Result := AReturnList.Count;
end;
function TBaseArrayStackItem.PopIndex() : Integer;
begin
if ( Length(FIndexStack) = 0 ) or ( FIndexStackIDX < 0 ) then
raise EXmlRpcException.Create('TArrayStackItem.PopIndex() >> No saved index.');
Result := FIndex;
FIndex := FIndexStack[FIndexStackIDX];
Dec(FIndexStackIDX);
end;
function TBaseArrayStackItem.PushIndex(const AValue: Integer): Integer;
begin
if ( FIndexStackIDX = Length(FIndexStack) ) then begin
if ( Length(FIndexStack) = 0 ) then
FIndexStackIDX := -1;
SetLength(FIndexStack, Length(FIndexStack) + 4);
end;
Inc(FIndexStackIDX);
Result := FIndex;
FIndex := AValue;
FIndexStack[FIndexStackIDX] := Result;
end;
end.

View File

@ -45,6 +45,7 @@ Type
function IsStrEmpty(Const AStr:String):Boolean;{$IFDEF USE_INLINE}inline;{$ENDIF}
function GetToken(var ABuffer : string; const ADelimiter : string): string;
function ExtractOptionName(const ACompleteName : string):string;
function TranslateDotToDecimalSeperator(const Value: string) : string;
implementation
uses wst_types;
@ -86,6 +87,17 @@ begin
Result := Trim(Result);
end;
function TranslateDotToDecimalSeperator(const Value: string) : string;
var
i : PtrInt;
begin
Result := Value;
for i := 1 to length(Result) do begin
if ( Result[i] = '.' ) then
Result[i] := DecimalSeparator;
end;
end;
{ TPublishedPropertyManager }
procedure TPublishedPropertyManager.Error(const AMsg: string);
@ -124,9 +136,9 @@ begin
end;
procedure TPublishedPropertyManager.SetProperties(const APropsStr: string);
Var
var
lst : TStringList;
i : Integer;
i : PtrInt;
begin
If IsStrEmpty(APropsStr) Then
Exit;
@ -135,8 +147,8 @@ begin
lst.QuoteChar := #0;
lst.Delimiter := PROP_LIST_DELIMITER;
lst.DelimitedText := APropsStr;
For i := 0 To Pred(lst.Count) Do
SetProperty(lst.Names[i],lst.ValueFromIndex[i]);
for i := 0 to Pred(lst.Count) do
SetProperty(lst.Names[i],lst.Values[lst.Names[i]]);
Finally
lst.Free();
End;

View File

@ -30,6 +30,9 @@ type
TTestEnum = ( teOne, teTwo, teThree, teFour );
TArrayOfStringRemotableSample = class(TArrayOfStringRemotable)
end;
{ TClass_A }
TClass_A = class(TBaseComplexRemotable)
@ -334,59 +337,65 @@ type
{ TTestFormatter }
TTestFormatter= class(TTestFormatterSimpleType)
TTestFormatter = class(TTestFormatterSimpleType)
protected
class function GetFormaterName() : string;virtual;abstract;
published
procedure Test_Int_WithClass;
procedure Test_Float_WithClass;
procedure Test_Enum_Bool_String_WithClass;
procedure Test_CplxInt64SimpleContent_WithClass;
procedure Test_CplxInt32SimpleContent_WithClass;
procedure Test_CplxInt16SimpleContent_WithClass;
procedure Test_CplxInt8SimpleContent_WithClass;
procedure Test_CplxFloatExtendedSimpleContent_WithClass;
procedure Test_CplxStringSimpleContent_WithClass;
procedure Test_Object();
procedure Test_Object_Nil();
procedure Test_StringArray();
procedure Test_StringArray_Embedded();
procedure Test_StringArrayZeroLength();
procedure Test_BooleanArray();
procedure Test_Int8UArray();
procedure Test_Int8SArray();
procedure Test_Int16SArray();
procedure Test_Int16UArray();
procedure Test_Int32UArray();
procedure Test_Int32SArray();
procedure Test_Int64SArray();
procedure Test_Int64UArray();
procedure Test_FloatSingleArray();
procedure Test_FloatDoubleArray();
procedure Test_FloatExtendedArray();
procedure Test_FloatCurrencyArray();
procedure Test_ComplexInt32S();
procedure Test_Record_simple();
procedure Test_Record_nested();
procedure test_GetScopeItemNames();
procedure test_GetFormaterName();
end;
{ TTestBinaryFormatter }
TTestBinaryFormatter= class(TTestFormatter)
protected
class function GetFormaterName() : string;override;
function CreateFormatter(ARootType : PTypeInfo):IFormatterBase;override;
published
procedure test_WriteBuffer();
end;
{ TTestBinaryFormatterAttributes }
@ -400,7 +409,10 @@ type
TTestSOAPFormatter= class(TTestFormatter)
protected
class function GetFormaterName() : string;override;
function CreateFormatter(ARootType : PTypeInfo):IFormatterBase;override;
published
procedure test_WriteBuffer();
end;
{ TTestSOAPFormatterAttributes }
@ -416,12 +428,15 @@ type
protected
function CreateFormatter(ARootType : PTypeInfo):IFormatterBase;override;
end;
TTestXmlRpcFormatter= class(TTestFormatter)
protected
class function GetFormaterName() : string;override;
function CreateFormatter(ARootType : PTypeInfo):IFormatterBase;override;
function Support_ComplextType_with_SimpleContent():Boolean;override;
function Support_nil():Boolean;override;
published
procedure test_WriteBuffer();
end;
{ TTestArray }
@ -530,6 +545,152 @@ uses base_binary_formatter, base_soap_formatter, base_xmlrpc_formatter, record_r
server_service_xmlrpc, xmlrpc_formatter,
binary_streamer, server_binary_formatter, binary_formatter;
function CompareNodes(const A,B : PDataBuffer) : Boolean;overload;forward;
function CompareObjectBuffers(const A,B : PObjectBuffer) : Boolean;overload;
var
ca, cb : PObjectBufferItem;
ok : Boolean;
begin
if ( A = nil ) and ( B = nil ) then begin
Result := True
end else if ( A <> nil ) and ( B <> nil ) then begin
if ( A^.NilObject = B^.NilObject ) and
( A^.Count = B^.Count ) and
( CompareNodes(A^.InnerData,B^.InnerData) )
then begin
if ( A^.Count > 0 ) then begin
ca := A^.Head;
cb := B^.Head;
while Assigned(ca) do begin
if not CompareNodes(ca^.Data,cb^.Data) then
Break;
ca := ca^.Next;
cb := cb^.Next;
end;
ok := ( ca = nil );
end else begin
ok := True;
end;
end else begin
ok := False;
end;
if ok then
Result := CompareObjectBuffers(A^.Attributes,B^.Attributes);
end else begin
Result := False;
end;
end;
function CompareObjectBuffers(const A,B : PArrayBuffer) : Boolean;overload;
var
i : Integer;
ok : Boolean;
begin
if ( A = nil ) and ( B = nil ) then begin
Result := ok
end else if ( A <> nil ) and ( B <> nil ) then begin
if ( A^.Count = B^.Count ) then begin
ok := True;
if ( A^.Count > 0 ) then begin
for i := 0 to Pred(A^.Count) do begin
if not CompareNodes(A^.Items^[i],B^.Items^[i]) then begin
ok := False;
Break;
end;
end;
end;
if ok then
ok := CompareObjectBuffers(A^.Attributes,B^.Attributes);
end else begin
ok := False;
end;
end else begin
Result := ok;
end;
Result := ok;
end;
function CompareNodes(const A,B : PDataBuffer) : Boolean;overload;
var
ca, cb : PObjectBufferItem;
i : PtrInt;
ok : Boolean;
begin
if ( A = nil ) and ( B = nil ) then begin
ok := True;
end else if ( A <> nil ) and ( B <> nil ) then begin
ok := False;
if ( A^.DataType = B^.DataType ) and
( A^.Name = B^.Name )
then begin
case A^.DataType of
dtInt8U,dtInt8S : ok := ( A^.Int8U = A^.Int8U );
dtInt16U,dtInt16S : ok := ( A^.Int16U = A^.Int16U );
dtInt32U,dtInt32S : ok := ( A^.Int32U = A^.Int32U );
dtInt64U,dtInt64S : ok := ( A^.Int64U = A^.Int64U );
dtBool : ok := ( A^.BoolData = A^.BoolData );
dtEnum : ok := ( A^.EnumData = A^.EnumData );
dtSingle : ok := ( A^.SingleData = A^.SingleData );
dtDouble : ok := ( A^.DoubleData = A^.DoubleData );
dtExtended : ok := ( A^.ExtendedData = A^.ExtendedData );
dtCurrency : ok := ( A^.CurrencyData = A^.CurrencyData );
dtString : ok := ( A^.StrData = A^.StrData );
dtObject : ok := CompareObjectBuffers(A^.ObjectData,B^.ObjectData);
dtArray : ok := CompareObjectBuffers(A^.ArrayData,B^.ArrayData);
end;
end;
end else begin
ok := False;
end;
Result := ok;
end;
function CompareNodes(const A,B : TDOMNode) : Boolean;overload;
var
ca, cb : TDOMNode;
i : PtrInt;
begin
if ( A = nil ) and ( B = nil ) then begin
Result := True;
end else if ( A <> nil ) and ( B <> nil ) then begin
Result := False;
if ( A.NodeName = B.NodeName ) and
( A.NodeValue = B.NodeValue )
then begin
if ( ( A.FirstChild = nil ) and ( B.FirstChild = nil ) ) or
( ( A.FirstChild <> nil ) and ( B.FirstChild <> nil ) )
then begin
ca := a.FirstChild;
cb := b.FirstChild;
while ( ca <> nil ) do begin
if not CompareNodes(ca,cb) then
Exit;
ca := ca.NextSibling;
cb := cb.NextSibling;
end;
if ( ( A.Attributes = nil ) and ( B.Attributes = nil ) ) or
( ( A.Attributes <> nil ) and ( B.Attributes <> nil ) )
then begin
if ( A.Attributes <> nil ) then begin
if ( A.Attributes.Length <> B.Attributes.Length ) then
Exit;
if ( A.Attributes.Length > 0 ) then begin
for i := 0 to Pred(A.Attributes.Length) do begin
if not CompareNodes(A.Attributes.Item[i],B.Attributes.Item[i]) then
Exit;
end;
end;
end;
Result := True;
end;
end;
end;
end else begin
Result := False;
end;
end;
function TTestFormatterSimpleType.Support_ComplextType_with_SimpleContent( ): Boolean;
begin
Result := True;
@ -2717,10 +2878,12 @@ Var
a, b : TClass_A;
x : string;
ls : TStringList;
intv : TArrayOfStringRemotableSample;
begin
ls := nil;
s := Nil;
b := nil;
intv := nil;
a := TClass_A.Create();
try
a.Val_Bool := False;
@ -2728,17 +2891,25 @@ begin
a.Val_String := '123';
a.Val_32S := 55;
b := TClass_A.Create();
intv := TArrayOfStringRemotableSample.Create();
intv.SetLength(3);
intv[0] := 'wst';
intv[1] := 'azerty';
intv[2] := 'qwerty';
f := CreateFormatter(TypeInfo(TClass_A));
f.BeginObject('Root',TypeInfo(TClass_A));
f.Put('a',TypeInfo(TClass_A),a);
f.Put('b',TypeInfo(TClass_A),b);
f.Put('intv',TypeInfo(TArrayOfStringRemotable),intv);
f.EndScope();
s := TMemoryStream.Create();
f.SaveToStream(s);
FreeAndNil(a);
FreeAndNil(b);
FreeAndNil(intv);
ls := TStringList.Create();
f := CreateFormatter(TypeInfo(TClass_A));
@ -2746,13 +2917,37 @@ begin
f.LoadFromStream(s);
x := 'Root';
f.BeginObjectRead(x,TypeInfo(TClass_A));
CheckEquals(0, f.GetScopeItemNames(ls), 'GetScopeItemNames.Count()');
Check( ls.IndexOf('Val_Bool') >= 0 );
Check( ls.IndexOf('Val_Enum') >= 0 );
Check( ls.IndexOf('Val_String') >= 0 );
Check( ls.IndexOf('Val_32S') >= 0 );
CheckEquals(3, f.GetScopeItemNames(ls), 'GetScopeItemNames.Count(Root)');
Check( ls.IndexOf('a') >= 0 );
Check( ls.IndexOf('b') >= 0 );
Check( ls.IndexOf('intv') >= 0 );
x := 'a';
f.BeginObjectRead(x,TypeInfo(TClass_A));
CheckEquals(4, f.GetScopeItemNames(ls), 'GetScopeItemNames.Count(a)');
Check( ls.IndexOf('Val_Bool') >= 0 );
Check( ls.IndexOf('Val_Enum') >= 0 );
Check( ls.IndexOf('Val_String') >= 0 );
Check( ls.IndexOf('Val_32S') >= 0 );
f.EndScopeRead();
x := 'b';
f.BeginObjectRead(x,TypeInfo(TClass_A));
CheckEquals(4, f.GetScopeItemNames(ls), 'GetScopeItemNames.Count(b)');
Check( ls.IndexOf('Val_Bool') >= 0 );
Check( ls.IndexOf('Val_Enum') >= 0 );
Check( ls.IndexOf('Val_String') >= 0 );
Check( ls.IndexOf('Val_32S') >= 0 );
f.EndScopeRead();
x := 'intv';
f.BeginArrayRead(x,TypeInfo(TArrayOfStringRemotableSample),asScoped,'OI');
CheckEquals(3, f.GetScopeItemNames(ls), 'GetScopeItemNames.Count(intv)');
//Check( ls.IndexOf('OI') >= 0 );
f.EndScopeRead();
f.EndScopeRead();
finally
intv.Free();
ls.Free();
b.Free();;
a.Free();
@ -2769,6 +2964,51 @@ begin
//Result.BeginObject('root',Nil);
end;
class function TTestBinaryFormatter.GetFormaterName(): string;
begin
Result := 'wst-binary';
end;
procedure TTestBinaryFormatter.test_WriteBuffer();
var
bw : IDataStore;
br : IDataStoreReader;
f : IFormatterBase;
strm : TStringStream;
a, b, tmp : PDataBuffer;
locBuffer : string;
begin
a := CreateObjBuffer(dtObject,'a',nil);
CreateObjBuffer(dtString,'aa',a)^.StrData^.Data := 'val_aa';
tmp := CreateObjBuffer(dtObject,'b',a);
tmp := CreateObjBuffer(dtObject,'c',tmp);
CreateObjBuffer(dtInt32U,'i',tmp)^.Int32S := 1210;
CreateObjBuffer(dtString,'s',tmp)^.StrData^.Data := 's string sample';
b := nil;
strm := TStringStream.Create('');
try
bw := CreateBinaryWriter(strm);
SaveObjectToStream(a,bw);
strm.Position := 0;
locBuffer := strm.DataString;
f := TBaseBinaryFormatter.Create() as IFormatterBase;
//f.BeginObject('Root',TypeInfo(TClass_A)); //done in the constructor!
f.WriteBuffer(locBuffer);
//f.EndScope();
strm.Size := 0;
f.SaveToStream(strm);
strm.Position := 0;
br := CreateBinaryReader(strm);
b := LoadObjectFromStream(br);
Check(CompareNodes(a,b^.ObjectData^.Head^.Data));
finally
strm.Free();
ClearObj(a);
ClearObj(b);
end;
end;
{ TTestSOAPFormatter }
function TTestSOAPFormatter.CreateFormatter(ARootType : PTypeInfo):IFormatterBase;
@ -2777,6 +3017,53 @@ begin
Result.BeginObject('Env',ARootType)
end;
class function TTestSOAPFormatter.GetFormaterName(): string;
begin
Result := 'SOAP';
end;
procedure TTestSOAPFormatter.test_WriteBuffer();
const
s_XML_BUFFER =
'<?xml version="1.0"?> ' +
'<a aa="val_aa"> ' +
' <b> ' +
' <c cc="cc_val"> ' +
' <i>-76</i> ' +
' <s>wst record sample</s> ' +
' </c> ' +
' </b> ' +
'</a>';
var
f : IFormatterBase;
strm : TMemoryStream;
da, db : TXMLDocument;
begin
f := TSOAPBaseFormatter.Create() as IFormatterBase;
f.BeginObject('Root',TypeInfo(TClass_A));
f.WriteBuffer(s_XML_BUFFER);
f.EndScope();
da := nil;
db := nil;
strm := TMemoryStream.Create();
try
f.SaveToStream(strm);
strm.Position := 0;
ReadXMLFile(da,strm);
strm.Size := 0;
strm.WriteBuffer(s_XML_BUFFER[1],Length(s_XML_BUFFER));
strm.Position := 0;
ReadXMLFile(db,strm);
Check(CompareNodes(da.DocumentElement.FirstChild,db.DocumentElement));
finally
ReleaseDomNode(da);
ReleaseDomNode(db);
strm.Free();
end;
end;
{ TClass_B }
procedure TClass_B.SetObjProp(const AValue: TClass_A);
@ -3399,6 +3686,11 @@ begin
Result := TXmlRpcBaseFormatter.Create() as IFormatterBase;
end;
class function TTestXmlRpcFormatter.GetFormaterName(): string;
begin
Result := 'XMLRPC';
end;
function TTestXmlRpcFormatter.Support_ComplextType_with_SimpleContent(): Boolean;
begin
Result := False;
@ -3409,6 +3701,48 @@ begin
Result := False;
end;
procedure TTestXmlRpcFormatter.test_WriteBuffer();
const
s_XML_BUFFER =
'<?xml version="1.0"?> ' +
'<a aa="val_aa"> ' +
' <b> ' +
' <c cc="cc_val"> ' +
' <i>-76</i> ' +
' <s>wst record sample</s> ' +
' </c> ' +
' </b> ' +
'</a>';
var
f : IFormatterBase;
strm : TMemoryStream;
da, db : TXMLDocument;
begin
f := TXmlRpcBaseFormatter.Create() as IFormatterBase;
f.BeginObject('Root',TypeInfo(TClass_A));
f.WriteBuffer(s_XML_BUFFER);
f.EndScope();
da := nil;
db := nil;
strm := TMemoryStream.Create();
try
f.SaveToStream(strm);
strm.Position := 0;
ReadXMLFile(da,strm);
strm.Size := 0;
strm.WriteBuffer(s_XML_BUFFER[1],Length(s_XML_BUFFER));
strm.Position := 0;
ReadXMLFile(db,strm);
Check(CompareNodes(da.DocumentElement.FirstChild,db.DocumentElement));
finally
ReleaseDomNode(da);
ReleaseDomNode(db);
strm.Free();
end;
end;
{ TTest_SoapFormatterExceptionBlock }
function TTest_SoapFormatterExceptionBlock.CreateFormatter() : IFormatterResponse;
@ -3913,6 +4247,14 @@ begin
end;
end;
procedure TTestFormatter.test_GetFormaterName();
var
f : IFormatterBase;
begin
f := CreateFormatter(TypeInfo(TClass_A));
CheckEquals(Self.GetFormaterName(),f.GetFormatName());
end;
initialization
RegisterStdTypes();
GetTypeRegistry().Register(sXSD_NS,TypeInfo(TTestEnum),'TTestEnum').RegisterExternalPropertyName('teOne', '1');
@ -3927,10 +4269,10 @@ initialization
GetTypeRegistry().Register(sXSD_NS,TypeInfo(T_ComplexInt16SContent),'T_ComplexInt16SContent');
GetTypeRegistry().Register(sXSD_NS,TypeInfo(T_ComplexInt16UContent),'T_ComplexInt16UContent');
GetTypeRegistry().Register(sXSD_NS,TypeInfo(T_ComplexFloatExtendedContent),'T_ComplexFloatExtendedContent');
GetTypeRegistry().Register(sXSD_NS,TypeInfo(T_ComplexFloatDoubleContent),'T_ComplexFloatDoubleContent');
TClass_CplxSimpleContent.RegisterAttributeProperty('Elt_Exemple');
GetTypeRegistry().Register(sXSD_NS,TypeInfo(TClass_CplxSimpleContent),'TClass_CplxSimpleContent').RegisterExternalPropertyName('Elt_Exemple', 'published');
@ -3938,6 +4280,10 @@ initialization
RegisterExternalPropertyName(sARRAY_ITEM,'abc');
RegisterExternalPropertyName(sARRAY_STYLE,sEmbedded);
end;
with GetTypeRegistry().Register(sWST_BASE_NS,TypeInfo(TArrayOfStringRemotableSample),'TArrayOfStringRemotableSample') do begin
RegisterExternalPropertyName(sARRAY_ITEM,'OI');
RegisterExternalPropertyName(sARRAY_STYLE,sScoped);
end;
GetTypeRegistry().Register(sWST_BASE_NS,TypeInfo(TTestSmallRecord),'TTestSmallRecord').RegisterExternalPropertyName('__FIELDS__','fieldSmallint;fieldWord;fieldString');
{$IFNDEF WST_RECORD_RTTI}

View File

@ -7,7 +7,7 @@
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="16"/>
<ActiveEditorIndexAtStart Value="15"/>
</General>
<PublishOptions>
<Version Value="2"/>
@ -27,7 +27,7 @@
<PackageName Value="FPCUnitTestRunner"/>
</Item1>
</RequiredPackages>
<Units Count="74">
<Units Count="72">
<Unit0>
<Filename Value="wst_test_suite.lpr"/>
<IsPartOfProject Value="True"/>
@ -40,12 +40,12 @@
<Filename Value="testformatter_unit.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="testformatter_unit"/>
<CursorPos X="57" Y="195"/>
<TopLine Value="181"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="0"/>
<UsageCount Value="200"/>
<Bookmarks Count="1">
<Item0 X="17" Y="1060" ID="3"/>
<Item0 X="17" Y="1105" ID="3"/>
</Bookmarks>
<Loaded Value="True"/>
</Unit1>
@ -69,8 +69,8 @@
<Filename Value="..\..\base_binary_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="base_binary_formatter"/>
<CursorPos X="3" Y="1358"/>
<TopLine Value="1346"/>
<CursorPos X="1" Y="463"/>
<TopLine Value="448"/>
<EditorIndex Value="14"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
@ -79,8 +79,8 @@
<Filename Value="..\..\base_service_intf.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="base_service_intf"/>
<CursorPos X="3" Y="152"/>
<TopLine Value="152"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="13"/>
<UsageCount Value="200"/>
<Bookmarks Count="2">
@ -93,8 +93,8 @@
<Filename Value="..\..\base_soap_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="base_soap_formatter"/>
<CursorPos X="92" Y="1568"/>
<TopLine Value="1561"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="1"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
@ -176,7 +176,7 @@
<UnitName Value="DOM"/>
<CursorPos X="15" Y="429"/>
<TopLine Value="413"/>
<UsageCount Value="3"/>
<UsageCount Value="1"/>
</Unit15>
<Unit16>
<Filename Value="..\..\server_service_intf.pas"/>
@ -191,21 +191,21 @@
<UnitName Value="service_intf"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="17"/>
<UsageCount Value="15"/>
</Unit17>
<Unit18>
<Filename Value="..\..\imp_utils.pas"/>
<UnitName Value="imp_utils"/>
<CursorPos X="1" Y="105"/>
<TopLine Value="90"/>
<UsageCount Value="9"/>
<UsageCount Value="7"/>
</Unit18>
<Unit19>
<Filename Value="..\..\..\..\..\lazarusClean\fpc\2.0.4\source\fcl\xml\xmlread.pp"/>
<UnitName Value="XMLRead"/>
<CursorPos X="43" Y="13"/>
<TopLine Value="1"/>
<UsageCount Value="3"/>
<UsageCount Value="1"/>
</Unit19>
<Unit20>
<Filename Value="test_parserdef.pas"/>
@ -219,21 +219,21 @@
<Filename Value="..\..\wst.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<UsageCount Value="8"/>
</Unit21>
<Unit22>
<Filename Value="..\test_fpc\interface_problem\interface_problem.pas"/>
<UnitName Value="interface_problem"/>
<CursorPos X="1" Y="10"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<UsageCount Value="8"/>
</Unit22>
<Unit23>
<Filename Value="..\..\base_xmlrpc_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="base_xmlrpc_formatter"/>
<CursorPos X="3" Y="1242"/>
<TopLine Value="1224"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="10"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
@ -243,7 +243,7 @@
<UnitName Value="PScanner"/>
<CursorPos X="19" Y="505"/>
<TopLine Value="491"/>
<UsageCount Value="7"/>
<UsageCount Value="5"/>
</Unit24>
<Unit25>
<Filename Value="..\..\ws_helper\pascal_parser_intf.pas"/>
@ -251,7 +251,7 @@
<CursorPos X="3" Y="174"/>
<TopLine Value="165"/>
<EditorIndex Value="9"/>
<UsageCount Value="46"/>
<UsageCount Value="58"/>
<Loaded Value="True"/>
</Unit25>
<Unit26>
@ -259,46 +259,46 @@
<UnitName Value="PasTree"/>
<CursorPos X="3" Y="75"/>
<TopLine Value="68"/>
<UsageCount Value="7"/>
<UsageCount Value="5"/>
</Unit26>
<Unit27>
<Filename Value="..\..\..\..\..\..\lazarus_23_215\fpc\2.1.5\source\packages\fcl-xml\src\dom.pp"/>
<UnitName Value="DOM"/>
<CursorPos X="38" Y="225"/>
<TopLine Value="203"/>
<UsageCount Value="6"/>
<UsageCount Value="4"/>
</Unit27>
<Unit28>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\dom.pp"/>
<UnitName Value="DOM"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="5"/>
<UsageCount Value="3"/>
</Unit28>
<Unit29>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-base\src\inc\contnrs.pp"/>
<UnitName Value="contnrs"/>
<CursorPos X="3" Y="1376"/>
<TopLine Value="1370"/>
<UsageCount Value="6"/>
<UsageCount Value="4"/>
</Unit29>
<Unit30>
<Filename Value="..\..\wst_delphi.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<UsageCount Value="8"/>
</Unit30>
<Unit31>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\objpash.inc"/>
<CursorPos X="8" Y="142"/>
<TopLine Value="197"/>
<UsageCount Value="6"/>
<UsageCount Value="4"/>
</Unit31>
<Unit32>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\objpas.inc"/>
<CursorPos X="11" Y="333"/>
<TopLine Value="375"/>
<UsageCount Value="10"/>
<UsageCount Value="8"/>
</Unit32>
<Unit33>
<Filename Value="..\..\wst_fpc_xml.pas"/>
@ -309,56 +309,50 @@
<UsageCount Value="201"/>
</Unit33>
<Unit34>
<Filename Value="..\..\wst_global.inc"/>
<CursorPos X="3" Y="4"/>
<TopLine Value="1"/>
<UsageCount Value="1"/>
</Unit34>
<Unit35>
<Filename Value="test_utilities.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="test_utilities"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="49"/>
<EditorIndex Value="15"/>
<UsageCount Value="195"/>
<EditorIndex Value="16"/>
<UsageCount Value="207"/>
<Loaded Value="True"/>
</Unit35>
<Unit36>
</Unit34>
<Unit35>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-fpcunit\src\fpcunit.pp"/>
<UnitName Value="fpcunit"/>
<CursorPos X="66" Y="231"/>
<TopLine Value="231"/>
<UsageCount Value="3"/>
</Unit36>
<Unit37>
<UsageCount Value="1"/>
</Unit35>
<Unit36>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-fpcunit\src\testregistry.pp"/>
<UnitName Value="testregistry"/>
<CursorPos X="11" Y="32"/>
<TopLine Value="17"/>
<UsageCount Value="5"/>
</Unit37>
<Unit38>
<UsageCount Value="3"/>
</Unit36>
<Unit37>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-fpcunit\src\DUnitCompatibleInterface.inc"/>
<CursorPos X="21" Y="9"/>
<TopLine Value="1"/>
<UsageCount Value="2"/>
</Unit38>
<Unit39>
<UsageCount Value="0"/>
</Unit37>
<Unit38>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\objpas\typinfo.pp"/>
<UnitName Value="typinfo"/>
<CursorPos X="53" Y="41"/>
<TopLine Value="37"/>
<UsageCount Value="10"/>
</Unit39>
<Unit40>
<UsageCount Value="8"/>
</Unit38>
<Unit39>
<Filename Value="..\..\ws_helper\wsdl2pas_imp.pas"/>
<UnitName Value="wsdl2pas_imp"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="31"/>
<UsageCount Value="10"/>
</Unit40>
<Unit41>
<UsageCount Value="8"/>
</Unit39>
<Unit40>
<Filename Value="..\..\type_lib_edtr\umoduleedit.pas"/>
<ComponentName Value="fModuleEdit"/>
<HasResources Value="True"/>
@ -366,9 +360,9 @@
<UnitName Value="umoduleedit"/>
<CursorPos X="47" Y="21"/>
<TopLine Value="18"/>
<UsageCount Value="10"/>
</Unit41>
<Unit42>
<UsageCount Value="8"/>
</Unit40>
<Unit41>
<Filename Value="..\..\type_lib_edtr\ubindingedit.pas"/>
<ComponentName Value="fBindingEdit"/>
<HasResources Value="True"/>
@ -376,9 +370,9 @@
<UnitName Value="ubindingedit"/>
<CursorPos X="41" Y="21"/>
<TopLine Value="18"/>
<UsageCount Value="10"/>
</Unit42>
<Unit43>
<UsageCount Value="8"/>
</Unit41>
<Unit42>
<Filename Value="..\..\type_lib_edtr\ufarrayedit.pas"/>
<ComponentName Value="fArrayEdit"/>
<HasResources Value="True"/>
@ -386,9 +380,9 @@
<UnitName Value="ufarrayedit"/>
<CursorPos X="41" Y="9"/>
<TopLine Value="5"/>
<UsageCount Value="10"/>
</Unit43>
<Unit44>
<UsageCount Value="8"/>
</Unit42>
<Unit43>
<Filename Value="..\..\type_lib_edtr\uftypealiasedit.pas"/>
<ComponentName Value="fTypeAliasEdit"/>
<HasResources Value="True"/>
@ -396,9 +390,9 @@
<UnitName Value="uftypealiasedit"/>
<CursorPos X="22" Y="9"/>
<TopLine Value="7"/>
<UsageCount Value="10"/>
</Unit44>
<Unit45>
<UsageCount Value="8"/>
</Unit43>
<Unit44>
<Filename Value="..\..\type_lib_edtr\ufrmsaveoption.pas"/>
<ComponentName Value="frmSaveOptions"/>
<HasResources Value="True"/>
@ -406,326 +400,221 @@
<UnitName Value="ufrmsaveoption"/>
<CursorPos X="22" Y="9"/>
<TopLine Value="6"/>
<UsageCount Value="10"/>
</Unit45>
<Unit46>
<UsageCount Value="8"/>
</Unit44>
<Unit45>
<Filename Value="..\..\server_service_xmlrpc.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="server_service_xmlrpc"/>
<CursorPos X="38" Y="33"/>
<TopLine Value="27"/>
<UsageCount Value="149"/>
</Unit46>
<Unit47>
<UsageCount Value="175"/>
</Unit45>
<Unit46>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\xmlread.pp"/>
<UnitName Value="XMLRead"/>
<CursorPos X="3" Y="1205"/>
<TopLine Value="1203"/>
<UsageCount Value="8"/>
</Unit47>
<Unit48>
<UsageCount Value="6"/>
</Unit46>
<Unit47>
<Filename Value="..\..\xmlrpc_formatter.pas"/>
<UnitName Value="xmlrpc_formatter"/>
<CursorPos X="1" Y="169"/>
<TopLine Value="154"/>
<UsageCount Value="4"/>
</Unit48>
<Unit49>
<UsageCount Value="2"/>
</Unit47>
<Unit48>
<Filename Value="..\..\record_rtti.pas"/>
<UnitName Value="record_rtti"/>
<CursorPos X="37" Y="276"/>
<TopLine Value="265"/>
<UsageCount Value="8"/>
</Unit49>
<Unit50>
<UsageCount Value="6"/>
</Unit48>
<Unit49>
<Filename Value="..\..\wst_rtl_imp.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit50>
<Unit51>
<UsageCount Value="8"/>
</Unit49>
<Unit50>
<Filename Value="test_parsers.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="test_parsers"/>
<CursorPos X="50" Y="24"/>
<TopLine Value="1"/>
<EditorIndex Value="4"/>
<UsageCount Value="127"/>
<UsageCount Value="153"/>
<Loaded Value="True"/>
</Unit51>
<Unit52>
</Unit50>
<Unit51>
<Filename Value="..\..\ws_helper\xsd_parser.pas"/>
<UnitName Value="xsd_parser"/>
<CursorPos X="17" Y="190"/>
<TopLine Value="188"/>
<EditorIndex Value="6"/>
<UsageCount Value="30"/>
<UsageCount Value="42"/>
<Loaded Value="True"/>
</Unit52>
<Unit53>
</Unit51>
<Unit52>
<Filename Value="..\..\ws_helper\parserutils.pas"/>
<UnitName Value="parserutils"/>
<CursorPos X="98" Y="94"/>
<TopLine Value="71"/>
<EditorIndex Value="8"/>
<UsageCount Value="22"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
</Unit53>
<Unit54>
</Unit52>
<Unit53>
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\packages\fcl-fpcunit\src\testregistry.pp"/>
<UnitName Value="testregistry"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="18"/>
<UsageCount Value="2"/>
</Unit54>
<Unit55>
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\packages\fcl-fpcunit\src\DUnitCompatibleInterface.inc"/>
<CursorPos X="3" Y="120"/>
<TopLine Value="115"/>
<UsageCount Value="1"/>
</Unit55>
<Unit56>
<UsageCount Value="0"/>
</Unit53>
<Unit54>
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\packages\fcl-fpcunit\src\fpcunit.pp"/>
<UnitName Value="fpcunit"/>
<CursorPos X="60" Y="449"/>
<TopLine Value="424"/>
<UsageCount Value="4"/>
</Unit56>
<Unit57>
<Filename Value="..\..\ws_helper\logger_intf.pas"/>
<UnitName Value="logger_intf"/>
<CursorPos X="85" Y="50"/>
<TopLine Value="35"/>
<UsageCount Value="1"/>
</Unit57>
<Unit58>
<CursorPos X="33" Y="438"/>
<TopLine Value="431"/>
<EditorIndex Value="15"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit54>
<Unit55>
<Filename Value="..\..\ws_helper\ws_parser_imp.pas"/>
<UnitName Value="ws_parser_imp"/>
<CursorPos X="14" Y="91"/>
<TopLine Value="77"/>
<EditorIndex Value="7"/>
<UsageCount Value="29"/>
<UsageCount Value="41"/>
<Loaded Value="True"/>
</Unit58>
<Unit59>
</Unit55>
<Unit56>
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\rtl\inc\objpash.inc"/>
<CursorPos X="21" Y="151"/>
<TopLine Value="129"/>
<UsageCount Value="4"/>
</Unit59>
<Unit60>
<UsageCount Value="2"/>
</Unit56>
<Unit57>
<Filename Value="..\..\ws_helper\wsdl_generator.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="wsdl_generator"/>
<CursorPos X="27" Y="146"/>
<TopLine Value="124"/>
<UsageCount Value="107"/>
</Unit60>
<Unit61>
<UsageCount Value="133"/>
</Unit57>
<Unit58>
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\packages\fcl-xml\src\xmlread.pp"/>
<UnitName Value="XMLRead"/>
<CursorPos X="1" Y="1975"/>
<TopLine Value="1963"/>
<UsageCount Value="3"/>
</Unit61>
<Unit62>
<UsageCount Value="1"/>
</Unit58>
<Unit59>
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\rtl\inc\objpas.inc"/>
<CursorPos X="11" Y="222"/>
<TopLine Value="219"/>
<UsageCount Value="4"/>
</Unit62>
<Unit63>
<UsageCount Value="2"/>
</Unit59>
<Unit60>
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\packages\fcl-base\src\inc\contnrs.pp"/>
<UnitName Value="contnrs"/>
<CursorPos X="3" Y="701"/>
<TopLine Value="698"/>
<UsageCount Value="4"/>
</Unit63>
<Unit64>
<UsageCount Value="2"/>
</Unit60>
<Unit61>
<Filename Value="..\..\ws_helper\xsd_generator.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="xsd_generator"/>
<CursorPos X="3" Y="81"/>
<TopLine Value="261"/>
<EditorIndex Value="2"/>
<UsageCount Value="90"/>
<UsageCount Value="116"/>
<Loaded Value="True"/>
</Unit64>
<Unit65>
</Unit61>
<Unit62>
<Filename Value="..\..\ws_helper\xsd_consts.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="xsd_consts"/>
<CursorPos X="8" Y="78"/>
<TopLine Value="51"/>
<UsageCount Value="89"/>
</Unit65>
<Unit66>
<UsageCount Value="115"/>
</Unit62>
<Unit63>
<Filename Value="..\..\ws_helper\wsdl_parser.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="wsdl_parser"/>
<CursorPos X="28" Y="845"/>
<TopLine Value="835"/>
<EditorIndex Value="5"/>
<UsageCount Value="22"/>
<UsageCount Value="48"/>
<Loaded Value="True"/>
</Unit66>
<Unit67>
</Unit63>
<Unit64>
<Filename Value="..\..\base_json_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="base_json_formatter"/>
<CursorPos X="58" Y="112"/>
<TopLine Value="99"/>
<CursorPos X="3" Y="361"/>
<TopLine Value="359"/>
<EditorIndex Value="11"/>
<UsageCount Value="75"/>
<UsageCount Value="101"/>
<Loaded Value="True"/>
</Unit67>
<Unit68>
</Unit64>
<Unit65>
<Filename Value="..\..\fcl-json\src\fpjson.pp"/>
<UnitName Value="fpjson"/>
<CursorPos X="3" Y="265"/>
<TopLine Value="296"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="330"/>
<EditorIndex Value="12"/>
<UsageCount Value="38"/>
<UsageCount Value="50"/>
<Loaded Value="True"/>
</Unit68>
<Unit69>
</Unit65>
<Unit66>
<Filename Value="..\..\wst_types.pas"/>
<UnitName Value="wst_types"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="13"/>
<UsageCount Value="6"/>
</Unit69>
<Unit70>
<UsageCount Value="4"/>
</Unit66>
<Unit67>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\systemh.inc"/>
<CursorPos X="3" Y="389"/>
<TopLine Value="375"/>
<UsageCount Value="6"/>
</Unit70>
<Unit71>
<UsageCount Value="4"/>
</Unit67>
<Unit68>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\xmlwrite.pp"/>
<UnitName Value="XMLWrite"/>
<CursorPos X="9" Y="609"/>
<TopLine Value="586"/>
<UsageCount Value="16"/>
</Unit71>
<Unit72>
<UsageCount Value="14"/>
</Unit68>
<Unit69>
<Filename Value="..\..\library_imp_utils.pas"/>
<UnitName Value="library_imp_utils"/>
<CursorPos X="2" Y="31"/>
<CursorPos X="82" Y="43"/>
<TopLine Value="19"/>
<EditorIndex Value="16"/>
<UsageCount Value="11"/>
<EditorIndex Value="17"/>
<UsageCount Value="23"/>
<Loaded Value="True"/>
</Unit72>
<Unit73>
</Unit69>
<Unit70>
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\rtl\win\dynlibs.inc"/>
<CursorPos X="1" Y="26"/>
<TopLine Value="9"/>
<UsageCount Value="10"/>
</Unit73>
<UsageCount Value="8"/>
</Unit70>
<Unit71>
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\packages\fcl-xml\src\dom.pp"/>
<UnitName Value="DOM"/>
<CursorPos X="22" Y="351"/>
<TopLine Value="336"/>
<UsageCount Value="9"/>
</Unit71>
</Units>
<JumpHistory Count="25" HistoryIndex="24">
<Position1>
<Filename Value="test_utilities.pas"/>
<Caret Line="26" Column="19" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="72" Column="52" TopLine="48"/>
</Position2>
<Position3>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="184" Column="38" TopLine="179"/>
</Position3>
<Position4>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="72" Column="24" TopLine="72"/>
</Position4>
<Position5>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="172" Column="23" TopLine="170"/>
</Position5>
<Position6>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="84" Column="1" TopLine="63"/>
</Position6>
<Position7>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="28" Column="1" TopLine="12"/>
</Position7>
<Position8>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="50" Column="25" TopLine="35"/>
</Position8>
<Position9>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="84" Column="15" TopLine="64"/>
</Position9>
<Position10>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="11" Column="5" TopLine="10"/>
</Position10>
<Position11>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="185" Column="21" TopLine="170"/>
</Position11>
<Position12>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="198" Column="56" TopLine="179"/>
</Position12>
<Position13>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="90" Column="25" TopLine="62"/>
</Position13>
<Position14>
<Filename Value="test_utilities.pas"/>
<Caret Line="107" Column="35" TopLine="93"/>
</Position14>
<Position15>
<Filename Value="test_utilities.pas"/>
<Caret Line="109" Column="3" TopLine="107"/>
</Position15>
<Position16>
<Filename Value="test_utilities.pas"/>
<Caret Line="116" Column="3" TopLine="114"/>
</Position16>
<Position17>
<Filename Value="test_utilities.pas"/>
<Caret Line="638" Column="1" TopLine="610"/>
</Position17>
<Position18>
<Filename Value="test_utilities.pas"/>
<Caret Line="633" Column="26" TopLine="610"/>
</Position18>
<Position19>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="94" Column="62" TopLine="87"/>
</Position19>
<Position20>
<Filename Value="test_utilities.pas"/>
<Caret Line="619" Column="1" TopLine="585"/>
</Position20>
<Position21>
<Filename Value="test_utilities.pas"/>
<Caret Line="652" Column="5" TopLine="618"/>
</Position21>
<Position22>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="151" Column="4" TopLine="140"/>
</Position22>
<Position23>
<Filename Value="test_utilities.pas"/>
<Caret Line="619" Column="1" TopLine="585"/>
</Position23>
<Position24>
<Filename Value="test_utilities.pas"/>
<Caret Line="647" Column="9" TopLine="623"/>
</Position24>
<Position25>
<Filename Value="..\..\library_imp_utils.pas"/>
<Caret Line="51" Column="18" TopLine="40"/>
</Position25>
</JumpHistory>
<JumpHistory Count="0" HistoryIndex="-1"/>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
@ -763,11 +652,15 @@
</Other>
</CompilerOptions>
<Debugging>
<BreakPoints Count="1">
<BreakPoints Count="2">
<Item1>
<Source Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\packages\fcl-xml\src\xmlread.pp"/>
<Line Value="1975"/>
</Item1>
<Item2>
<Source Value="testformatter_unit.pas"/>
<Line Value="2979"/>
</Item2>
</BreakPoints>
<Watches Count="2">
<Item1>

View File

@ -3,21 +3,29 @@
{$DEFINE HAS_QWORD}
{$UNDEF WST_INTF_DOM}
//{$DEFINE USE_INLINE}
{$ELSE}
{$IF Defined(FPC_VERSION) and (FPC_VERSION = 2) }
{$IF Defined(FPC_RELEASE) and (FPC_RELEASE > 0) }
{$define FPC_211}
{$IFEND}
{$IFEND}
{$IF Defined(FPC_211)}
{$DEFINE HAS_FORMAT_SETTINGS}
{$IFEND}
{$ENDIF}
{$IFNDEF FPC}
{$UNDEF HAS_QWORD}
{$UNDEF USE_INLINE}
{$DEFINE WST_RECORD_RTTI}
{$DEFINE WST_INTF_DOM}
{$IFDEF VER150}
{$DEFINE HAS_FORMAT_SETTINGS}
{$ENDIF}
{$ENDIF}
{$IFDEF CPU86}
{$DEFINE HAS_COMP}
{$ENDIF}
{$IFDEF FPC}
{$IF Defined(FPC_VERSION) and (FPC_VERSION = 2) }
{$IF Defined(FPC_RELEASE) and (FPC_RELEASE > 0) }
{$define FPC_211}
{$IFEND}
{$IFEND}
{$ENDIF}