Changeset 11385
- Timestamp:
- 05/01/07 09:22:04 (2 years ago)
- Files:
-
- branches/1.4/gdal/swig/python/gdalconst.py (modified) (2 diffs)
- branches/1.4/gdal/swig/python/gdalconst_wrap.c (modified) (16 diffs)
- branches/1.4/gdal/swig/python/ogr.py (modified) (4 diffs)
- branches/1.4/gdal/swig/python/ogr_wrap.cpp (modified) (73 diffs)
- branches/1.4/gdal/swig/python/osr.py (modified) (2 diffs)
- branches/1.4/gdal/swig/python/osr_wrap.cpp (modified) (47 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.4/gdal/swig/python/gdalconst.py
r10420 r11385 1 # This file was created automatically by SWIG 1.3.29. 1 # This file was automatically generated by SWIG (http://www.swig.org). 2 # Version 1.3.31 3 # 2 4 # Don't modify this file, modify the SWIG interface instead. 3 5 # This file is compatible with both classic and new-style classes. … … 6 8 import new 7 9 new_instancemethod = new.instancemethod 10 try: 11 _swig_property = property 12 except NameError: 13 pass # Python < 2.2 doesn't have 'property'. 8 14 def _swig_setattr_nondynamic(self,class_type,name,value,static=1): 9 15 if (name == "thisown"): return self.this.own(value) branches/1.4/gdal/swig/python/gdalconst_wrap.c
r10420 r11385 1 1 /* ---------------------------------------------------------------------------- 2 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 1.3. 293 * Version 1.3.31 4 4 * 5 5 * This file is not intended to be easily readable and contains a number of … … 104 104 105 105 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ 106 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) 106 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) 107 107 # define _CRT_SECURE_NO_DEPRECATE 108 108 #endif … … 121 121 /* This should only be incremented when either the layout of swig_type_info changes, 122 122 or for whatever reason, the runtime changes incompatibly */ 123 #define SWIG_RUNTIME_VERSION " 2"123 #define SWIG_RUNTIME_VERSION "3" 124 124 125 125 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ … … 698 698 699 699 700 /* Python.h has to appear first */701 #include <Python.h>702 700 703 701 /* Add PyOS_snprintf for old Pythons */ … … 780 778 #endif 781 779 780 /* Py_ssize_t for old Pythons */ 781 /* This code is as recommended by: */ 782 /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ 783 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) 784 typedef int Py_ssize_t; 785 # define PY_SSIZE_T_MAX INT_MAX 786 # define PY_SSIZE_T_MIN INT_MIN 787 #endif 782 788 783 789 /* ----------------------------------------------------------------------------- … … 1173 1179 _SWIG_Py_None(void) 1174 1180 { 1175 PyObject *none = Py_BuildValue( "");1181 PyObject *none = Py_BuildValue((char*)""); 1176 1182 Py_DECREF(none); 1177 1183 return none; … … 2032 2038 2033 2039 /* here we get the method pointer for callbacks */ 2034 c har *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);2040 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); 2035 2041 const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; 2036 2042 if (desc) { … … 2153 2159 } 2154 2160 #endif 2155 dict = PyObject_GetAttrString(inst, "__dict__");2161 dict = PyObject_GetAttrString(inst, (char*)"__dict__"); 2156 2162 PyDict_SetItem(dict, SWIG_This(), swig_this); 2157 2163 Py_DECREF(dict); … … 2294 2300 /* The python cached type query */ 2295 2301 SWIGRUNTIME PyObject * 2296 SWIG_Python_TypeCache( ) {2302 SWIG_Python_TypeCache(void) { 2297 2303 static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); 2298 2304 return cache; … … 2453 2459 #if (PY_VERSION_HEX <= 0x02000000) 2454 2460 # if !defined(SWIG_PYTHON_CLASSIC) 2455 # error "This python version requires to use swigwith the '-classic' option"2461 # error "This python version requires swig to be run with the '-classic' option" 2456 2462 # endif 2457 2463 #endif … … 2464 2470 #define SWIG_name "_gdalconst" 2465 2471 2466 #define SWIGVERSION 0x010329 2472 #define SWIGVERSION 0x010331 2473 #define SWIG_VERSION SWIGVERSION 2467 2474 2468 2475 … … 2488 2495 2489 2496 SWIGINTERN swig_type_info* 2490 SWIG_pchar_descriptor( )2497 SWIG_pchar_descriptor(void) 2491 2498 { 2492 2499 static int init = 0; … … 2568 2575 * 2569 2576 * The generated swig_type_info structures are assigned staticly to an initial 2570 * array. We just loop th ough that array, and handle each type individually.2577 * array. We just loop through that array, and handle each type individually. 2571 2578 * First we lookup if this type has been already loaded, and if so, use the 2572 2579 * loaded structure instead of the generated one. Then we have to fill in the … … 2606 2613 #endif 2607 2614 2615 2608 2616 SWIGRUNTIME void 2609 2617 SWIG_InitializeModule(void *clientdata) { 2610 2618 size_t i; 2611 swig_module_info *module_head ;2612 static int init_run = 0;2619 swig_module_info *module_head, *iter; 2620 int found; 2613 2621 2614 2622 clientdata = clientdata; 2615 2623 2616 if (init_run) return; 2617 init_run = 1; 2618 2619 /* Initialize the swig_module */ 2620 swig_module.type_initial = swig_type_initial; 2621 swig_module.cast_initial = swig_cast_initial; 2624 /* check to see if the circular list has been setup, if not, set it up */ 2625 if (swig_module.next==0) { 2626 /* Initialize the swig_module */ 2627 swig_module.type_initial = swig_type_initial; 2628 swig_module.cast_initial = swig_cast_initial; 2629 swig_module.next = &swig_module; 2630 } 2622 2631 2623 2632 /* Try and load any already created modules */ 2624 2633 module_head = SWIG_GetModule(clientdata); 2625 if (module_head) { 2634 if (!module_head) { 2635 /* This is the first module loaded for this interpreter */ 2636 /* so set the swig module into the interpreter */ 2637 SWIG_SetModule(clientdata, &swig_module); 2638 module_head = &swig_module; 2639 } else { 2640 /* the interpreter has loaded a SWIG module, but has it loaded this one? */ 2641 found=0; 2642 iter=module_head; 2643 do { 2644 if (iter==&swig_module) { 2645 found=1; 2646 break; 2647 } 2648 iter=iter->next; 2649 } while (iter!= module_head); 2650 2651 /* if the is found in the list, then all is done and we may leave */ 2652 if (found) return; 2653 /* otherwise we must add out module into the list */ 2626 2654 swig_module.next = module_head->next; 2627 2655 module_head->next = &swig_module; 2628 } else {2629 /* This is the first module loaded */2630 swig_module.next = &swig_module;2631 SWIG_SetModule(clientdata, &swig_module);2632 2656 } 2633 2657 … … 2942 2966 2943 2967 SWIGINTERN PyObject * 2944 SWIG_globals( ) {2968 SWIG_globals(void) { 2945 2969 static PyObject *_SWIG_globals = 0; 2946 2970 if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); … … 2987 3011 size_t i; 2988 3012 for (i = 0; methods[i].ml_name; ++i) { 2989 c har *c = methods[i].ml_doc;3013 const char *c = methods[i].ml_doc; 2990 3014 if (c && (c = strstr(c, "swig_ptr: "))) { 2991 3015 int j; 2992 3016 swig_const_info *ci = 0; 2993 c har *name = c + 10;3017 const char *name = c + 10; 2994 3018 for (j = 0; const_table[j].type; ++j) { 2995 3019 if (strncmp(const_table[j].name, name, branches/1.4/gdal/swig/python/ogr.py
r10427 r11385 1 # This file was created automatically by SWIG 1.3.29. 1 # This file was automatically generated by SWIG (http://www.swig.org). 2 # Version 1.3.31 3 # 2 4 # Don't modify this file, modify the SWIG interface instead. 3 5 # This file is compatible with both classic and new-style classes. … … 6 8 import new 7 9 new_instancemethod = new.instancemethod 10 try: 11 _swig_property = property 12 except NameError: 13 pass # Python < 2.2 doesn't have 'property'. 8 14 def _swig_setattr_nondynamic(self,class_type,name,value,static=1): 9 15 if (name == "thisown"): return self.this.own(value) … … 102 108 __repr__ = _swig_repr 103 109 __swig_getmethods__["name"] = _ogr.Driver_name_get 104 if _newclass:name = property(_ogr.Driver_name_get)110 if _newclass:name = _swig_property(_ogr.Driver_name_get) 105 111 def CreateDataSource(*args, **kwargs): 106 112 """CreateDataSource(self, char name, char options=0) -> DataSource""" … … 139 145 __repr__ = _swig_repr 140 146 __swig_getmethods__["name"] = _ogr.DataSource_name_get 141 if _newclass:name = property(_ogr.DataSource_name_get)147 if _newclass:name = _swig_property(_ogr.DataSource_name_get) 142 148 __swig_destroy__ = _ogr.delete_DataSource 143 149 __del__ = lambda self : None; branches/1.4/gdal/swig/python/ogr_wrap.cpp
r10420 r11385 1 1 /* ---------------------------------------------------------------------------- 2 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 1.3. 293 * Version 1.3.31 4 4 * 5 5 * This file is not intended to be easily readable and contains a number of … … 121 121 122 122 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ 123 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) 123 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) 124 124 # define _CRT_SECURE_NO_DEPRECATE 125 125 #endif … … 138 138 /* This should only be incremented when either the layout of swig_type_info changes, 139 139 or for whatever reason, the runtime changes incompatibly */ 140 #define SWIG_RUNTIME_VERSION " 2"140 #define SWIG_RUNTIME_VERSION "3" 141 141 142 142 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ … … 715 715 716 716 717 /* Python.h has to appear first */718 #include <Python.h>719 717 720 718 /* Add PyOS_snprintf for old Pythons */ … … 797 795 #endif 798 796 797 /* Py_ssize_t for old Pythons */ 798 /* This code is as recommended by: */ 799 /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ 800 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) 801 typedef int Py_ssize_t; 802 # define PY_SSIZE_T_MAX INT_MAX 803 # define PY_SSIZE_T_MIN INT_MIN 804 #endif 799 805 800 806 /* ----------------------------------------------------------------------------- … … 1190 1196 _SWIG_Py_None(void) 1191 1197 { 1192 PyObject *none = Py_BuildValue( "");1198 PyObject *none = Py_BuildValue((char*)""); 1193 1199 Py_DECREF(none); 1194 1200 return none; … … 2049 2055 2050 2056 /* here we get the method pointer for callbacks */ 2051 c har *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);2057 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); 2052 2058 const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; 2053 2059 if (desc) { … … 2170 2176 } 2171 2177 #endif 2172 dict = PyObject_GetAttrString(inst, "__dict__");2178 dict = PyObject_GetAttrString(inst, (char*)"__dict__"); 2173 2179 PyDict_SetItem(dict, SWIG_This(), swig_this); 2174 2180 Py_DECREF(dict); … … 2311 2317 /* The python cached type query */ 2312 2318 SWIGRUNTIME PyObject * 2313 SWIG_Python_TypeCache( ) {2319 SWIG_Python_TypeCache(void) { 2314 2320 static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); 2315 2321 return cache; … … 2486 2492 #if (PY_VERSION_HEX <= 0x02000000) 2487 2493 # if !defined(SWIG_PYTHON_CLASSIC) 2488 # error "This python version requires to use swigwith the '-classic' option"2494 # error "This python version requires swig to be run with the '-classic' option" 2489 2495 # endif 2490 2496 #endif … … 2497 2503 #define SWIG_name "_ogr" 2498 2504 2499 #define SWIGVERSION 0x010329 2505 #define SWIGVERSION 0x010331 2506 #define SWIG_VERSION SWIGVERSION 2500 2507 2501 2508 … … 2597 2604 2598 2605 SWIGINTERN swig_type_info* 2599 SWIG_pchar_descriptor( )2606 SWIG_pchar_descriptor(void) 2600 2607 { 2601 2608 static int init = 0; … … 2637 2644 { 2638 2645 if (PyString_Check(obj)) { 2639 char *cstr; int len;2646 char *cstr; Py_ssize_t len; 2640 2647 PyString_AsStringAndSize(obj, &cstr, &len); 2641 2648 if (cptr) { … … 3549 3556 arg1 = reinterpret_cast< OGRDriverShadow * >(argp1); 3550 3557 result = (char *)OGRDriverShadow_name_get(arg1); 3551 resultobj = SWIG_FromCharPtr( result);3558 resultobj = SWIG_FromCharPtr((const char *)result); 3552 3559 return resultobj; 3553 3560 fail: … … 3584 3591 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_CreateDataSource" "', argument " "2"" of type '" "char const *""'"); 3585 3592 } 3586 arg2 = buf2;3593 arg2 = reinterpret_cast< char * >(buf2); 3587 3594 if (obj2) { 3588 3595 { … … 3660 3667 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Driver_CopyDataSource" "', argument " "3"" of type '" "char const *""'"); 3661 3668 } 3662 arg3 = buf3;3669 arg3 = reinterpret_cast< char * >(buf3); 3663 3670 if (obj3) { 3664 3671 { … … 3729 3736 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_Open" "', argument " "2"" of type '" "char const *""'"); 3730 3737 } 3731 arg2 = buf2;3738 arg2 = reinterpret_cast< char * >(buf2); 3732 3739 if (obj2) { 3733 3740 ecode3 = SWIG_AsVal_int(obj2, &val3); … … 3770 3777 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_DeleteDataSource" "', argument " "2"" of type '" "char const *""'"); 3771 3778 } 3772 arg2 = buf2;3779 arg2 = reinterpret_cast< char * >(buf2); 3773 3780 result = (int)OGRDriverShadow_DeleteDataSource(arg1,(char const *)arg2); 3774 3781 resultobj = SWIG_From_int(static_cast< int >(result)); … … 3804 3811 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_TestCapability" "', argument " "2"" of type '" "char const *""'"); 3805 3812 } 3806 arg2 = buf2;3813 arg2 = reinterpret_cast< char * >(buf2); 3807 3814 result = (bool)OGRDriverShadow_TestCapability(arg1,(char const *)arg2); 3808 3815 resultobj = SWIG_From_bool(static_cast< bool >(result)); … … 3830 3837 arg1 = reinterpret_cast< OGRDriverShadow * >(argp1); 3831 3838 result = (char *)OGRDriverShadow_GetName(arg1); 3832 resultobj = SWIG_FromCharPtr( result);3839 resultobj = SWIG_FromCharPtr((const char *)result); 3833 3840 return resultobj; 3834 3841 fail: … … 3859 3866 arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1); 3860 3867 result = (char *)OGRDataSourceShadow_name_get(arg1); 3861 resultobj = SWIG_FromCharPtr( result);3868 resultobj = SWIG_FromCharPtr((const char *)result); 3862 3869 return resultobj; 3863 3870 fail: … … 3991 3998 arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1); 3992 3999 result = (char *)OGRDataSourceShadow_GetName(arg1); 3993 resultobj = SWIG_FromCharPtr( result);4000 resultobj = SWIG_FromCharPtr((const char *)result); 3994 4001 return resultobj; 3995 4002 fail: … … 4081 4088 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DataSource_CreateLayer" "', argument " "2"" of type '" "char const *""'"); 4082 4089 } 4083 arg2 = buf2;4090 arg2 = reinterpret_cast< char * >(buf2); 4084 4091 if (obj2) { 4085 4092 res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 | 0 ); … … 4171 4178 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DataSource_CopyLayer" "', argument " "3"" of type '" "char const *""'"); 4172 4179 } 4173 arg3 = buf3;4180 arg3 = reinterpret_cast< char * >(buf3); 4174 4181 if (obj3) { 4175 4182 { … … 4269 4276 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DataSource_GetLayerByName" "', argument " "2"" of type '" "char const *""'"); 4270 4277 } 4271 arg2 = buf2;4278 arg2 = reinterpret_cast< char * >(buf2); 4272 4279 result = (OGRLayerShadow *)OGRDataSourceShadow_GetLayerByName(arg1,(char const *)arg2); 4273 4280 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | 0 ); … … 4303 4310 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DataSource_TestCapability" "', argument " "2"" of type '" "char const *""'"); 4304 4311 } 4305 arg2 = buf2;4312 arg2 = reinterpret_cast< char * >(buf2); 4306 4313 result = (bool)OGRDataSourceShadow_TestCapability(arg1,(char const *)arg2); 4307 4314 resultobj = SWIG_From_bool(static_cast< bool >(result)); … … 4349 4356 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DataSource_ExecuteSQL" "', argument " "2"" of type '" "char const *""'"); 4350 4357 } 4351 arg2 = buf2;4358 arg2 = reinterpret_cast< char * >(buf2); 4352 4359 if (obj2) { 4353 4360 res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_OGRGeometryShadow, 0 | 0 ); … … 4362 4369 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "DataSource_ExecuteSQL" "', argument " "4"" of type '" "char const *""'"); 4363 4370 } 4364 arg4 = buf4;4371 arg4 = reinterpret_cast< char * >(buf4); 4365 4372 } 4366 4373 result = (OGRLayerShadow *)OGRDataSourceShadow_ExecuteSQL(arg1,(char const *)arg2,arg3,(char const *)arg4); … … 4565 4572 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Layer_SetAttributeFilter" "', argument " "2"" of type '" "char *""'"); 4566 4573 } 4567 arg2 = buf2;4574 arg2 = reinterpret_cast< char * >(buf2); 4568 4575 result = (OGRErr)OGRLayerShadow_SetAttributeFilter(arg1,arg2); 4569 4576 { … … 4628 4635 arg1 = reinterpret_cast< OGRLayerShadow * >(argp1); 4629 4636 result = (char *)OGRLayerShadow_GetName(arg1); 4630 resultobj = SWIG_FromCharPtr( result);4637 resultobj = SWIG_FromCharPtr((const char *)result); 4631 4638 return resultobj; 4632 4639 fail: … … 5058 5065 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Layer_TestCapability" "', argument " "2"" of type '" "char const *""'"); 5059 5066 } 5060 arg2 = buf2;5067 arg2 = reinterpret_cast< char * >(buf2); 5061 5068 result = (bool)OGRLayerShadow_TestCapability(arg1,(char const *)arg2); 5062 5069 resultobj = SWIG_From_bool(static_cast< bool >(result)); … … 5609 5616 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetFieldDefnRef" "', argument " "2"" of type '" "char const *""'"); 5610 5617 } 5611 arg2 = buf2;5618 arg2 = reinterpret_cast< char * >(buf2); 5612 5619 result = (OGRFieldDefnShadow *)OGRFeatureShadow_GetFieldDefnRef__SWIG_1(arg1,(char const *)arg2); 5613 5620 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFieldDefnShadow, 0 | 0 ); … … 5660 5667 5661 5668 fail: 5662 SWIG_SetErrorMsg(PyExc_NotImplementedError," No matching function for overloaded 'Feature_GetFieldDefnRef'");5669 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Feature_GetFieldDefnRef'.\n Possible C/C++ prototypes are:\n GetFieldDefnRef(int)\n GetFieldDefnRef(char const *)\n"); 5663 5670 return NULL; 5664 5671 } … … 5689 5696 arg2 = static_cast< int >(val2); 5690 5697 result = (char *)OGRFeatureShadow_GetFieldAsString__SWIG_0(arg1,arg2); 5691 resultobj = SWIG_FromCharPtr( result);5698 resultobj = SWIG_FromCharPtr((const char *)result); 5692 5699 return resultobj; 5693 5700 fail: … … 5719 5726 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetFieldAsString" "', argument " "2"" of type '" "char const *""'"); 5720 5727 } 5721 arg2 = buf2;5728 arg2 = reinterpret_cast< char * >(buf2); 5722 5729 result = (char *)OGRFeatureShadow_GetFieldAsString__SWIG_1(arg1,(char const *)arg2); 5723 resultobj = SWIG_FromCharPtr( result);5730 resultobj = SWIG_FromCharPtr((const char *)result); 5724 5731 if (alloc2 == SWIG_NEWOBJ) delete[] buf2; 5725 5732 return resultobj; … … 5770 5777 5771 5778 fail: 5772 SWIG_SetErrorMsg(PyExc_NotImplementedError," No matching function for overloaded 'Feature_GetFieldAsString'");5779 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Feature_GetFieldAsString'.\n Possible C/C++ prototypes are:\n GetFieldAsString(int)\n GetFieldAsString(char const *)\n"); 5773 5780 return NULL; 5774 5781 } … … 5829 5836 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetFieldAsInteger" "', argument " "2"" of type '" "char const *""'"); 5830 5837 } 5831 arg2 = buf2;5838 arg2 = reinterpret_cast< char * >(buf2); 5832 5839 result = (int)OGRFeatureShadow_GetFieldAsInteger__SWIG_1(arg1,(char const *)arg2); 5833 5840 resultobj = SWIG_From_int(static_cast< int >(result)); … … 5880 5887 5881 5888 fail: 5882 SWIG_SetErrorMsg(PyExc_NotImplementedError," No matching function for overloaded 'Feature_GetFieldAsInteger'");5889 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Feature_GetFieldAsInteger'.\n Possible C/C++ prototypes are:\n GetFieldAsInteger(int)\n GetFieldAsInteger(char const *)\n"); 5883 5890 return NULL; 5884 5891 } … … 5939 5946 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetFieldAsDouble" "', argument " "2"" of type '" "char const *""'"); 5940 5947 } 5941 arg2 = buf2;5948 arg2 = reinterpret_cast< char * >(buf2); 5942 5949 result = (double)OGRFeatureShadow_GetFieldAsDouble__SWIG_1(arg1,(char const *)arg2); 5943 5950 resultobj = SWIG_From_double(static_cast< double >(result)); … … 5990 5997 5991 5998 fail: 5992 SWIG_SetErrorMsg(PyExc_NotImplementedError," No matching function for overloaded 'Feature_GetFieldAsDouble'");5999 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Feature_GetFieldAsDouble'.\n Possible C/C++ prototypes are:\n GetFieldAsDouble(int)\n GetFieldAsDouble(char const *)\n"); 5993 6000 return NULL; 5994 6001 } … … 6049 6056 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_IsFieldSet" "', argument " "2"" of type '" "char const *""'"); 6050 6057 } 6051 arg2 = buf2;6058 arg2 = reinterpret_cast< char * >(buf2); 6052 6059 result = (bool)OGRFeatureShadow_IsFieldSet__SWIG_1(arg1,(char const *)arg2); 6053 6060 resultobj = SWIG_From_bool(static_cast< bool >(result)); … … 6100 6107 6101 6108 fail: 6102 SWIG_SetErrorMsg(PyExc_NotImplementedError," No matching function for overloaded 'Feature_IsFieldSet'");6109 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Feature_IsFieldSet'.\n Possible C/C++ prototypes are:\n IsFieldSet(int)\n IsFieldSet(char const *)\n"); 6103 6110 return NULL; 6104 6111 } … … 6128 6135 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetFieldIndex" "', argument " "2"" of type '" "char const *""'"); 6129 6136 } 6130 arg2 = buf2;6137 arg2 = reinterpret_cast< char * >(buf2); 6131 6138 result = (int)OGRFeatureShadow_GetFieldIndex(arg1,(char const *)arg2); 6132 6139 resultobj = SWIG_From_int(static_cast< int >(result)); … … 6281 6288 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_UnsetField" "', argument " "2"" of type '" "char const *""'"); 6282 6289 } 6283 arg2 = buf2;6290 arg2 = reinterpret_cast< char * >(buf2); 6284 6291 OGRFeatureShadow_UnsetField__SWIG_1(arg1,(char const *)arg2); 6285 6292 resultobj = SWIG_Py_Void(); … … 6332 6339 6333 6340 fail: 6334 SWIG_SetErrorMsg(PyExc_NotImplementedError," No matching function for overloaded 'Feature_UnsetField'");6341 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Feature_UnsetField'.\n Possible C/C++ prototypes are:\n UnsetField(int)\n UnsetField(char const *)\n"); 6335 6342 return NULL; 6336 6343 } … … 6413 6420 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_SetField" "', argument " "2"" of type '" "char const *""'"); 6414 6421 } 6415 arg2 = buf2;6422 arg2 = reinterpret_cast< char * >(buf2); 6416 6423 { 6417 6424 /* %typemap(in) (tostring argin) */ … … 6494 6501 6495 6502 fail: 6496 SWIG_SetErrorMsg(PyExc_NotImplementedError," No matching function for overloaded 'Feature_SetField'");6503 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Feature_SetField'.\n Possible C/C++ prototypes are:\n SetField(int,char const *)\n SetField(char const *,char const *)\n"); 6497 6504 return NULL; 6498 6505 } … … 6575 6582 arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1); 6576 6583 result = (char *)OGRFeatureShadow_GetStyleString(arg1); 6577 resultobj = SWIG_FromCharPtr( result);6584 resultobj = SWIG_FromCharPtr((const char *)result); 6578 6585 return resultobj; 6579 6586 fail: … … 6604 6611 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_SetStyleString" "', argument " "2"" of type '" "char const *""'"); 6605 6612 } 6606 arg2 = buf2;6613 arg2 = reinterpret_cast< char * >(buf2); 6607 6614 OGRFeatureShadow_SetStyleString(arg1,(char const *)arg2); 6608 6615 resultobj = SWIG_Py_Void(); … … 6669 6676 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetFieldType" "', argument " "2"" of type '" "char const *""'"); 6670 6677 } 6671 arg2 = buf2;6678 arg2 = reinterpret_cast< char * >(buf2); 6672 6679 result = (OGRFieldType)OGRFeatureShadow_GetFieldType__SWIG_1(arg1,(char const *)arg2); 6673 6680 resultobj = SWIG_From_int(static_cast< int >(result)); … … 6720 6727 6721 6728 fail: 6722 SWIG_SetErrorMsg(PyExc_NotImplementedError," No matching function for overloaded 'Feature_GetFieldType'");6729 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Feature_GetFieldType'.\n Possible C/C++ prototypes are:\n GetFieldType(int)\n GetFieldType(char const *)\n"); 6723 6730 return NULL; 6724 6731 } … … 6772 6779 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_FeatureDefn" "', argument " "1"" of type '" "char const *""'"); 6773 6780 } 6774 arg1 = buf1;6781 arg1 = reinterpret_cast< char * >(buf1); 6775 6782 } 6776 6783 result = (OGRFeatureDefnShadow *)new_OGRFeatureDefnShadow((char const *)arg1); … … 6799 6806 arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1); 6800 6807 result = (char *)OGRFeatureDefnShadow_GetName(arg1); 6801 resultobj = SWIG_FromCharPtr( result);6808 resultobj = SWIG_FromCharPtr((const char *)result); 6802 6809 return resultobj; 6803 6810 fail: … … 6882 6889 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FeatureDefn_GetFieldIndex" "', argument " "2"" of type '" "char const *""'"); 6883 6890 } 6884 arg2 = buf2;6891 arg2 = reinterpret_cast< char * >(buf2); 6885 6892 result = (int)OGRFeatureDefnShadow_GetFieldIndex(arg1,(char const *)arg2); 6886 6893 resultobj = SWIG_From_int(static_cast< int >(result)); … … 7048 7055 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_FieldDefn" "', argument " "1"" of type '" "char const *""'"); 7049 7056 } 7050 arg1 = buf1;7057 arg1 = reinterpret_cast< char * >(buf1); 7051 7058 } 7052 7059 if (obj1) { … … 7082 7089 arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1); 7083 7090 result = (char *)OGRFieldDefnShadow_GetName(arg1); 7084 resultobj = SWIG_FromCharPtr( result);7091 resultobj = SWIG_FromCharPtr((const char *)result); 7085 7092 return resultobj; 7086 7093 fail: … … 7104 7111 arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1); 7105 7112 result = (char *)OGRFieldDefnShadow_GetNameRef(arg1); 7106 resultobj = SWIG_FromCharPtr( result);7113 resultobj = SWIG_FromCharPtr((const char *)result); 7107 7114 return resultobj; 7108 7115 fail: … … 7133 7140 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FieldDefn_SetName" "', argument " "2"" of type '" "char const *""'"); 7134 7141 } 7135 arg2 = buf2;7142 arg2 = reinterpret_cast< char * >(buf2); 7136 7143 OGRFieldDefnShadow_SetName(arg1,(char const *)arg2); 7137 7144 resultobj = SWIG_Py_Void(); … … 7376 7383 arg2 = static_cast< OGRFieldType >(val2); 7377 7384 result = (char *)OGRFieldDefnShadow_GetFieldTypeName(arg1,arg2); 7378 resultobj = SWIG_FromCharPtr( result);7385 resultobj = SWIG_FromCharPtr((const char *)result); 7379 7386 return resultobj; 7380 7387 fail: … … 7407 7414 { 7408 7415 /* %typemap(in,numinputs=1) (int nLen, char *pBuf ) */ 7409 PyString_AsStringAndSize(obj0, &arg2, &arg1 ); 7416 7417 7418 7419 7420 7421 7422 7423 7424 7410 7425 } 7411 7426 if (obj1) { … … 7473 7488 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CreateGeometryFromGML" "', argument " "1"" of type '" "char const *""'"); 7474 7489 } 7475 arg1 = buf1;7490 arg1 = reinterpret_cast< char * >(buf1); 7476 7491 result = (OGRGeometryShadow *)CreateGeometryFromGML((char const *)arg1); 7477 7492 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN | 0 ); … … 7549 7564 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Geometry" "', argument " "2"" of type '" "char *""'"); 7550 7565 } 7551 arg2 = buf2;7566 arg2 = reinterpret_cast< char * >(buf2); 7552 7567 } 7553 7568 if (obj2) { … … 7563 7578 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_Geometry" "', argument " "4"" of type '" "char *""'"); 7564 7579 } 7565 arg4 = buf4;7580 arg4 = reinterpret_cast< char * >(buf4); 7566 7581 } 7567 7582 if (obj4) { … … 7570 7585 SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_Geometry" "', argument " "5"" of type '" "char *""'"); 7571 7586 } 7572 arg5 = buf5;7587 arg5 = reinterpret_cast< char * >(buf5); 7573 7588 } 7574 7589 result = (OGRGeometryShadow *)new_OGRGeometryShadow(arg1,arg2,arg3,arg4,arg5); … … 7745 7760 arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1); 7746 7761 result = (char *)OGRGeometryShadow_ExportToGML(arg1); 7747 resultobj = SWIG_FromCharPtr( result);7762 resultobj = SWIG_FromCharPtr((const char *)result); 7748 7763 return resultobj; 7749 7764 fail: … … 7956 7971 arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1); 7957 7972 result = (char *)OGRGeometryShadow_GetGeometryName(arg1); 7958 resultobj = SWIG_FromCharPtr( result);7973 resultobj = SWIG_FromCharPtr((const char *)result); 7959 7974 return resultobj; 7960 7975 fail: … … 9207 9222 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Open" "', argument " "1"" of type '" "char const *""'"); 9208 9223 } 9209 arg1 = buf1;9224 arg1 = reinterpret_cast< char * >(buf1); 9210 9225 if (obj1) { 9211 9226 ecode2 = SWIG_AsVal_int(obj1, &val2); … … 9246 9261 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OpenShared" "', argument " "1"" of type '" "char const *""'"); 9247 9262 } 9248 arg1 = buf1;9263 arg1 = reinterpret_cast< char * >(buf1); 9249 9264 if (obj1) { 9250 9265 ecode2 = SWIG_AsVal_int(obj1, &val2); … … 9278 9293 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetDriverByName" "', argument " "1"" of type '" "char const *""'"); 9279 9294 } 9280 arg1 = buf1;9295 arg1 = reinterpret_cast< char * >(buf1); 9281 9296 result = (OGRDriverShadow *)GetDriverByName((char const *)arg1); 9282 9297 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDriverShadow, 0 | 0 ); … … 9566 9581 * 9567 9582 * The generated swig_type_info structures are assigned staticly to an initial 9568 * array. We just loop th ough that array, and handle each type individually.9583 * array. We just loop through that array, and handle each type individually. 9569 9584 * First we lookup if this type has been already loaded, and if so, use the 9570 9585 * loaded structure instead of the generated one. Then we have to fill in the … … 9604 9619 #endif 9605 9620 9621 9606 9622 SWIGRUNTIME void 9607 9623 SWIG_InitializeModule(void *clientdata) { 9608 9624 size_t i; 9609 swig_module_info *module_head ;9610 static int init_run = 0;9625 swig_module_info *module_head, *iter; 9626 int found; 9611 9627 9612 9628 clientdata = clientdata; 9613 9629 9614 if (init_run) return; 9615 init_run = 1; 9616 9617 /* Initialize the swig_module */ 9618 swig_module.type_initial = swig_type_initial; 9619 swig_module.cast_initial = swig_cast_initial; 9630 /* check to see if the circular list has been setup, if not, set it up */ 9631 if (swig_module.next==0) { 9632 /* Initialize the swig_module */ 9633 swig_module.type_initial = swig_type_initial; 9634 swig_module.cast_initial = swig_cast_initial; 9635 swig_module.next = &swig_module; 9636 } 9620 9637 9621 9638 /* Try and load any already created modules */ 9622 9639 module_head = SWIG_GetModule(clientdata); 9623 if (module_head) { 9640 if (!module_head) { 9641 /* This is the first module loaded for this interpreter */ 9642 /* so set the swig module into the interpreter */ 9643 SWIG_SetModule(clientdata, &swig_module); 9644 module_head = &swig_module; 9645 } else { 9646 /* the interpreter has loaded a SWIG module, but has it loaded this one? */ 9647 found=0; 9648 iter=module_head; 9649 do { 9650 if (iter==&swig_module) { 9651 found=1; 9652 break; 9653 } 9654 iter=iter->next; 9655 } while (iter!= module_head); 9656 9657 /* if the is found in the list, then all is done and we may leave */ 9658 if (found) return; 9659 /* otherwise we must add out module into the list */ 9624 9660 swig_module.next = module_head->next; 9625 9661 module_head->next = &swig_module; 9626 } else {9627 /* This is the first module loaded */9628 swig_module.next = &swig_module;9629 SWIG_SetModule(clientdata, &swig_module);9630 9662 } 9631 9663 … … 9940 9972 9941 9973 SWIGINTERN PyObject * 9942 SWIG_globals( ) {9974 SWIG_globals(void) { 9943 9975 static PyObject *_SWIG_globals = 0; 9944 9976 if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); … … 9985 10017 size_t i; 9986 10018 for (i = 0; methods[i].ml_name; ++i) { 9987 c har *c = methods[i].ml_doc;10019 const char *c = methods[i].ml_doc; 9988 10020 if (c && (c = strstr(c, "swig_ptr: "))) { 9989 10021 int j; 9990 10022 swig_const_info *ci = 0; 9991 c har *name = c + 10;10023 const char *name = c + 10; 9992 10024 for (j = 0; const_table[j].type; ++j) { 9993 10025 if (strncmp(const_table[j].name, name, branches/1.4/gdal/swig/python/osr.py
r10420 r11385 1 # This file was created automatically by SWIG 1.3.29. 1 # This file was automatically generated by SWIG (http://www.swig.org). 2 # Version 1.3.31 3 # 2 4 # Don't modify this file, modify the SWIG interface instead. 3 5 # This file is compatible with both classic and new-style classes. … … 6 8 import new 7 9 new_instancemethod = new.instancemethod 10 try: 11 _swig_property = property 12 except NameError: 13 pass # Python < 2.2 doesn't have 'property'. 8 14 def _swig_setattr_nondynamic(self,class_type,name,value,static=1): 9 15 if (name == "thisown"): return self.this.own(value) branches/1.4/gdal/swig/python/osr_wrap.cpp
r10420 r11385 1 1 /* ---------------------------------------------------------------------------- 2 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 1.3. 293 * Version 1.3.31 4 4 * 5 5 * This file is not intended to be easily readable and contains a number of … … 121 121 122 122 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ 123 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) 123 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) 124 124 # define _CRT_SECURE_NO_DEPRECATE 125 125 #endif … … 138 138 /* This should only be incremented when either the layout of swig_type_info changes, 139 139 or for whatever reason, the runtime changes incompatibly */ 140 #define SWIG_RUNTIME_VERSION " 2"140 #define SWIG_RUNTIME_VERSION "3" 141 141 142 142 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ … … 715 715 716 716 717 /* Python.h has to appear first */718 #include <Python.h>719 717 720 718 /* Add PyOS_snprintf for old Pythons */ … … 797 795 #endif 798 796 797 /* Py_ssize_t for old Pythons */ 798 /* This code is as recommended by: */ 799 /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ 800 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) 801 typedef int Py_ssize_t; 802 # define PY_SSIZE_T_MAX INT_MAX 803 # define PY_SSIZE_T_MIN INT_MIN 804 #endif 799 805 800 806 /* ----------------------------------------------------------------------------- … … 1190 1196 _SWIG_Py_None(void) 1191 1197 { 1192 PyObject *none = Py_BuildValue( "");1198 PyObject *none = Py_BuildValue((char*)""); 1193 1199 Py_DECREF(none); 1194 1200 return none; … … 2049 2055 2050 2056 /* here we get the method pointer for callbacks */ 2051 c har *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);2057 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); 2052 2058 const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; 2053 2059 if (desc) { … … 2170 2176 } 2171 2177 #endif 2172 dict = PyObject_GetAttrString(inst, "__dict__");2178 dict = PyObject_GetAttrString(inst, (char*)"__dict__"); 2173 2179 PyDict_SetItem(dict, SWIG_This(), swig_this); 2174 2180 Py_DECREF(dict); … … 2311 2317 /* The python cached type query */ 2312 2318 SWIGRUNTIME PyObject * 2313 SWIG_Python_TypeCache( ) {2319 SWIG_Python_TypeCache(void) { 2314 2320 static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); 2315 2321 return cache; … … 2477 2483 #if (PY_VERSION_HEX <= 0x02000000) 2478 2484 # if !defined(SWIG_PYTHON_CLASSIC) 2479 # error "This python version requires to use swigwith the '-classic' option"2485 # error "This python version requires swig to be run with the '-classic' option" 2480 2486 # endif 2481 2487 #endif … … 2488 2494 #define SWIG_name "_osr" 2489 2495 2490 #define SWIGVERSION 0x010329 2496 #define SWIGVERSION 0x010331 2497 #define SWIG_VERSION SWIGVERSION 2491 2498 2492 2499 … … 2559 2566 2560 2567 SWIGINTERN swig_type_info* 2561 SWIG_pchar_descriptor( )2568 SWIG_pchar_descriptor(void) 2562 2569 { 2563 2570 static int init = 0; … … 2683 2690 { 2684 2691 if (PyString_Check(obj)) { 2685 char *cstr; int len;2692 char *cstr; Py_ssize_t len; 2686 2693 PyString_AsStringAndSize(obj, &cstr, &len); 2687 2694 if (cptr) { … … 3192 3199 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetWellKnownGeogCSAsWKT" "', argument " "1"" of type '" "char const *""'"); 3193 3200 } 3194 arg1 = buf1;3201 arg1 = reinterpret_cast< char * >(buf1); 3195 3202 result = (OGRErr)GetWellKnownGeogCSAsWKT((char const *)arg1,arg2); 3196 3203 { … … 3261 3268 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetUserInputAsWKT" "', argument " "1"" of type '" "char const *""'"); 3262 3269 } 3263 arg1 = buf1;3270 arg1 = reinterpret_cast< char * >(buf1); 3264 3271 result = (OGRErr)GetUserInputAsWKT((char const *)arg1,arg2); 3265 3272 { … … 3328 3335 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_SpatialReference" "', argument " "1"" of type '" "char const *""'"); 3329 3336 } 3330 arg1 = buf1;3337 arg1 = reinterpret_cast< char * >(buf1); 3331 3338 } 3332 3339 result = (OSRSpatialReferenceShadow *)new_OSRSpatialReferenceShadow((char const *)arg1); … … 3377 3384 arg1 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp1); 3378 3385 result = (char *)OSRSpatialReferenceShadow___str__(arg1); 3379 resultobj = SWIG_FromCharPtr( result);3386 resultobj = SWIG_FromCharPtr((const char *)result); 3380 3387 delete[] result; 3381 3388 return resultobj; … … 3540 3547 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SpatialReference_GetAttrValue" "', argument " "2"" of type '" "char const *""'"); 3541 3548 } 3542 arg2 = buf2;3549 arg2 = reinterpret_cast< char * >(buf2); 3543 3550 if (obj2) { 3544 3551 ecode3 = SWIG_AsVal_int(obj2, &val3);
