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

// (DO NOT EDIT: machine generated header) 'NameList.pas' rev: 22.00

#ifndef NamelistHPP
#define NamelistHPP

#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 <Windows.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit

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

namespace Namelist
{
//-- type declarations -------------------------------------------------------
typedef void __fastcall (*TFreeProc)(void * Data);

typedef int __fastcall (*TCompareFunc)(void * Data1, void * Data2);

typedef int __fastcall (*THashFunction)(const System::UnicodeString Key, int Size);

class DELPHICLASS TRecordList;
class PASCALIMPLEMENTATION TRecordList : public System::TObject
{
	typedef System::TObject inherited;
	
public:
	void * operator[](int Index) { return Items[Index]; }
	
private:
	int FActElemSize;
	char *FArray;
	int FCount;
	int FCapacity;
	int FElementSize;
	bool FIsSorted;
	int FMaxElemCount;
	
protected:
	void * __fastcall GetItem(int Index);
	void __fastcall SetCapacity(int NewCapacity);
	void __fastcall SetCount(int NewCount);
	bool __fastcall BinarySearch(void * Item, TCompareFunc Compare, int &Index);
	void __fastcall Expand(void);
	
public:
	__fastcall TRecordList(int Size);
	__fastcall virtual ~TRecordList(void);
	int __fastcall Add(void * Item);
	void __fastcall Clear(void);
	void __fastcall Delete(int Index);
	void __fastcall Exchange(int Index1, int Index2);
	void * __fastcall First(void);
	int __fastcall IndexOf(void * Item, TCompareFunc Compare);
	void __fastcall Insert(int Index, void * Item);
	int __fastcall InsertSorted(void * Item, TCompareFunc Compare);
	void * __fastcall Last(void);
	void __fastcall Move(int Index, int NewIndex);
	int __fastcall Remove(void * Item, TCompareFunc Compare);
	void __fastcall Sort(TCompareFunc Compare);
	__property int Capacity = {read=FCapacity, write=SetCapacity, nodefault};
	__property int Count = {read=FCount, write=SetCount, nodefault};
	__property int ElementSize = {read=FActElemSize, nodefault};
	__property bool IsSorted = {read=FIsSorted, nodefault};
	__property void * Items[int Index] = {read=GetItem/*, default*/};
	__property int MaxCount = {read=FMaxElemCount, nodefault};
};


class DELPHICLASS TNameList;
class PASCALIMPLEMENTATION TNameList : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	int FCount;
	TFreeProc FDispose;
	THashFunction FHashFunc;
	TRecordList* FHashList;
	
protected:
	void __fastcall AlterSize(int NewSize);
	void __fastcall Resize(void);
	int __fastcall IndexOf(const System::UnicodeString Key, void * &Item);
	
public:
	__fastcall TNameList(int Size, THashFunction HashFunc, TFreeProc DisposeProc);
	__fastcall virtual ~TNameList(void);
	void __fastcall Delete(const System::UnicodeString Key);
	void __fastcall Clear(void);
	bool __fastcall Find(const System::UnicodeString Key, void * &Item);
	bool __fastcall Insert(const System::UnicodeString Key, void * Item);
	__property int Count = {read=FCount, nodefault};
};


//-- var, const, procedure ---------------------------------------------------
extern PACKAGE int __fastcall HashKey(const System::UnicodeString Key, int Size);

}	/* namespace Namelist */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE)
using namespace Namelist;
#endif
#pragma pack(pop)
#pragma option pop

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