/* pqhdrw.h Copyright (c) 1993-2022, David A. Clunie DBA PixelMed Publishing. All rights reserved. */
#ifdef CRAP

// Automatically generated from template - EDITS WILL BE LOST
//
// Generated by tpltohdr.awk with options or defaults ...
//
// 	 role=wholeheader
// 	 prefix=PQ_
// 	 dicomfunctionname=ToDicom_Template
// 	 dumpcommonfunctionname=DumpCommon
// 	 dumpselectedimagefunctionname=DumpSelectedImage
// 	 headeroffsetprefix=PQ_Offset
// 	 headeroffsetsuffix=ptr
// 	 headerclassprefix=PQ_HeaderClass
// 	 headerdicomclassprefix=PQ_Header_BothClass
// 	 headerdumpclassprefix=PQ_Header_BothClass
// 	 headerinstanceprefix=PQ_HeaderInstance
// 	 methodnameprefix=PQ_Method
// 	 methodconstructorargsprefix=PQ_MethodConstructorArgs
// 	 headerclassparameters=

class PQ_HeaderClass
{
public:
	PQ_HeaderClass(istream *ist);

	PQ_HeaderClass_STDHDR *PQ_HeaderInstance_STDHDR;
	PQ_HeaderClass_IMGHDR *PQ_HeaderInstance_IMGHDR;
	PQ_HeaderClass_IMGHDR2 *PQ_HeaderInstance_IMGHDR2;
};

#endif

class PQ_HeaderClass
{
protected: 
	int dbrec_nrec;
	char **db_fieldname;
	unsigned *db_offset;
	unsigned *db_length;
	unsigned *db_vtype;
	char **db_value;
	long pixel_offset;

	bool getAttributeEntry(const char *name,int &index) const;
	bool getStringAttribute(const char *name,int &index,char *&value,int &length) const;
public:
	PQ_HeaderClass(istream *ist);
	~PQ_HeaderClass();

	bool getAsciiAttribute(const char *name,char *&value,int &length) const;
	bool getIntegerAttribute(const char *name,Int32 &value) const;
	bool getDateAttribute(const char *name,char *&value,int &length) const;
	bool getTimeAttribute(const char *name,char *&value,int &length) const;
	bool getFileAttribute(const char *name,char *&value,int &length) const;
	bool getFlagAttribute(const char *name,char *&value,int &length) const;
	bool getFloatAttribute(const char *name,Float64 &value) const;

	long getPixelOffset(void) const { return pixel_offset; }
};

