|
Last change
on this file since 5702 was 5534, checked in by bird, 25 years ago |
|
Preinitial coding of SDF file format class.
|
|
File size:
2.0 KB
|
| Line | |
|---|
| 1 | /* $Id: kFileSDF.h,v 1.1 2001-04-17 04:16:03 bird Exp $
|
|---|
| 2 | *
|
|---|
| 3 | * kFileSDF- Structure Defintion File class declaration.
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright (c) 1999-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
|---|
| 6 | *
|
|---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 8 | *
|
|---|
| 9 | */
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 | /*******************************************************************************
|
|---|
| 14 | * Structures and Typedefs *
|
|---|
| 15 | *******************************************************************************/
|
|---|
| 16 | typedef struct _SDFType
|
|---|
| 17 | {
|
|---|
| 18 | char szName[33];
|
|---|
| 19 | char szStruct[34];
|
|---|
| 20 | unsigned long cb;
|
|---|
| 21 | unsigned long ulPointerLevel;
|
|---|
| 22 | unsigned long aul[8];
|
|---|
| 23 | } SDFTYPE, *PSDFTYPE;
|
|---|
| 24 |
|
|---|
| 25 | typedef struct _SDFMember
|
|---|
| 26 | {
|
|---|
| 27 | char szName[33];
|
|---|
| 28 | char szType[33];
|
|---|
| 29 | char szType2[34];
|
|---|
| 30 | unsigned long cb;
|
|---|
| 31 | unsigned long offset;
|
|---|
| 32 | unsigned char ch1;
|
|---|
| 33 | unsigned char ch2;
|
|---|
| 34 | unsigned char ch3;
|
|---|
| 35 | unsigned char chPointerLevel;
|
|---|
| 36 | unsigned long aul[5];
|
|---|
| 37 | } SDFMEMBER, *PSDFMEMBER;
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 | typedef struct _SDFStruct
|
|---|
| 41 | {
|
|---|
| 42 | char szName[33];
|
|---|
| 43 | char szDescription[35];
|
|---|
| 44 | unsigned long cb;
|
|---|
| 45 | unsigned long cMembers;
|
|---|
| 46 | unsigned long ul1;
|
|---|
| 47 | unsigned short us2a;
|
|---|
| 48 | unsigned short us2b;
|
|---|
| 49 | unsigned long ul3;
|
|---|
| 50 | unsigned long ul4;
|
|---|
| 51 | unsigned long ul5;
|
|---|
| 52 | unsigned long ul6;
|
|---|
| 53 | SDFMEMBER aMembers[1];
|
|---|
| 54 | } SDFSTRUCT, *PSDFSTRUCT;
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 | typedef struct _SDFHeader
|
|---|
| 58 | {
|
|---|
| 59 | unsigned long cStructs;
|
|---|
| 60 | unsigned long cTypes;
|
|---|
| 61 | unsigned long ul[12];
|
|---|
| 62 | } SDFHEADER, *PSDFHEADER;
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 | /**
|
|---|
| 67 | * Structure Definition File Class.
|
|---|
| 68 | * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
|---|
| 69 | */
|
|---|
| 70 | class kFileSDF : public kFileFormatBase
|
|---|
| 71 | {
|
|---|
| 72 | private:
|
|---|
| 73 | PSDFHEADER pHdr;
|
|---|
| 74 | PSDFSTRUCT* papStructs;
|
|---|
| 75 | PSDFTYPE paTypes;
|
|---|
| 76 |
|
|---|
| 77 | void parseSDFFile(void *pvFile) throw(int);
|
|---|
| 78 | PSDFTYPE getType(const char *pszType);
|
|---|
| 79 | PSDFSTRUCT getStruct(const char *pszStruct);
|
|---|
| 80 |
|
|---|
| 81 | public:
|
|---|
| 82 | kFileSDF(kFile *pFile) throw(int);
|
|---|
| 83 | ~kFileSDF();
|
|---|
| 84 |
|
|---|
| 85 | BOOL dump(kFile *pOut);
|
|---|
| 86 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.