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

// (DO NOT EDIT: machine generated header) 'QImport3XML.pas' rev: 34.00 (Windows)

#ifndef Qimport3xmlHPP
#define Qimport3xmlHPP

#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>
#include <SysInit.hpp>
#include <System.SysUtils.hpp>
#include <System.Math.hpp>
#include <Winapi.Windows.hpp>
#include <System.Classes.hpp>
#include <System.IniFiles.hpp>
#include <Data.DB.hpp>
#include <System.DateUtils.hpp>
#include <QImport3.hpp>
#include <QImport3WideStrUtils.hpp>
#include <QImport3StrTypes.hpp>
#include <QImport3Encoding.hpp>
#include <QImport3Common.hpp>
#include <System.WideStrings.hpp>

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

namespace Qimport3xml
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TXMLTag;
class DELPHICLASS TXMLTagList;
class DELPHICLASS TXMLFile;
class DELPHICLASS TQImport3XML;
//-- type declarations -------------------------------------------------------
enum DECLSPEC_DENUM TQIXMLDocType : unsigned char { xtDataPacket2, xtAccess, xtUndefined };

#pragma pack(push,4)
class PASCALIMPLEMENTATION TXMLTag : public System::Classes::TCollectionItem
{
	typedef System::Classes::TCollectionItem inherited;
	
private:
	TXMLTag* FParent;
	TXMLTagList* FTagList;
	System::WideString FName;
	System::Widestrings::TWideStrings* FAttributes;
	System::Widestrings::TWideStrings* FAttrNames;
	TXMLTagList* FChildren;
	void __fastcall SetAttributes(System::Widestrings::TWideStrings* Value);
	void __fastcall SetChildren(TXMLTagList* Value);
	
public:
	__fastcall virtual TXMLTag(System::Classes::TCollection* Collection);
	__fastcall virtual ~TXMLTag();
	__property TXMLTag* Parent = {read=FParent};
	__property TXMLTagList* TagList = {read=FTagList};
	__property System::WideString Name = {read=FName, write=FName};
	__property System::Widestrings::TWideStrings* Attributes = {read=FAttributes, write=SetAttributes};
	__property TXMLTagList* Children = {read=FChildren, write=SetChildren};
};

#pragma pack(pop)

#pragma pack(push,4)
class PASCALIMPLEMENTATION TXMLTagList : public System::Classes::TCollection
{
	typedef System::Classes::TCollection inherited;
	
public:
	TXMLTag* operator[](int Index) { return this->Items[Index]; }
	
private:
	TXMLTag* FParent;
	HIDESBASE TXMLTag* __fastcall GetItem(int Index);
	HIDESBASE void __fastcall SetItem(int Index, TXMLTag* Value);
	
public:
	__fastcall TXMLTagList(TXMLTag* Parent);
	HIDESBASE TXMLTag* __fastcall Add();
	__property TXMLTag* Parent = {read=FParent};
	__property TXMLTag* Items[int Index] = {read=GetItem, write=SetItem/*, default*/};
public:
	/* TCollection.Destroy */ inline __fastcall virtual ~TXMLTagList() { }
	
};

#pragma pack(pop)

#pragma pack(push,4)
class PASCALIMPLEMENTATION TXMLFile : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	Qimport3encoding::TQICharsetType FEncoding;
	System::WideString FData;
	System::WideString FFileName;
	TXMLTag* FHeader;
	TXMLTagList* FTags;
	bool FLoaded;
	bool FEof;
	int FPosition;
	TQIXMLDocType FFileType;
	bool FParsingFailed;
	void __fastcall SetHeader(TXMLTag* Value);
	void __fastcall SetTags(TXMLTagList* Value);
	TXMLTagList* __fastcall GetFields();
	int __fastcall GetFieldCount();
	TXMLTagList* __fastcall GetRows();
	int __fastcall GetRowCount();
	
