// Borland C++ Builder
// Copyright (c) 1995, 2005 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Varutils.pas' rev: 10.00

#ifndef VarutilsHPP
#define VarutilsHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit
#include <Types.hpp>	// Pascal unit
#include <Sysconst.hpp>	// Pascal unit

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

namespace Varutils
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS ESafeArrayError;
class PASCALIMPLEMENTATION ESafeArrayError : public Sysutils::Exception 
{
	typedef Sysutils::Exception inherited;
	
private:
	HRESULT FErrorCode;
	
public:
	__fastcall ESafeArrayError(HRESULT AResult, const AnsiString AMessage);
	__property HRESULT ErrorCode = {read=FErrorCode, write=FErrorCode, nodefault};
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall ESafeArrayError(const AnsiString Msg) : Sysutils::Exception(Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall ESafeArrayError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall ESafeArrayError(int Ident)/* overload */ : Sysutils::Exception(Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall ESafeArrayError(int Ident, System::TVarRec const * Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall ESafeArrayError(const AnsiString Msg, int AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall ESafeArrayError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall ESafeArrayError(int Ident, int AHelpContext)/* overload */ : Sysutils::Exception(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall ESafeArrayError(System::PResStringRec ResStringRec, System::TVarRec const * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~ESafeArrayError(void) { }
	#pragma option pop
	
};


class DELPHICLASS ESafeArrayCreateError;
class PASCALIMPLEMENTATION ESafeArrayCreateError : public ESafeArrayError 
{
	typedef ESafeArrayError inherited;
	
public:
	#pragma option push -w-inl
	/* ESafeArrayError.CreateHResult */ inline __fastcall ESafeArrayCreateError(HRESULT AResult, const AnsiString AMessage) : ESafeArrayError(AResult, AMessage) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall ESafeArrayCreateError(const AnsiString Msg) : ESafeArrayError(Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall ESafeArrayCreateError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size) : ESafeArrayError(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall ESafeArrayCreateError(int Ident)/* overload */ : ESafeArrayError(Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall ESafeArrayCreateError(int Ident, System::TVarRec const * Args, const int Args_Size)/* overload */ : ESafeArrayError(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall ESafeArrayCreateError(const AnsiString Msg, int AHelpContext) : ESafeArrayError(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall ESafeArrayCreateError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size, int AHelpContext) : ESafeArrayError(Msg, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall ESafeArrayCreateError(int Ident, int AHelpContext)/* overload */ : ESafeArrayError(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall ESafeArrayCreateError(System::PResStringRec ResStringRec, System::TVarRec const * Args, const int Args_Size, int AHelpContext)/* overload */ : ESafeArrayError(ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~ESafeArrayCreateError(void) { }
	#pragma option pop
	
};


class DELPHICLASS ESafeArrayBoundsError;
class PASCALIMPLEMENTATION ESafeArrayBoundsError : public ESafeArrayError 
{
	typedef ESafeArrayError inherited;
	
public:
	#pragma option push -w-inl
	/* ESafeArrayError.CreateHResult */ inline __fastcall ESafeArrayBoundsError(HRESULT AResult, const AnsiString AMessage) : ESafeArrayError(AResult, AMessage) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall ESafeArrayBoundsError(const AnsiString Msg) : ESafeArrayError(Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall ESafeArrayBoundsError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size) : ESafeArrayError(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall ESafeArrayBoundsError(int Ident)/* overload */ : ESafeArrayError(Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall ESafeArrayBoundsError(int Ident, System::TVarRec const * Args, const int Args_Size)/* overload */ : ESafeArrayError(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall ESafeArrayBoundsError(const AnsiString Msg, int AHelpContext) : ESafeArrayError(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall ESafeArrayBoundsError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size, int AHelpContext) : ESafeArrayError(Msg, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall ESafeArrayBoundsError(int Ident, int AHelpContext)/* overload */ : ESafeArrayError(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall ESafeArrayBoundsError(System::PResStringRec ResStringRec, System::TVarRec const * Args, const int Args_Size, int AHelpContext)/* overload */ : ESafeArrayError(ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~ESafeArrayBoundsError(void) { }
	#pragma option pop
	
};


class DELPHICLASS ESafeArrayLockedError;
class PASCALIMPLEMENTATION ESafeArrayLockedError : public ESafeArrayError 
{
	typedef ESafeArrayError inherited;
	
public:
	#pragma option push -w-inl
	/* ESafeArrayError.CreateHResult */ inline __fastcall ESafeArrayLockedError(HRESULT AResult, const AnsiString AMessage) : ESafeArrayError(AResult, AMessage) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall ESafeArrayLockedError(const AnsiString Msg) : ESafeArrayError(Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall ESafeArrayLockedError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size) : ESafeArrayError(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall ESafeArrayLockedError(int Ident)/* overload */ : ESafeArrayError(Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall ESafeArrayLockedError(int Ident, System::TVarRec const * Args, const int Args_Size)/* overload */ : ESafeArrayError(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall ESafeArrayLockedError(const AnsiString Msg, int AHelpContext) : ESafeArrayError(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall ESafeArrayLockedError(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size, int AHelpContext) : ESafeArrayError(Msg, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall ESafeArrayLockedError(int Ident, int AHelpContext)/* overload */ : ESafeArrayError(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall ESafeArrayLockedError(System::PResStringRec ResStringRec, System::TVarRec const * Args, const int Args_Size, int AHelpContext)/* overload */ : ESafeArrayError(ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~ESafeArrayLockedError(void) { }
	#pragma option pop
	
};


struct TVarTypeToElementInfo
{
	
public:
	bool ValidBase;
	bool ValidElement;
	int Size;
	Word Flags;
} ;

//-- var, const, procedure ---------------------------------------------------
static const bool GenericVarUtils = false;
static const bool GenericVariants = false;
static const bool GenericOperations = false;
static const bool GenericSafeArrays = false;
static const bool GenericSafeArrayUsesLibC = false;
extern PACKAGE HRESULT __stdcall (*VariantChangeTypeEx)(TVarData &Dest, const TVarData &Source, int LCID, Word wFlags, Word VarType);
extern PACKAGE HRESULT __stdcall (*VarNeg)(const TVarData &Source, TVarData &Dest);
extern PACKAGE HRESULT __stdcall (*VarNot)(const TVarData &Source, TVarData &Dest);
extern PACKAGE HRESULT __stdcall (*VarAdd)(const TVarData &Left, const TVarData &Right, TVarData &AResult);
extern PACKAGE HRESULT __stdcall (*VarSub)(const TVarData &Left, const TVarData &Right, TVarData &AResult);
extern PACKAGE HRESULT __stdcall (*VarMul)(const TVarData &Left, const TVarData &Right, TVarData &AResult);
extern PACKAGE HRESULT __stdcall (*VarDiv)(const TVarData &Left, const TVarData &Right, TVarData &AResult);
extern PACKAGE HRESULT __stdcall (*VarIDiv)(const TVarData &Left, const TVarData &Right, TVarData &AResult);
extern PACKAGE HRESULT __stdcall (*VarMod)(const TVarData &Left, const TVarData &Right, TVarData &AResult);
extern PACKAGE HRESULT __stdcall (*VarAnd)(const TVarData &Left, const TVarData &Right, TVarData &AResult);
extern PACKAGE HRESULT __stdcall (*VarOr)(const TVarData &Left, const TVarData &Right, TVarData &AResult);
extern PACKAGE HRESULT __stdcall (*VarXor)(const TVarData &Left, const TVarData &Right, TVarData &AResult);
extern PACKAGE HRESULT __stdcall (*VarI4FromStr)(const WideString strIn, int LCID, int dwFlags, /* out */ int &lOut);
extern PACKAGE HRESULT __stdcall (*VarR4FromStr)(const WideString strIn, int LCID, int dwFlags, /* out */ float &fltOut);
extern PACKAGE HRESULT __stdcall (*VarR8FromStr)(const WideString strIn, int LCID, int dwFlags, /* out */ double &dblOut);
extern PACKAGE HRESULT __stdcall (*VarDateFromStr)(const WideString strIn, unsigned LCID, int dwFlags, /* out */ System::TDateTime &dateOut);
extern PACKAGE HRESULT __stdcall (*VarCyFromStr)(const WideString strIn, unsigned LCID, int dwFlags, /* out */ System::Currency &cyOut);
extern PACKAGE HRESULT __stdcall (*VarBoolFromStr)(const WideString strIn, int LCID, int dwFlags, /* out */ Word &boolOut);
extern PACKAGE HRESULT __stdcall (*VarBstrFromCy)(System::Currency cyIn, int LCID, int dwFlags, /* out */ WideString &bstrOut);
extern PACKAGE HRESULT __stdcall (*VarBstrFromDate)(System::TDateTime dateIn, int LCID, int dwFlags, /* out */ WideString &bstrOut);
extern PACKAGE HRESULT __stdcall (*VarBstrFromBool)(Word boolIn, int LCID, int dwFlags, /* out */ WideString &bstrOut);
static const HRESULT VAR_OK = 0;
static const HRESULT VAR_PARAMNOTFOUND = -2147352572;
static const HRESULT VAR_TYPEMISMATCH = -2147352571;
static const HRESULT VAR_BADVARTYPE = -2147352568;
static const HRESULT VAR_EXCEPTION = -2147352567;
static const HRESULT VAR_OVERFLOW = -2147352566;
static const HRESULT VAR_BADINDEX = -2147352565;
static const HRESULT VAR_ARRAYISLOCKED = -2147352563;
static const HRESULT VAR_NOTIMPL = -2147467263;
static const HRESULT VAR_OUTOFMEMORY = -2147024882;
static const HRESULT VAR_INVALIDARG = -2147024809;
static const HRESULT VAR_UNEXPECTED = -2147418113;
static const Shortint ARR_NONE = 0x0;
static const Shortint ARR_FIXEDSIZE = 0x10;
static const Word ARR_OLESTR = 0x100;
static const Word ARR_UNKNOWN = 0x200;
static const Word ARR_DISPATCH = 0x400;
static const Word ARR_VARIANT = 0x800;
static const Shortint VAR_CMP_LT = 0x0;
static const Shortint VAR_CMP_EQ = 0x1;
static const Shortint VAR_CMP_GT = 0x2;
static const Shortint VAR_CMP_NULL = 0x3;
static const Word VAR_LOCALE_USER_DEFAULT = 0x400;
static const Shortint CMinArrayVarType = 0x0;
static const Shortint CMaxArrayVarType = 0x15;
extern PACKAGE TVarTypeToElementInfo CVarTypeToElementInfo[22];
extern PACKAGE HRESULT __fastcall VarExceptionToResult(const Sysutils::Exception* E);
extern "C" void __stdcall VariantInit(TVarData &V);
extern "C" HRESULT __stdcall VariantClear(TVarData &V);
extern "C" HRESULT __stdcall VariantCopy(TVarData &Dest, const TVarData &Source);
extern "C" HRESULT __stdcall VariantCopyInd(TVarData &Dest, const TVarData &Source);
extern "C" HRESULT __stdcall VariantChangeType(TVarData &Dest, const TVarData &Source, Word wFlags, Word VarType);
extern "C" System::PVarArray __stdcall SafeArrayCreate(int VarType, int DimCount, System::TVarArrayBound const * Bounds);
extern "C" HRESULT __stdcall SafeArrayAllocDescriptor(int DimCount, /* out */ System::PVarArray &VarArray);
extern "C" HRESULT __stdcall SafeArrayAllocData(System::PVarArray VarArray);
extern "C" HRESULT __stdcall SafeArrayDestroy(System::PVarArray VarArray);
extern "C" HRESULT __stdcall SafeArrayDestroyDescriptor(System::PVarArray VarArray);
extern "C" HRESULT __stdcall SafeArrayDestroyData(System::PVarArray VarArray);
extern "C" HRESULT __stdcall SafeArrayRedim(System::PVarArray VarArray, const System::TVarArrayBound &NewBound);
extern "C" HRESULT __stdcall SafeArrayCopy(System::PVarArray SourceArray, /* out */ System::PVarArray &TargetArray);
extern "C" HRESULT __stdcall SafeArrayCopyData(System::PVarArray SourceArray, System::PVarArray TargetArray);
extern "C" HRESULT __stdcall SafeArrayGetLBound(System::PVarArray VarArray, int Dim, /* out */ int &LBound);
extern "C" HRESULT __stdcall SafeArrayGetUBound(System::PVarArray VarArray, int Dim, /* out */ int &UBound);
extern "C" int __stdcall SafeArrayGetDim(System::PVarArray VarArray);
extern "C" HRESULT __stdcall SafeArrayAccessData(System::PVarArray VarArray, /* out */ void * &Data);
extern "C" HRESULT __stdcall SafeArrayUnaccessData(System::PVarArray VarArray);
extern "C" HRESULT __stdcall SafeArrayLock(System::PVarArray VarArray);
extern "C" HRESULT __stdcall SafeArrayUnlock(System::PVarArray VarArray);
extern "C" HRESULT __stdcall SafeArrayGetElement(System::PVarArray VarArray, System::PVarArrayCoorArray Indices, void * Data);
extern "C" HRESULT __stdcall SafeArrayPutElement(System::PVarArray VarArray, System::PVarArrayCoorArray Indices, const void * Data);
extern "C" HRESULT __stdcall SafeArrayPtrOfIndex(System::PVarArray VarArray, System::PVarArrayCoorArray Indices, void * &Address);
extern "C" unsigned __stdcall SafeArrayGetElemSize(System::PVarArray VarArray);
extern PACKAGE void __fastcall SafeArrayCheck(HRESULT AResult);
extern PACKAGE void __fastcall SafeArrayError(HRESULT AResult);

}	/* namespace Varutils */
using namespace Varutils;
#pragma pack(pop)
#pragma option pop

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