|
Revision 13041, 1.4 kB
(checked in by robert, 15 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | #ifndef XBASEPARSER_H_ |
|---|
| 2 | #define XBASEPARSER_H_ |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | #include <vector> |
|---|
| 7 | #include <string> |
|---|
| 8 | |
|---|
| 9 | #include "ESRIType.h" |
|---|
| 10 | |
|---|
| 11 | #include <osg/ref_ptr> |
|---|
| 12 | #include <osgSim/ShapeAttribute> |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | namespace ESRIShape |
|---|
| 17 | { |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | struct XBaseHeader |
|---|
| 21 | { |
|---|
| 22 | Byte _versionNumber; |
|---|
| 23 | Byte _lastUpdate[3]; |
|---|
| 24 | Integer _numRecord; |
|---|
| 25 | Short _headerLength; |
|---|
| 26 | Short _recordLength; |
|---|
| 27 | Short _reserved; |
|---|
| 28 | Byte _incompleteTransaction; |
|---|
| 29 | Byte _encryptionFlag; |
|---|
| 30 | Integer _freeRecordThread; |
|---|
| 31 | Integer _reservedMultiUser[2]; |
|---|
| 32 | Byte _mdxflag; |
|---|
| 33 | Byte _languageDriver; |
|---|
| 34 | Short _reserved2; |
|---|
| 35 | |
|---|
| 36 | void print(); |
|---|
| 37 | bool read(int fd); |
|---|
| 38 | }; |
|---|
| 39 | |
|---|
| 40 | struct XBaseFieldDescriptor |
|---|
| 41 | { |
|---|
| 42 | Byte _name[11]; |
|---|
| 43 | Byte _fieldType; |
|---|
| 44 | Integer _fieldDataAddress; |
|---|
| 45 | Byte _fieldLength; |
|---|
| 46 | Byte _decimalCount; |
|---|
| 47 | Short _reservedMultiUser; |
|---|
| 48 | Byte _workAreaID; |
|---|
| 49 | Short _reservedMultiUser2; |
|---|
| 50 | Byte _setFieldFlag; |
|---|
| 51 | Byte _reserved[7]; |
|---|
| 52 | Byte _indexFieldFlag; |
|---|
| 53 | |
|---|
| 54 | void print(); |
|---|
| 55 | bool read(int fd); |
|---|
| 56 | }; |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | class XBaseParser |
|---|
| 60 | { |
|---|
| 61 | public: |
|---|
| 62 | |
|---|
| 63 | typedef std::vector< osg::ref_ptr<osgSim::ShapeAttributeList> > ShapeAttributeListList; |
|---|
| 64 | |
|---|
| 65 | XBaseParser(const std::string fileName); |
|---|
| 66 | ~XBaseParser() {} |
|---|
| 67 | ShapeAttributeListList & getAttributeList() { return _shapeAttributeListList; } |
|---|
| 68 | |
|---|
| 69 | private: |
|---|
| 70 | |
|---|
| 71 | XBaseParser(); |
|---|
| 72 | |
|---|
| 73 | bool parse(int fd); |
|---|
| 74 | |
|---|
| 75 | ShapeAttributeListList _shapeAttributeListList; |
|---|
| 76 | bool _valid; |
|---|
| 77 | }; |
|---|
| 78 | |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | #endif |
|---|