public:
	__fastcall TXMLFile();
	__fastcall virtual ~TXMLFile();
	void __fastcall Open();
	void __fastcall Close();
	TXMLTag* __fastcall GetNextTag();
	void __fastcall Load(bool FieldsOnly);
	void __fastcall Clear();
	bool __fastcall IsCurrentFile();
	bool __fastcall ForceLoad(bool AFieldsOnly);
	__property System::WideString FileName = {read=FFileName, write=FFileName};
	__property TXMLTag* Header = {read=FHeader, write=SetHeader};
	__property TXMLTagList* Tags = {read=FTags, write=SetTags};
	__property TXMLTagList* Fields = {read=GetFields};
	__property int FieldCount = {read=GetFieldCount, nodefault};
	__property TXMLTagList* Rows = {read=GetRows};
	__property int RowCount = {read=GetRowCount, nodefault};
	__property bool Eof = {read=FEof, nodefault};
	__property Qimport3encoding::TQICharsetType Encoding = {read=FEncoding, write=FEncoding, default=0};
	__property TQIXMLDocType FileType = {read=FFileType, write=FFileType, nodefault};
};

#pragma pack(pop)

class PASCALIMPLEMENTATION TQImport3XML : public Qimport3::TQImport3
{
	typedef Qimport3::TQImport3 inherited;
	
private:
	TXMLFile* FXML;
	int FCounter;
	bool FWriteOnFly;
	TXMLTag* FXMLTag;
	Qimport3encoding::TQICharsetType FEncoding;
	TQIXMLDocType FDocumentType;
	
protected:
	virtual System::Variant __fastcall GetDateTimeValue(const System::WideString AValue);
	virtual void __fastcall DoBeforeImport();
	virtual void __fastcall DoAfterImport();
	virtual void __fastcall StartImport();
	virtual bool __fastcall CheckCondition();
	virtual void __fastcall ChangeCondition();
	virtual void __fastcall FinishImport();
	virtual void __fastcall FillImportRow();
	virtual bool __fastcall Skip();
	virtual Qimport3::TQImportResult __fastcall ImportData();
	virtual void __fastcall DoLoadConfiguration(System::Inifiles::TIniFile* IniFile);
	virtual void __fastcall DoSaveConfiguration(System::Inifiles::TIniFile* IniFile);
	virtual System::Variant __fastcall GetStringValue(const System::WideString AValue, const Data::Db::TFieldType AFieldType);
	virtual System::Variant __fastcall GetBitesValue(const System::WideString AValue);
	System::Variant __fastcall CheckBinaryData(System::WideString AValue);
	
public:
	__fastcall virtual TQImport3XML(System::Classes::TComponent* AOwner);
	__fastcall virtual ~TQImport3XML();
	
__published:
	__property FileName = {default=0};
	__property SkipFirstRows = {default=0};
	__property bool WriteOnFly = {read=FWriteOnFly, write=FWriteOnFly, default=0};
	__property Qimport3encoding::TQICharsetType Encoding = {read=FEncoding, write=FEncoding, default=0};
	__property TQIXMLDocType DocumentType = {read=FDocumentType, write=FDocumentType, default=0};
	__property TXMLFile* XML = {read=FXML};
};


//-- var, const, procedure ---------------------------------------------------
#define EndL L"\r\n"
#define sSchemaNotFound L"Schema file %s not found!"
extern DELPHI_PACKAGE TXMLTag* __fastcall ParseXML(TXMLFile* XMLFile, const System::WideString XML, bool FieldsOnly, bool OneTag, bool SilentParse = false);
extern DELPHI_PACKAGE void __fastcall ParseAccessXMLFields(TXMLFile* XMLFile, const System::WideString XML, const bool FieldsOnly);
extern DELPHI_PACKAGE void __fastcall ParseAccessXMLData(TXMLFile* XMLFile, const System::WideString XML, TXMLTag* RowsTag, TXMLTag* FieldsTag, const bool NoSchema, const bool FieldsOnly);
extern DELPHI_PACKAGE System::WideString __fastcall CorrectStr(System::WideString AStr);
extern DELPHI_PACKAGE System::WideString __fastcall CorrectStr2(System::WideString AStr);
}	/* namespace Qimport3xml */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_QIMPORT3XML)
using namespace Qimport3xml;
#endif
#pragma pack(pop)
#pragma option pop

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