root/lang/ruby/first_ci/Shape.h @ 1980

Revision 1980, 1.1 kB (checked in by gyuque, 6 years ago)

imported

Line 
1#ifndef SHAPE_H
2#define SHAPE_H
3
4#include "tchar.h"
5
6typedef int es_error_t;
7#define ESHP_OK         0
8#define ESHP_CANNOTOPEN 10
9
10#ifdef __cplusplus
11
12typedef long ESInt32;
13
14typedef struct _SHPFileHeader {
15        // BE
16        ESInt32 filecode;
17        ESInt32 rsv1;
18        ESInt32 rsv2;
19        ESInt32 rsv3;
20        ESInt32 rsv4;
21        ESInt32 rsv5;
22        ESInt32 filelength;
23
24        // LE
25        ESInt32 version;
26        ESInt32 shapetype;
27} SHPFileHeader;
28
29typedef enum {
30        ESHT_Null       = 0,
31        ESHT_Point      = 1,
32        ESHT_PolyLine   = 3,
33        ESHT_Polygon    = 5,
34        ESHT_MultiPoint = 8,
35} ESRIShapeType;
36
37class Shape
38{
39public:
40        Shape();
41        virtual ~Shape();
42
43        es_error_t readFromFile(const TCHAR* filename);
44private:
45        static ESInt32 freadBig32(FILE* fp);
46        static ESInt32 freadLittle32(FILE* fp);
47
48        void clearBaseName();
49        void storeBaseName(const TCHAR* baseName);
50        es_error_t readMainFile(const TCHAR* filename);
51
52        TCHAR* mBaseName;
53        SHPFileHeader mSHPFHeader;
54};
55
56extern "C" {
57#endif // __cplusplus
58
59void* c_Shape_new();
60void c_Shape_delete(void* pThis);
61es_error_t c_Shape_readFromFile(void* pThis, const TCHAR* filename);
62
63#ifdef __cplusplus
64}
65#endif // __cplusplus
66
67#endif
Note: See TracBrowser for help on using the browser.