// Change History
// 11/18/03 AV Development: Merge From Production version 7
// 11/10/03 AV Production: Roll back T_Caption/T_CaptionShort size to 64/16
// 10/29/03 AV Production: Increase static DRS_FileKey/DRS_FileSetting buffer sizes from 64 to 256
// 10/8/03 AV Development: Add data field type DATAFIELDTYPE_UNKNOWN

// Platform-dependent types and size definitions

#ifndef DRS_TYPE_H
#define DRS_TYPE_H

#include <memory>

#include "base/AT_GlobalTypes.h"
#include "base/at_defs.h"
#include "drs_util.h"
#include "drs_error.h"

//Undefined states/values
#define UNDEFINED_UINT32 (uint32)-1L
#define UNDEFINED_UINT16 (uint16)-1
#define UNDEFINED_UINT (uint)-1

#define MAX_UINT (uint) -1
#ifdef __WIN32__
#define MAX_INT 0x7FFFFFFF
#else
#define MAX_INT 0x7FFF
#endif


#define SIZE_FileName MAX_PATH
#define SIZE_DirectoryName MAX_PATH
#define SIZE_DirectoryPath MAX_PATH
#define SIZE_FilePath (SIZE_DirectoryPath+SIZE_FileName)

typedef unsigned char T_FileName[SIZE_FileName];
typedef unsigned char T_FilePath[SIZE_FilePath];
typedef unsigned char T_DirectoryName[SIZE_DirectoryName];
typedef unsigned char T_DirectoryPath[SIZE_DirectoryPath];

typedef unsigned char T_Caption[MAX_CAPTION_SIZE];
typedef unsigned char T_CaptionShort[MAX_CAPTION_SHORT_SIZE];

typedef unsigned char DRS_FileName[SIZE_FileName];
typedef unsigned char DRS_FilePath[SIZE_FilePath];
typedef unsigned char DRS_DirectoryName[SIZE_DirectoryName];
typedef unsigned char DRS_DirectoryPath[SIZE_DirectoryPath];

typedef unsigned char DRS_FileKey[SIZE_FilePath];
typedef unsigned char DRS_FileSetting[SIZE_FilePath];


//Fix strcpy for debug/none debug builds
#ifdef _DEBUG

#define strcpy(x, y) std::strcpy(x, y)

#endif

enum enumDataField_Type { DATAFIELDTYPE_TEXT, DATAFIELDTYPE_INTEGER, DATAFIELDTYPE_COUNT, DATAFIELDTYPE_UNKNOWN};

//#include "drs_setting.h"
class DRS_Setting;

class DRS_DescriptorSerialize : public DRS_Descriptor
{
public:
  DRS_DescriptorSerialize();
  DRS_DescriptorSerialize( DRS_Descriptor const &rDescr);
  DRS_DescriptorSerialize( DRS_DescriptorSerialize const &rDescr);
  DRS_DescriptorSerialize( AT_String sFile, AT_String sSection, AT_String  sKey);
  DRS_DescriptorSerialize( AT_String sFile, AT_String sSection, DRS_Setting BaseKey);
  DRS_DescriptorSerialize( byte * s);

  inline DRS_DescriptorSerialize const & Descriptor() const {return *this;};

  bool Serialise( byte *sSection, byte *sKey, byte *sFile);

  //DRS_Erc Deserialise( FILE *hFile); //Extract from file
  DRS_DescriptorSerialize const & Extract( byte *buf);       //Extract from string

  inline bool operator!() const
                        {return( ! ( Caption[0] || Descr[0] || ID[0] ) ); };
};




#endif
