From ce60932a213055ddd65b43eaea00505056b31c03 Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Mon, 14 Oct 2013 15:12:39 +0000 Subject: [PATCH] LoadFromString function added to the databinding functions added bin folder use bin and lib folder in project settings --- Units/DelphiXMLDataBindingResources.pas | 14 ++++++++++++++ X2XMLDataBinding.dproj | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Units/DelphiXMLDataBindingResources.pas b/Units/DelphiXMLDataBindingResources.pas index a6d2ad7..7d33faa 100644 --- a/Units/DelphiXMLDataBindingResources.pas +++ b/Units/DelphiXMLDataBindingResources.pas @@ -45,6 +45,7 @@ const DocumentFunctionsInterface = ' function Get%:s(ADocument: XMLIntf.IXMLDocument): IXML%:s;' + CrLf + ' function Load%:s(const AFileName: String): IXML%:s;' + CrLf + ' function Load%:sFromStream(AStream: TStream): IXML%:s;' + CrLf + + ' function Load%:sFromString(const AString: String): IXML%:s;' + CrLf + ' function New%:s: IXML%:s;' + CrLf; DocumentFunctionsImplementation = 'function Get%:s(ADocument: XMLIntf.IXMLDocument): IXML%:s;' + CrLf + @@ -67,6 +68,19 @@ const ' Result := Get%:s(doc);' + CrLf + 'end;' + CrLf + '' + CrLf + + 'function Load%:sFromString(const AString: String): IXML%:s;' + CrLf + + 'var' + CrLf + + ' stream: TStringStream;' + CrLf + + '' + CrLf + + 'begin' + CrLf + + ' stream := TStringStream.Create(AString);' + CrLf + + ' try' + CrLf + + ' Result := Load%:sFromStream(stream);' + CrLf + + ' finally' + CrLf + + ' FreeAndNil(stream);' + CrLf + + ' end;' + CrLf + + 'end;' + CrLf + + '' + CrLf + 'function New%:s: IXML%:s;' + CrLf + 'begin' + CrLf + ' Result := NewXMLDocument.' + DocumentBinding + CrLf + diff --git a/X2XMLDataBinding.dproj b/X2XMLDataBinding.dproj index 2f78b13..2ee5776 100644 --- a/X2XMLDataBinding.dproj +++ b/X2XMLDataBinding.dproj @@ -5,7 +5,7 @@ Debug AnyCPU DCC32 - X2XMLDataBinding.exe + bin\X2XMLDataBinding.exe 7.0 @@ -19,6 +19,10 @@ 7.0 3 DEBUG + bin + Lib + Lib + Lib Delphi.Personality