Skip to content
Permalink
Browse files

! Exclude AnsiString support if compiling with NEXTGEN compiler.

  • Loading branch information
mremec committed Apr 14, 2017
1 parent c79010a commit 20c49b76be90abc1c214e91b1672317f876e8717
Showing with 18 additions and 0 deletions.
  1. +6 −0 OmniXML.inc
  2. +12 −0 OmniXMLUtils.pas
@@ -2,6 +2,8 @@
{$DEFINE UNICODE}
{$ENDIF}

{$DEFINE OmniXML_SupportAnsiStrings}

{$IFDEF CONDITIONALEXPRESSIONS}

{$IF Declared(CompilerVersion) and (CompilerVersion >= 25.0)}
@@ -33,6 +35,10 @@
{$DEFINE OmniXML_Unicode}
{$ENDIF} // UNICODE

{$IFDEF NEXTGEN}
{$UNDEF OmniXML_SupportAnsiStrings}
{$ENDIF NEXTGEN}

{$ENDIF} // CONDITIONALEXPRESSIONS

{$I OmniXML_JEDI.inc}
@@ -154,6 +154,10 @@ interface
{$IFEND}
{$ENDIF}

{$IFDEF NEXTGEN}
{$DEFINE NoVCL}
{$ENDIF NEXTGEN}

uses
{$IFDEF MSWINDOWS}
Windows,
@@ -497,21 +501,25 @@ EOmniXMLUtils = class(Exception);
function XMLLoadFromString(xmlDocument: IXMLDocument;
const xmlData: XmlString): boolean;

{$IFDEF OmniXML_SupportAnsiStrings}
{:Load XML document from an ansi string.
}
function XMLLoadFromAnsiString(xmlDocument: IXMLDocument;
const xmlData: AnsiString): boolean;
{$ENDIF OmniXML_SupportAnsiStrings}

{:Save XML document to a wide string.
}
function XMLSaveToString(xmlDocument: IXMLDocument;
outputFormat: TOutputFormat = ofNone): XmlString;

{$IFDEF OmniXML_SupportAnsiStrings}
{:Save XML document to an ansi string, automatically adding UTF8 processing
instruction if required.
}
function XMLSaveToAnsiString(xmlDocument: IXMLDocument;
outputFormat: TOutputFormat = ofNone): AnsiString;
{$ENDIF OmniXML_SupportAnsiStrings}

{:Load XML document from a stream.
}
@@ -2496,6 +2504,7 @@ function XMLLoadFromString(xmlDocument: IXMLDocument;
Result := xmlDocument.LoadXML(xmlData);
end; { XMLLoadFromString }

{$IFDEF OmniXML_SupportAnsiStrings}
{:@param xmlDocument XML document.
@param xmlData XML document, stored in the string.
@returns True if xmlData was successfully parsed and loaded into the
@@ -2512,6 +2521,7 @@ function XMLLoadFromAnsiString(xmlDocument: IXMLDocument;
Result := XMLLoadFromStream(xmlDocument, sStr);
finally FreeAndNil(sStr); end;
end; { XMLLoadFromString }
{$ENDIF OmniXML_SupportAnsiStrings}

{:@param xmlDocument XML document.
@param outputFormat XML document formatting.
@@ -2545,6 +2555,7 @@ function XMLSaveToString(xmlDocument: IXMLDocument;
{$ENDIF USE_MSXML}
end; { XMLSaveToString }

{$IFDEF OmniXML_SupportAnsiStrings}
{:@param xmlDocument XML document.
@param outputFormat XML document formatting.
@returns Contents of the XML document, stored in the string.
@@ -2561,6 +2572,7 @@ function XMLSaveToAnsiString(xmlDocument: IXMLDocument;
Result := AnsiString(sStr.DataString);
finally FreeAndNil(sStr); end;
end; { XMLSaveToString }
{$ENDIF OmniXML_SupportAnsiStrings}

{:@param xmlDocument XML document.
@param xmlStream Stream containing XML document.

0 comments on commit 20c49b7

Please sign in to comment.