// CodeGear C++Builder
// Copyright (c) 1995, 2014 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'xpgPXML.pas' rev: 28.00 (Windows)

#ifndef XpgpxmlHPP
#define XpgpxmlHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.Classes.hpp>	// Pascal unit
#include <System.SysUtils.hpp>	// Pascal unit
#include <System.Contnrs.hpp>	// Pascal unit
#include <Winapi.Windows.hpp>	// Pascal unit
#include <xpgPUtils.hpp>	// Pascal unit
#include <xpgPXMLUtils.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Xpgpxml
{
//-- type declarations -------------------------------------------------------
enum DECLSPEC_DENUM TAxBOM : unsigned char { axbomNone, axbomUTF8, axbomUTF16BE, axbomUTF16LE, axbomUTF32BE, axbomUTF32LE };

class DELPHICLASS TXpgStrStack;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TXpgStrStack : public System::TObject
{
	typedef System::TObject inherited;
	
protected:
	System::Classes::TStringList* FValues;
	
public:
	__fastcall TXpgStrStack(void);
	__fastcall virtual ~TXpgStrStack(void);
	void __fastcall Push(System::UnicodeString AValue);
	System::UnicodeString __fastcall Pop(void);
	int __fastcall Count(void);
};

#pragma pack(pop)

class DELPHICLASS TXpgWriteXML;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TXpgWriteXML : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	void __fastcall SetAttributes(const System::UnicodeString Value);
	
protected:
	System::Classes::TStream* FStream;
	bool FOwnsStream;
	bool FAborted;
	System::UnicodeString FText;
	Xpgpxmlutils::TXpgXMLString FAttributes;
	TXpgStrStack* FStack;
	System::AnsiString FSpaces;
	bool FWriteIndent;
	void __fastcall AddAttr(const System::UnicodeString AValue);
	void __fastcall CopyToBufUTF8(System::UnicodeString AValue);
	void __fastcall WriteString(const System::UnicodeString S)/* overload */;
	void __fastcall WriteString(const char * S, const int Len)/* overload */;
	
public:
	__fastcall TXpgWriteXML(void);
	__fastcall virtual ~TXpgWriteXML(void);
	void __fastcall SaveToStream(System::Classes::TStream* AStream);
	void __fastcall SaveToFile(System::UnicodeString AFilename);
	void __fastcall Declaration(void);
	void __fastcall BeginTag(const System::UnicodeString AName)/* overload */;
	void __fastcall SimpleTag(const System::UnicodeString AName)/* overload */;
	void __fastcall SimpleTextTag(const System::UnicodeString AName, const System::UnicodeString AText);
	void __fastcall EmptyTag(const System::UnicodeString AName);
	void __fastcall EndTag(void);
	void __fastcall AddAttribute(const System::UnicodeString AName, const System::UnicodeString AValue);
	__property System::UnicodeString Text = {read=FText, write=FText};
	__property System::UnicodeString Attributes = {write=SetAttributes};
	__property bool WriteIndent = {read=FWriteIndent, write=FWriteIndent, nodefault};
};

#pragma pack(pop)

class DELPHICLASS TXpgReadXML;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TXpgReadXML : public System::TObject
{
	typedef System::TObject inherited;
	
protected:
	System::Classes::TStream* FStream;
	bool FAborted;
	TAxBOM FBOM;
	Xpgpxmlutils::TXpgXMLString FNamespace;
	bool FHasNamespace;
	Xpgpxmlutils::TXpgXMLString FTag;
	Xpgpxmlutils::TXpgXMLString FElementVal;
	Xpgpxmlutils::TXpgXmlAttributeArray FAttributes;
	int FAttrCount;
	Xpgpxmlutils::TXpgXMLString FText;
	bool FHasText;
	Xpgpxmlutils::TXpgXMLString FComment;
	int FRow;
	System::StaticArray<System::Byte, 256> FBuf;
	bool FPreserveSpaces;
	bool FIncludeNamespace;
	bool FHtmlRawMode;
	Xpgpxmlutils::TXpgXMLAttributeList* FAttrList;
	void __fastcall CheckBOM(void);
	System::UnicodeString __fastcall GetAsString(const Xpgpxmlutils::TXpgXMLString &Str);
	System::UnicodeString __fastcall GetAsStringUTF8(const Xpgpxmlutils::TXpgXMLString &Str);
	void __fastcall MakeLowercase(const Xpgpxmlutils::TXpgXMLString &Str);
	
public:
	__fastcall TXpgReadXML(void);
	__fastcall virtual ~TXpgReadXML(void);
	virtual void __fastcall Clear(void);
	void __fastcall ClearNamespace(void);
	virtual int __fastcall LoadFromStream(System::Classes::TStream* AStream);
	void __fastcall LoadFromFile(System::UnicodeString AFilename);
	virtual int __fastcall LoadFromStreamHtml(System::Classes::TStream* AStream);
	virtual void __fastcall Declaration(void);
	virtual void __fastcall BeginTag(void);
	virtual void __fastcall EndTag(void);
	virtual void __fastcall Comment(void);
	bool __fastcall CmpTag(const System::UnicodeString S);
	System::UnicodeString __fastcall Namespace(void);
	System::UnicodeString __fastcall Tag(void);
	System::UnicodeString __fastcall Text(void);
	System::UnicodeString __fastcall QName(void);
	char * __fastcall QNameP(void);
	char * __fastcall QNameT(void);
	bool __fastcall QNameIsC(void);
	bool __fastcall QNameIsV(void);
	unsigned __fastcall NameHashA(System::UnicodeString NS);
	unsigned __fastcall QNameHashA(void);
	unsigned __fastcall QNameHashB(void);
	unsigned __fastcall QNameHashC(void);
	unsigned __fastcall QNameHashD(void);
	System::UnicodeString __fastcall FindAttribute(const System::UnicodeString Attr);
	int __fastcall Col(void);
	int __fastcall Row(void);
	void __fastcall Abort(void);
	__property Xpgpxmlutils::TXpgXMLAttributeList* Attributes = {read=FAttrList};
	__property bool HasText = {read=FHasText, nodefault};
	__property bool PreserveSpaces = {read=FPreserveSpaces, write=FPreserveSpaces, nodefault};
	__property bool IncludeNamespace = {read=FIncludeNamespace, write=FIncludeNamespace, nodefault};
};

#pragma pack(pop)

//-- var, const, procedure ---------------------------------------------------
static const int AX_STREAM_READ_BUF_SZ = int(0x10000);
static const System::Word AX_STREAM_READ_BUF_SZ_EX = System::Word(0x8000);
static const int AX_STREAM_READ_MAX_ALLOC = int(0xfffff);
static const System::Word AX_STREAM_WRITE_BUF_SZ = System::Word(0x7fff);
static const System::Word AX_STREAM_WRITE_BUF_SZ_EX = System::Word(0xffff);
static const System::Word AX_MAXINDENT = System::Word(0x100);
}	/* namespace Xpgpxml */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_XPGPXML)
using namespace Xpgpxml;
#endif
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// XpgpxmlHPP
