#ifndef _WORKSHT_RECORD_HPP_ #define _WORKSHT_RECORD_HPP_ #ifndef _COMMON_WINDOWS_HPP_ #include #endif #ifndef _COMMON_STRING_HPP_ #include #endif #ifndef _FILEIO_FILEIO_HPP_ #include #endif class Record { public: enum RecordType{Split=0x04,Sync=0x05,Win1=0x07,Win2=0x09,ColW2=0x0A,Name=0x0B,QRange=0x19,PRange=0x1A, SRange=0x1B,KRange1=0x1D,KRange2=0x23,Footer=0x25,Header=0x26,Setup=0x27,Margins=0x28,Titles=0x2A, Graph=0x2D,NGraph=0x2E,Bof=0x00,Eof=0x01,CalcMode=0x02,CalcOrder=0x03,Range=0x06,ColW1=0x08,Blank=0x0C, Integer=0x0D,Number=0x0E,Label=0x0F,Formula=0x10,Table=0x18,FRange=0x1C,HRange=0x20,Protec=0x24, LabelFmt=0x29,CalcCount=0x2F,UnFormatted=0x30,CursorW12=0x31}; Record(void); Record(const Record &someRecord); Record(RecordType type,WORD length); virtual ~Record(); Record &operator=(const Record &someRecord); BOOL operator==(const Record &someRecord); operator String(void)const; RecordType type(void)const; void type(RecordType type); WORD length(void)const; void length(WORD length); bool read(FileIO &inFile); bool write(FileIO &outFile); String toString(void)const; private: RecordType mRecordType; WORD mRecordLength; }; inline Record::Record(void) : mRecordType(Eof), mRecordLength(0) { } inline Record::Record(RecordType type,WORD length) : mRecordType(type), mRecordLength(length) { } inline Record::Record(const Record &someRecord) { *this=someRecord; } inline Record::~Record() { } inline Record &Record::operator=(const Record &someRecord) { type(someRecord.type()); length(someRecord.length()); return *this; } inline BOOL Record::operator==(const Record &someRecord) { return (type()==someRecord.type()&& length()==someRecord.length()); } inline Record::operator String(void)const { switch(type()) { case Split : return "Split"; case Sync : return "Sync"; case Win1 : return "Win1"; case Win2 : return "Win2"; case ColW2 : return "ColW2"; case Name : return "Name"; case QRange : return "QRange"; case PRange : return "PRange"; case SRange : return "SRange"; case KRange1 : return "KRange1"; case KRange2 : return "KRange2"; case Footer : return "Footer"; case Header : return "Header"; case Setup : return "Setup"; case Margins : return "Margins"; case Titles : return "Titles"; case Graph : return "Graph"; case NGraph : return "NGraph"; case Bof : return "Bof"; case Eof : return "Eof"; case CalcMode : return "CalcMode"; case CalcOrder : return "CalcOrder"; case Range : return "Range"; case ColW1 : return "ColW1"; case Blank : return "Blank"; case Integer : return "Integer"; case Number : return "Number"; case Label : return "Label"; case Formula : return "Formula"; case Table : return "Table"; case FRange : return "FRange"; case HRange : return "HRange"; case Protec : return "Protec"; case LabelFmt : return "LabelFmt"; case CalcCount : return "CalcCount"; case UnFormatted : return "Unformatted"; case CursorW12 : return "CursorW12"; default : return "Unknown"; } } inline Record::RecordType Record::type(void)const { return mRecordType; } inline void Record::type(RecordType type) { mRecordType=type; } inline WORD Record::length(void)const { return mRecordLength; } inline void Record::length(WORD length) { mRecordLength=length; } #endif