Changeset 2076
- Timestamp:
- 11/28/07 01:28:58 (5 years ago)
- Location:
- lang/ruby/RubyESRIShape
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/RubyESRIShape/RubyESRIShape.c
r2062 r2076 85 85 rb_raise(rb_eIOError, "shape types unmatched between files."); 86 86 87 /* ESHP_NOINDEXFILE doesn't raise any errors */ 88 87 89 return Qnil; 88 90 } … … 121 123 122 124 return self; 125 } 126 127 static VALUE rb_shape_type(VALUE self) 128 { 129 RShapeData* indata; 130 Data_Get_Struct(self, RShapeData, indata); 131 132 return INT2NUM( c_Shape_getType(indata->pThis) ); 123 133 } 124 134 … … 367 377 rb_define_method(rb_cShape, "length", rb_shape_length, 0); 368 378 rb_define_method(rb_cShape, "each", rb_shape_each , 0); 379 rb_define_method(rb_cShape, "type", rb_shape_type , 0); 369 380 370 381 // class -
lang/ruby/RubyESRIShape/Shape.cpp
r2062 r2076 27 27 { 28 28 return (ESRIShapeType)mSHPFHeader.shapetype; 29 } 30 31 int Shape::getTypeAsInt() const 32 { 33 return mSHPFHeader.shapetype; 29 34 } 30 35 … … 44 49 _tcscpy(actualName + orgLen, ".shx"); 45 50 rv = readIndexFile(actualName); 46 47 //_tcscpy(actualName + orgLen, ".dbf");48 51 } 49 52 … … 423 426 {return ((Shape*)pThis)->getLength();} 424 427 428 int c_Shape_getType(void* pThis) 429 {return ((Shape*)pThis)->getTypeAsInt();} 430 425 431 void c_Shape_markRubyGC(void* pThis) 426 432 {((Shape*)pThis)->markRubyGC();} -
lang/ruby/RubyESRIShape/Shape.h
r2062 r2076 16 16 17 17 typedef long ESInt32; 18 typedef short ESInt16; 18 19 typedef unsigned long ESUInt32; 19 20 typedef double ESDouble; // MSVC … … 57 58 } SHPFileHeader; 58 59 59 60 60 typedef struct _SHPRecordHeader { 61 61 ESInt32 index; … … 84 84 VALUE getRecordAt(int index); 85 85 int getLength() const; 86 int getTypeAsInt() const; 86 87 void markRubyGC(); 87 88 … … 144 145 int c_Shape_getLength(void* pThis); 145 146 void c_Shape_markRubyGC(void* pThis); 147 int c_Shape_getType(void* pThis); 146 148 147 149 void c_Polygon_delete(void* pThis);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)