1
0
mirror of synced 2024-11-21 21:43:49 +00:00

LoadFromString function added to the databinding functions

added bin folder
use bin and lib folder in project settings
This commit is contained in:
Mark van Renswoude 2013-10-14 15:12:39 +00:00
parent d1b7577ff2
commit ce60932a21
2 changed files with 19 additions and 1 deletions

View File

@ -45,6 +45,7 @@ const
DocumentFunctionsInterface = ' function Get%<Name>:s(ADocument: XMLIntf.IXMLDocument): IXML%<Name>:s;' + CrLf + DocumentFunctionsInterface = ' function Get%<Name>:s(ADocument: XMLIntf.IXMLDocument): IXML%<Name>:s;' + CrLf +
' function Load%<Name>:s(const AFileName: String): IXML%<Name>:s;' + CrLf + ' function Load%<Name>:s(const AFileName: String): IXML%<Name>:s;' + CrLf +
' function Load%<Name>:sFromStream(AStream: TStream): IXML%<Name>:s;' + CrLf + ' function Load%<Name>:sFromStream(AStream: TStream): IXML%<Name>:s;' + CrLf +
' function Load%<Name>:sFromString(const AString: String): IXML%<Name>:s;' + CrLf +
' function New%<Name>:s: IXML%<Name>:s;' + CrLf; ' function New%<Name>:s: IXML%<Name>:s;' + CrLf;
DocumentFunctionsImplementation = 'function Get%<Name>:s(ADocument: XMLIntf.IXMLDocument): IXML%<Name>:s;' + CrLf + DocumentFunctionsImplementation = 'function Get%<Name>:s(ADocument: XMLIntf.IXMLDocument): IXML%<Name>:s;' + CrLf +
@ -67,6 +68,19 @@ const
' Result := Get%<Name>:s(doc);' + CrLf + ' Result := Get%<Name>:s(doc);' + CrLf +
'end;' + CrLf + 'end;' + CrLf +
'' + CrLf + '' + CrLf +
'function Load%<Name>:sFromString(const AString: String): IXML%<Name>:s;' + CrLf +
'var' + CrLf +
' stream: TStringStream;' + CrLf +
'' + CrLf +
'begin' + CrLf +
' stream := TStringStream.Create(AString);' + CrLf +
' try' + CrLf +
' Result := Load%<Name>:sFromStream(stream);' + CrLf +
' finally' + CrLf +
' FreeAndNil(stream);' + CrLf +
' end;' + CrLf +
'end;' + CrLf +
'' + CrLf +
'function New%<Name>:s: IXML%<Name>:s;' + CrLf + 'function New%<Name>:s: IXML%<Name>:s;' + CrLf +
'begin' + CrLf + 'begin' + CrLf +
' Result := NewXMLDocument.' + DocumentBinding + CrLf + ' Result := NewXMLDocument.' + DocumentBinding + CrLf +

View File

@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler> <DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
<DCC_DependencyCheckOutputName>X2XMLDataBinding.exe</DCC_DependencyCheckOutputName> <DCC_DependencyCheckOutputName>bin\X2XMLDataBinding.exe</DCC_DependencyCheckOutputName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Version>7.0</Version> <Version>7.0</Version>
@ -19,6 +19,10 @@
<Version>7.0</Version> <Version>7.0</Version>
<DCC_MapFile>3</DCC_MapFile> <DCC_MapFile>3</DCC_MapFile>
<DCC_Define>DEBUG</DCC_Define> <DCC_Define>DEBUG</DCC_Define>
<DCC_ExeOutput>bin</DCC_ExeOutput>
<DCC_DcuOutput>Lib</DCC_DcuOutput>
<DCC_ObjOutput>Lib</DCC_ObjOutput>
<DCC_HppOutput>Lib</DCC_HppOutput>
</PropertyGroup> </PropertyGroup>
<ProjectExtensions> <ProjectExtensions>
<Borland.Personality>Delphi.Personality</Borland.Personality> <Borland.Personality>Delphi.Personality</Borland.Personality>