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

// (DO NOT EDIT: machine generated header) 'ABSVariant.pas' rev: 35.00 (Windows)

#ifndef AbsvariantHPP
#define AbsvariantHPP

#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.Classes.hpp>
#include <Winapi.Windows.hpp>
#include <System.Math.hpp>
#include <ABSCompression.hpp>
#include <ABSTypes.hpp>
#include <ABSTypesRoutines.hpp>
#include <ABSConst.hpp>
#include <ABSConverts.hpp>
#include <ABSMemory.hpp>
#include <ABSExcept.hpp>

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

namespace Absvariant
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TABSVariant;
//-- type declarations -------------------------------------------------------
class PASCALIMPLEMENTATION TABSVariant : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	Abstypes::TABSBaseFieldType FDataType;
	int FDataSize;
	char *FPData;
	System::ByteBool FIsDataLinked;
	System::ByteBool FIsNull;
	
public:
	void __fastcall LoadFromStream(System::Classes::TStream* Stream);
	void __fastcall SaveToStream(System::Classes::TStream* Stream);
	__fastcall TABSVariant(Abstypes::TABSBaseFieldType DataType);
	__fastcall virtual ~TABSVariant();
	void __fastcall SetNull(Abstypes::TABSBaseFieldType DataType = (Abstypes::TABSBaseFieldType)(0x0));
	void __fastcall Clear(Abstypes::TABSBaseFieldType DataType = (Abstypes::TABSBaseFieldType)(0x0));
	void __fastcall Assign(TABSVariant* Source, bool CopyDataFlag = true);
	void __fastcall SetData(void * Buffer, int Size, Abstypes::TABSBaseFieldType DataType, bool CopyDataFlag = true);
	bool __fastcall CopyDataToAddress(void * Buffer, int MaxSize = 0xffffffff);
	void __fastcall Cast(Abstypes::TABSBaseFieldType NewDataType);
	bool __fastcall IsNumericDataType();
	bool __fastcall IsStringDataType();
	bool __fastcall IsWideStringDataType();
	bool __fastcall IsBlobDataType();
	bool __fastcall IsDateTimeDataType();
	int __fastcall StrLen();
	void __fastcall InvertValue();
	void __fastcall Add(TABSVariant* Value);
	void __fastcall Sub(TABSVariant* Value);
	void __fastcall Mul(TABSVariant* Value);
	void __fastcall Division(TABSVariant* Value);
	Abstypes::TABSCompareResult __fastcall Compare(TABSVariant* Value, bool TrueFalseNullLogic = true, bool CaseInsensitive = true, bool PartialKey = false);
	void __fastcall TryToReduceWideStringToAnsiString();
	
private:
	void __fastcall SetDataType(Abstypes::TABSBaseFieldType DataType);
	void __fastcall CastResultToType(Abstypes::TABSBaseFieldType NewDataType, /* out */ void *Result);
	void __fastcall CastAndSetData(const void *Value, Abstypes::TABSBaseFieldType ValueType);
	void __fastcall CheckDataForNull();
	bool __fastcall GetIsNull();
	void __fastcall SetDataValue(const void *value, Abstypes::TABSBaseFieldType ValueType);
	void __fastcall GetDataValue(/* out */ void *Value, Abstypes::TABSBaseFieldType ValueType);
	void __fastcall SetDataAsSignedInt8(System::Int8 Value);
	System::Int8 __fastcall GetDataAsSignedInt8();
	void __fastcall SetDataAsSignedInt16(short Value);
	short __fastcall GetDataAsSignedInt16();
	void __fastcall SetDataAsSignedInt32(int Value);
	int __fastcall GetDataAsSignedInt32();
	void __fastcall SetDataAsSignedInt64(__int64 Value);
	__int64 __fastcall GetDataAsSignedInt64();
	void __fastcall SetDataAsUnsignedInt8(System::Byte Value);
	System::Byte __fastcall GetDataAsUnsignedInt8();
	void __fastcall SetDataAsUnsignedInt16(System::Word Value);
	System::Word __fastcall GetDataAsUnsignedInt16();
	void __fastcall SetDataAsUnsignedInt32(unsigned Value);
	unsigned __fastcall GetDataAsUnsignedInt32();
	void __fastcall SetDataAsAnsiString(System::AnsiString Value);
	System::AnsiString __fastcall GetDataAsAnsiString();
	void __fastcall SetDataAsWideString(System::WideString Value);
	System::WideString __fastcall GetDataAsWideString();
	void __fastcall SetDataAsSingle(float Value);
	float __fastcall GetDataAsSingle();
	void __fastcall SetDataAsDouble(double Value);
	double __fastcall GetDataAsDouble();
	void __fastcall SetDataAsExtended(System::Extended Value);
	System::Extended __fastcall GetDataAsExtended();
	void __fastcall SetDataAsABSDate(int Value);
	int __fastcall GetDataAsABSDate();
	void __fastcall SetDataAsTDate(System::TDateTime Value);
	System::TDateTime __fastcall GetDataAsTDate();
	void __fastcall SetDataAsABSTime(int Value);
	int __fastcall GetDataAsABSTime();
	void __fastcall SetDataAsTTime(System::TDateTime Value);
	System::TDateTime __fastcall GetDataAsTTime();
	void __fastcall SetDataAsABSDateTime(const Abstypes::TABSDateTime &Value);
	Abstypes::TABSDateTime __fastcall GetDataAsABSDateTime();
	void __fastcall SetDataAsTDateTime(System::TDateTime Value);
	System::TDateTime __fastcall GetDataAsTDateTime();
	void __fastcall SetDataAsBoolean(System::WordBool Value);
	System::WordBool __fastcall GetDataAsBoolean();
	void __fastcall SetDataAsCurrency(double Value);
	double __fastcall GetDataAsCurrency();
	void __fastcall SetDataAsVariant(const System::Variant &Value);
	System::Variant __fastcall GetDataAsVariant();
	
