Changeset 19577


Ignore:
Timestamp:
Apr 29, 2010 12:33:32 PM (6 years ago)
Author:
rouault
Message:

SWIG bindings : map OGRRegisterDriver() and OGRDeregisterDriver(); refresh python bindings

Location:
trunk/gdal/swig
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gdal/swig/include/ogr.i

    r19391 r19577  
    363363  }
    364364
     365  /* Added in GDAL 1.8.0 */
     366  void Register() {
     367    OGRRegisterDriver( self );
     368  }
     369
     370  /* Added in GDAL 1.8.0 */
     371  void Deregister() {
     372    OGRDeregisterDriver( self );
     373  }
    365374
    366375} /* %extend */
  • trunk/gdal/swig/python/extensions/ogr_wrap.cpp

    r19412 r19577  
    32323232    return OGR_Dr_GetName( self );
    32333233  }
     3234SWIGINTERN void OGRDriverShadow_Register(OGRDriverShadow *self){
     3235    OGRRegisterDriver( self );
     3236  }
     3237SWIGINTERN void OGRDriverShadow_Deregister(OGRDriverShadow *self){
     3238    OGRDeregisterDriver( self );
     3239  }
    32343240SWIGINTERN void delete_OGRDataSourceShadow(OGRDataSourceShadow *self){
    32353241    OGRReleaseDataSource(self);
     
    45394545  }
    45404546  resultobj = SWIG_FromCharPtr((const char *)result);
     4547  return resultobj;
     4548fail:
     4549  return NULL;
     4550}
     4551
     4552
     4553SWIGINTERN PyObject *_wrap_Driver_Register(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
     4554  PyObject *resultobj = 0;
     4555  OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
     4556  void *argp1 = 0 ;
     4557  int res1 = 0 ;
     4558  PyObject * obj0 = 0 ;
     4559 
     4560  if (!PyArg_ParseTuple(args,(char *)"O:Driver_Register",&obj0)) SWIG_fail;
     4561  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
     4562  if (!SWIG_IsOK(res1)) {
     4563    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_Register" "', argument " "1"" of type '" "OGRDriverShadow *""'");
     4564  }
     4565  arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
     4566  {
     4567    OGRDriverShadow_Register(arg1);
     4568    if ( bUseExceptions ) {
     4569      CPLErr eclass = CPLGetLastErrorType();
     4570      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
     4571        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
     4572      }
     4573    }
     4574  }
     4575  resultobj = SWIG_Py_Void();
     4576  return resultobj;
     4577fail:
     4578  return NULL;
     4579}
     4580
     4581
     4582SWIGINTERN PyObject *_wrap_Driver_Deregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
     4583  PyObject *resultobj = 0;
     4584  OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
     4585  void *argp1 = 0 ;
     4586  int res1 = 0 ;
     4587  PyObject * obj0 = 0 ;
     4588 
     4589  if (!PyArg_ParseTuple(args,(char *)"O:Driver_Deregister",&obj0)) SWIG_fail;
     4590  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
     4591  if (!SWIG_IsOK(res1)) {
     4592    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_Deregister" "', argument " "1"" of type '" "OGRDriverShadow *""'");
     4593  }
     4594  arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
     4595  {
     4596    OGRDriverShadow_Deregister(arg1);
     4597    if ( bUseExceptions ) {
     4598      CPLErr eclass = CPLGetLastErrorType();
     4599      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
     4600        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
     4601      }
     4602    }
     4603  }
     4604  resultobj = SWIG_Py_Void();
    45414605  return resultobj;
    45424606fail:
     
    1383613900                "freed. \n"
    1383713901                ""},
     13902         { (char *)"Driver_Register", _wrap_Driver_Register, METH_VARARGS, (char *)"Driver_Register(Driver self)"},
     13903         { (char *)"Driver_Deregister", _wrap_Driver_Deregister, METH_VARARGS, (char *)"Driver_Deregister(Driver self)"},
    1383813904         { (char *)"Driver_swigregister", Driver_swigregister, METH_VARARGS, NULL},
    1383913905         { (char *)"DataSource_name_get", _wrap_DataSource_name_get, METH_VARARGS, (char *)"DataSource_name_get(DataSource self) -> char"},
  • trunk/gdal/swig/python/osgeo/ogr.py

    r19412 r19577  
    328328        return _ogr.Driver_GetName(self, *args)
    329329
     330    def Register(self, *args):
     331        """Register(self)"""
     332        return _ogr.Driver_Register(self, *args)
     333
     334    def Deregister(self, *args):
     335        """Deregister(self)"""
     336        return _ogr.Driver_Deregister(self, *args)
     337
    330338Driver_swigregister = _ogr.Driver_swigregister
    331339Driver_swigregister(Driver)
Note: See TracChangeset for help on using the changeset viewer.