/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.31
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace OSGeo.GDAL {

using System;
using System.Runtime.InteropServices;

public class Driver : MajorObject {
  private HandleRef swigCPtr;

  internal Driver(IntPtr cPtr, object cMemoryOwner) : base(gdalPINVOKE.DriverUpcast(cPtr), cMemoryOwner) {
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(Driver obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }
  internal static HandleRef getCPtrAndDisown(Driver obj, object cMemoryOwner) {
    obj.swigCMemOwner = cMemoryOwner;
    return getCPtr(obj);
  }

  public override void Dispose() {
  lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwner == null) {
        swigCMemOwner = new object();
        throw new MethodAccessException("C++ destructor does not have public access");
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

  public string ShortName {
    get {
      string ret = gdalPINVOKE.Driver_ShortName_get(swigCPtr);
      if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
      return ret;
    } 
  }

  public string LongName {
    get {
      string ret = gdalPINVOKE.Driver_LongName_get(swigCPtr);
      if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
      return ret;
    } 
  }

  public string HelpTopic {
    get {
      string ret = gdalPINVOKE.Driver_HelpTopic_get(swigCPtr);
      if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
      return ret;
    } 
  }

  public Dataset Create(string name, int xsize, int ysize, int bands, int eType, string[] options) {
    IntPtr cPtr = gdalPINVOKE.Driver_Create(swigCPtr, name, xsize, ysize, bands, eType, new gdalPINVOKE.StringListMarshal(options)._ar);
    Dataset ret = (cPtr == IntPtr.Zero) ? null : new Dataset(cPtr, true? null : this);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Dataset CreateCopy(string name, Dataset src, int strict, string[] options) {
    IntPtr cPtr = gdalPINVOKE.Driver_CreateCopy(swigCPtr, name, Dataset.getCPtr(src), strict, new gdalPINVOKE.StringListMarshal(options)._ar);
    Dataset ret = (cPtr == IntPtr.Zero) ? null : new Dataset(cPtr, true? null : this);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public int Delete(string name) {
    int ret = gdalPINVOKE.Driver_Delete(swigCPtr, name);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public int Register() {
    int ret = gdalPINVOKE.Driver_Register(swigCPtr);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public void Deregister() {
    gdalPINVOKE.Driver_Deregister(swigCPtr);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

}

}