public:
	__property Abstypes::TABSBaseFieldType DataType = {read=FDataType, write=SetDataType, nodefault};
	__property int DataSize = {read=FDataSize, nodefault};
	__property bool IsNull = {read=GetIsNull, nodefault};
	__property char * pData = {read=FPData};
	__property System::ByteBool IsDataLinked = {read=FIsDataLinked, nodefault};
	__property System::Int8 AsShortint = {read=GetDataAsSignedInt8, write=SetDataAsSignedInt8, nodefault};
	__property short AsSmallint = {read=GetDataAsSignedInt16, write=SetDataAsSignedInt16, nodefault};
	__property int AsInteger = {read=GetDataAsSignedInt32, write=SetDataAsSignedInt32, nodefault};
	__property __int64 AsInt64 = {read=GetDataAsSignedInt64, write=SetDataAsSignedInt64};
	__property System::Byte AsByte = {read=GetDataAsUnsignedInt8, write=SetDataAsUnsignedInt8, nodefault};
	__property System::Word AsWord = {read=GetDataAsUnsignedInt16, write=SetDataAsUnsignedInt16, nodefault};
	__property unsigned AsCardinal = {read=GetDataAsUnsignedInt32, write=SetDataAsUnsignedInt32, nodefault};
	__property unsigned AsLongWord = {read=GetDataAsUnsignedInt32, write=SetDataAsUnsignedInt32, nodefault};
	__property float AsSingle = {read=GetDataAsSingle, write=SetDataAsSingle};
	__property double AsDouble = {read=GetDataAsDouble, write=SetDataAsDouble};
	__property System::Extended AsExtended = {read=GetDataAsExtended, write=SetDataAsExtended};
	__property System::AnsiString AsAnsiString = {read=GetDataAsAnsiString, write=SetDataAsAnsiString};
	__property System::WideString AsWideString = {read=GetDataAsWideString, write=SetDataAsWideString};
	__property int AsABSDate = {read=GetDataAsABSDate, write=SetDataAsABSDate, nodefault};
	__property int AsABSTime = {read=GetDataAsABSTime, write=SetDataAsABSTime, nodefault};
	__property Abstypes::TABSDateTime AsABSDateTime = {read=GetDataAsABSDateTime, write=SetDataAsABSDateTime};
	__property System::TDateTime AsTDate = {read=GetDataAsTDate, write=SetDataAsTDate};
	__property System::TDateTime AsTTime = {read=GetDataAsTTime, write=SetDataAsTTime};
	__property System::TDateTime AsTDateTime = {read=GetDataAsTDateTime, write=SetDataAsTDateTime};
	__property System::WordBool AsBoolean = {read=GetDataAsBoolean, write=SetDataAsBoolean, nodefault};
	__property System::WordBool AsLogical = {read=GetDataAsBoolean, write=SetDataAsBoolean, nodefault};
	__property double AsCurrency = {read=GetDataAsCurrency, write=SetDataAsCurrency};
	__property System::Variant AsVariant = {read=GetDataAsVariant, write=SetDataAsVariant};
};


//-- var, const, procedure ---------------------------------------------------
extern DELPHI_PACKAGE unsigned DefaultLocaleToCompareWideStrings;
extern DELPHI_PACKAGE Abstypes::TABSBaseFieldType __fastcall GetCommonDataType(Abstypes::TABSBaseFieldType a, Abstypes::TABSBaseFieldType b, bool ForCompare = false)/* overload */;
extern DELPHI_PACKAGE Abstypes::TABSAdvancedFieldType __fastcall GetCommonDataType(Abstypes::TABSAdvancedFieldType a, Abstypes::TABSAdvancedFieldType b, bool ForCompare = false)/* overload */;
extern DELPHI_PACKAGE char * __fastcall CastToNewBuffer(const void *Buffer, const int DataSize, const Abstypes::TABSBaseFieldType DataType, const Abstypes::TABSBaseFieldType NewDataType)/* overload */;
extern DELPHI_PACKAGE char * __fastcall CastToNewBuffer(const void *Buffer, const int DataSize, const Abstypes::TABSBaseFieldType DataType, const Abstypes::TABSBaseFieldType NewDataType, /* out */ int &NewDataSize)/* overload */;
extern DELPHI_PACKAGE Abstypes::TABSCompareResult __fastcall CompareValueBuffers(void * Buffer1, void * Buffer2, Abstypes::TABSBaseFieldType BaseFieldType1, Abstypes::TABSBaseFieldType BaseFieldType2, bool IsField1Null = false, bool IsField2Null = false, int PartialCompareLength = 0xffffffff, bool IgnoreCase = false, unsigned LocaleID = (unsigned)(0x400));
extern DELPHI_PACKAGE int __fastcall CompareValueBuffersForOrder(void * Buffer1, void * Buffer2, Abstypes::TABSBaseFieldType BaseFieldType1, Abstypes::TABSBaseFieldType BaseFieldType2, bool IsField1Null = false, bool IsField2Null = false, int PartialCompareLength = 0xffffffff, bool IgnoreCase = false, unsigned LocaleID = (unsigned)(0x400));
}	/* namespace Absvariant */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_ABSVARIANT)
using namespace Absvariant;
#endif
#pragma pack(pop)
#pragma option pop

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