{***************************************************}
{ }
{ XML Data Binding }
{ }
{ Generated on: 22.06.2021 13:59:22 }
{ Generated from: D:\Github-Repos\new 2.xml }
{ Settings stored in: D:\Github-Repos\new 2.xdb }
{ }
{***************************************************}
unit UID;
interface
uses Xml.xmldom,
Xml.XMLDoc,
Xml.XMLIntf;
type
{ Forward Decls }
IXMLParamsType =
interface;
IXMLParamType =
interface;
IXMLValueType =
interface;
IXMLArrayType =
interface;
IXMLDataType =
interface;
{ IXMLParamsType }
IXMLParamsType =
interface(IXMLNodeCollection)
['
{F262379E-19C8-4062-BEF9-78826C7E7FF0}']
{ Property Accessors }
function Get_Param(
Index: Integer): IXMLParamType;
{ Methods & Properties }
function Add: IXMLParamType;
function Insert(
const Index: Integer): IXMLParamType;
property Param[
Index: Integer]: IXMLParamType
read Get_Param;
default;
end;
{ IXMLParamType }
IXMLParamType =
interface(IXMLNode)
['
{96DA74CC-1B8A-4368-AA9E-99464D25D589}']
{ Property Accessors }
function Get_Value: IXMLValueType;
{ Methods & Properties }
property Value: IXMLValueType
read Get_Value;
end;
{ IXMLValueType }
IXMLValueType =
interface(IXMLNode)
['
{235C08FA-0EBB-41E4-A7FE-4123BFE0D250}']
{ Property Accessors }
function Get_String_: UnicodeString;
function Get_Array_: IXMLArrayType;
procedure Set_String_(Value: UnicodeString);
{ Methods & Properties }
property String_: UnicodeString
read Get_String_
write Set_String_;
property Array_: IXMLArrayType
read Get_Array_;
end;
{ IXMLArrayType }
IXMLArrayType =
interface(IXMLNode)
['
{0A59A8A5-86DD-4D4B-B345-6D553493DC94}']
{ Property Accessors }
function Get_Data: IXMLDataType;
{ Methods & Properties }
property Data: IXMLDataType
read Get_Data;
end;
{ IXMLDataType }
IXMLDataType =
interface(IXMLNodeCollection)
['
{B3867F76-837B-495B-AD2B-ACBCC3B50263}']
{ Property Accessors }
function Get_Value(
Index: Integer): IXMLValueType;
{ Methods & Properties }
function Add: IXMLValueType;
function Insert(
const Index: Integer): IXMLValueType;
property Value[
Index: Integer]: IXMLValueType
read Get_Value;
default;
end;
{ Forward Decls }
TXMLParamsType =
class;
TXMLParamType =
class;
TXMLValueType =
class;
TXMLArrayType =
class;
TXMLDataType =
class;
{ TXMLParamsType }
TXMLParamsType =
class(TXMLNodeCollection, IXMLParamsType)
protected
{ IXMLParamsType }
function Get_Param(
Index: Integer): IXMLParamType;
function Add: IXMLParamType;
function Insert(
const Index: Integer): IXMLParamType;
public
procedure AfterConstruction;
override;
end;
{ TXMLParamType }
TXMLParamType =
class(TXMLNode, IXMLParamType)
protected
{ IXMLParamType }
function Get_Value: IXMLValueType;
public
procedure AfterConstruction;
override;
end;
{ TXMLValueType }
TXMLValueType =
class(TXMLNode, IXMLValueType)
protected
{ IXMLValueType }
function Get_String_: UnicodeString;
function Get_Array_: IXMLArrayType;
procedure Set_String_(Value: UnicodeString);
public
procedure AfterConstruction;
override;
end;
{ TXMLArrayType }
TXMLArrayType =
class(TXMLNode, IXMLArrayType)
protected
{ IXMLArrayType }
function Get_Data: IXMLDataType;
public
procedure AfterConstruction;
override;
end;
{ TXMLDataType }
TXMLDataType =
class(TXMLNodeCollection, IXMLDataType)
protected
{ IXMLDataType }
function Get_Value(
Index: Integer): IXMLValueType;
function Add: IXMLValueType;
function Insert(
const Index: Integer): IXMLValueType;
public
procedure AfterConstruction;
override;
end;
{ Global Functions }
function Getparams(Doc: IXMLDocument): IXMLParamsType;
function Loadparams(
const FileName:
string): IXMLParamsType;
function Newparams: IXMLParamsType;
const
TargetNamespace = '
';
implementation
uses Xml.xmlutil;
{ Global Functions }
function Getparams(Doc: IXMLDocument): IXMLParamsType;
begin
Result := Doc.GetDocBinding('
params', TXMLParamsType, TargetNamespace)
as IXMLParamsType;
end;
function Loadparams(
const FileName:
string): IXMLParamsType;
begin
Result := LoadXMLDocument(FileName).GetDocBinding('
params', TXMLParamsType, TargetNamespace)
as IXMLParamsType;
end;
function Newparams: IXMLParamsType;
begin
Result := NewXMLDocument.GetDocBinding('
params', TXMLParamsType, TargetNamespace)
as IXMLParamsType;
end;
{ TXMLParamsType }
procedure TXMLParamsType.AfterConstruction;
begin
RegisterChildNode('
param', TXMLParamType);
ItemTag := '
param';
ItemInterface := IXMLParamType;
inherited;
end;
function TXMLParamsType.Get_Param(
Index: Integer): IXMLParamType;
begin
Result := List[
Index]
as IXMLParamType;
end;
function TXMLParamsType.Add: IXMLParamType;
begin
Result := AddItem(-1)
as IXMLParamType;
end;
function TXMLParamsType.Insert(
const Index: Integer): IXMLParamType;
begin
Result := AddItem(
Index)
as IXMLParamType;
end;
{ TXMLParamType }
procedure TXMLParamType.AfterConstruction;
begin
RegisterChildNode('
value', TXMLValueType);
inherited;
end;
function TXMLParamType.Get_Value: IXMLValueType;
begin
Result := ChildNodes['
value']
as IXMLValueType;
end;
{ TXMLValueType }
procedure TXMLValueType.AfterConstruction;
begin
RegisterChildNode('
array', TXMLArrayType);
inherited;
end;
function TXMLValueType.Get_String_: UnicodeString;
begin
Result := ChildNodes['
string'].Text;
end;
procedure TXMLValueType.Set_String_(Value: UnicodeString);
begin
ChildNodes['
string'].NodeValue := Value;
end;
function TXMLValueType.Get_Array_: IXMLArrayType;
begin
Result := ChildNodes['
array']
as IXMLArrayType;
end;
{ TXMLArrayType }
procedure TXMLArrayType.AfterConstruction;
begin
RegisterChildNode('
data', TXMLDataType);
inherited;
end;
function TXMLArrayType.Get_Data: IXMLDataType;
begin
Result := ChildNodes['
data']
as IXMLDataType;
end;
{ TXMLDataType }
procedure TXMLDataType.AfterConstruction;
begin
RegisterChildNode('
value', TXMLValueType);
ItemTag := '
value';
ItemInterface := IXMLValueType;
inherited;
end;
function TXMLDataType.Get_Value(
Index: Integer): IXMLValueType;
begin
Result := List[
Index]
as IXMLValueType;
end;
function TXMLDataType.Add: IXMLValueType;
begin
Result := AddItem(-1)
as IXMLValueType;
end;
function TXMLDataType.Insert(
const Index: Integer): IXMLValueType;
begin
Result := AddItem(
Index)
as IXMLValueType;
end;
end.