/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.36
 *
 * 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 gdal {
  public static void UseExceptions() {
    gdalPINVOKE.UseExceptions();
  }

  public static void DontUseExceptions() {
    gdalPINVOKE.DontUseExceptions();
  }

  public static void Debug(string msg_class, string message) {
    gdalPINVOKE.Debug(msg_class, message);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static void Error(int msg_class, int err_code, string msg) {
    gdalPINVOKE.Error(msg_class, err_code, msg);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static int PushErrorHandler(string pszCallbackName) {
    int ret = gdalPINVOKE.PushErrorHandler__SWIG_0(pszCallbackName);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void PushErrorHandler(SWIGTYPE_p_CPLErrorHandler arg0) {
    gdalPINVOKE.PushErrorHandler__SWIG_1(SWIGTYPE_p_CPLErrorHandler.getCPtr(arg0));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static void PopErrorHandler() {
    gdalPINVOKE.PopErrorHandler();
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static void ErrorReset() {
    gdalPINVOKE.ErrorReset();
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static int GetLastErrorNo() {
    int ret = gdalPINVOKE.GetLastErrorNo();
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static int GetLastErrorType() {
    int ret = gdalPINVOKE.GetLastErrorType();
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static string GetLastErrorMsg() {
    string ret = gdalPINVOKE.GetLastErrorMsg();
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void PushFinderLocation(string arg0) {
    gdalPINVOKE.PushFinderLocation(arg0);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static void PopFinderLocation() {
    gdalPINVOKE.PopFinderLocation();
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static void FinderClean() {
    gdalPINVOKE.FinderClean();
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static string FindFile(string arg0, string arg1) {
    string ret = gdalPINVOKE.FindFile(arg0, arg1);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void SetConfigOption(string arg0, string arg1) {
    gdalPINVOKE.SetConfigOption(arg0, arg1);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static string GetConfigOption(string arg0, string arg1) {
    string ret = gdalPINVOKE.GetConfigOption(arg0, arg1);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static string CPLBinaryToHex(int nBytes, SWIGTYPE_p_GByte pabyData) {
    string ret = gdalPINVOKE.CPLBinaryToHex(nBytes, SWIGTYPE_p_GByte.getCPtr(pabyData));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static SWIGTYPE_p_GByte CPLHexToBinary(string pszHex, SWIGTYPE_p_int pnBytes) {
    IntPtr cPtr = gdalPINVOKE.CPLHexToBinary(pszHex, SWIGTYPE_p_int.getCPtr(pnBytes));
    SWIGTYPE_p_GByte ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_GByte(cPtr, false? null : new object());
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double GDAL_GCP_GCPX_get(GCP h) {
    double ret = gdalPINVOKE.GDAL_GCP_GCPX_get(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_GCPX_set(GCP h, double val) {
    gdalPINVOKE.GDAL_GCP_GCPX_set(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static double GDAL_GCP_GCPY_get(GCP h) {
    double ret = gdalPINVOKE.GDAL_GCP_GCPY_get(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_GCPY_set(GCP h, double val) {
    gdalPINVOKE.GDAL_GCP_GCPY_set(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static double GDAL_GCP_GCPZ_get(GCP h) {
    double ret = gdalPINVOKE.GDAL_GCP_GCPZ_get(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_GCPZ_set(GCP h, double val) {
    gdalPINVOKE.GDAL_GCP_GCPZ_set(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static double GDAL_GCP_GCPPixel_get(GCP h) {
    double ret = gdalPINVOKE.GDAL_GCP_GCPPixel_get(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_GCPPixel_set(GCP h, double val) {
    gdalPINVOKE.GDAL_GCP_GCPPixel_set(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static double GDAL_GCP_GCPLine_get(GCP h) {
    double ret = gdalPINVOKE.GDAL_GCP_GCPLine_get(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_GCPLine_set(GCP h, double val) {
    gdalPINVOKE.GDAL_GCP_GCPLine_set(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static string GDAL_GCP_Info_get(GCP h) {
    string ret = gdalPINVOKE.GDAL_GCP_Info_get(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_Info_set(GCP h, string val) {
    gdalPINVOKE.GDAL_GCP_Info_set(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static string GDAL_GCP_Id_get(GCP h) {
    string ret = gdalPINVOKE.GDAL_GCP_Id_get(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_Id_set(GCP h, string val) {
    gdalPINVOKE.GDAL_GCP_Id_set(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static double GDAL_GCP_get_GCPX(GCP h) {
    double ret = gdalPINVOKE.GDAL_GCP_get_GCPX(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_set_GCPX(GCP h, double val) {
    gdalPINVOKE.GDAL_GCP_set_GCPX(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static double GDAL_GCP_get_GCPY(GCP h) {
    double ret = gdalPINVOKE.GDAL_GCP_get_GCPY(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_set_GCPY(GCP h, double val) {
    gdalPINVOKE.GDAL_GCP_set_GCPY(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static double GDAL_GCP_get_GCPZ(GCP h) {
    double ret = gdalPINVOKE.GDAL_GCP_get_GCPZ(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_set_GCPZ(GCP h, double val) {
    gdalPINVOKE.GDAL_GCP_set_GCPZ(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static double GDAL_GCP_get_GCPPixel(GCP h) {
    double ret = gdalPINVOKE.GDAL_GCP_get_GCPPixel(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_set_GCPPixel(GCP h, double val) {
    gdalPINVOKE.GDAL_GCP_set_GCPPixel(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static double GDAL_GCP_get_GCPLine(GCP h) {
    double ret = gdalPINVOKE.GDAL_GCP_get_GCPLine(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_set_GCPLine(GCP h, double val) {
    gdalPINVOKE.GDAL_GCP_set_GCPLine(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static string GDAL_GCP_get_Info(GCP h) {
    string ret = gdalPINVOKE.GDAL_GCP_get_Info(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_set_Info(GCP h, string val) {
    gdalPINVOKE.GDAL_GCP_set_Info(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static string GDAL_GCP_get_Id(GCP h) {
    string ret = gdalPINVOKE.GDAL_GCP_get_Id(GCP.getCPtr(h));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void GDAL_GCP_set_Id(GCP h, string val) {
    gdalPINVOKE.GDAL_GCP_set_Id(GCP.getCPtr(h), val);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static SWIGTYPE_p_FALSE_IS_ERR GCPsToGeoTransform(int nGCPs, GCP pGCPs, double[] argout, int bApproxOK) {
    SWIGTYPE_p_FALSE_IS_ERR ret = new SWIGTYPE_p_FALSE_IS_ERR(gdalPINVOKE.GCPsToGeoTransform(nGCPs, GCP.getCPtr(pGCPs), argout, bApproxOK), null);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void AllRegister() {
    gdalPINVOKE.AllRegister();
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static int GetCacheMax() {
    int ret = gdalPINVOKE.GetCacheMax();
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void SetCacheMax(int nBytes) {
    gdalPINVOKE.SetCacheMax(nBytes);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
  }

  public static int GetCacheUsed() {
    int ret = gdalPINVOKE.GetCacheUsed();
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static int GetDataTypeSize(int arg0) {
    int ret = gdalPINVOKE.GetDataTypeSize(arg0);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static int DataTypeIsComplex(int arg0) {
    int ret = gdalPINVOKE.DataTypeIsComplex(arg0);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static string GetDataTypeName(int arg0) {
    string ret = gdalPINVOKE.GetDataTypeName(arg0);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static int GetDataTypeByName(string arg0) {
    int ret = gdalPINVOKE.GetDataTypeByName(arg0);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static string GetColorInterpretationName(int arg0) {
    string ret = gdalPINVOKE.GetColorInterpretationName(arg0);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static string GetPaletteInterpretationName(int arg0) {
    string ret = gdalPINVOKE.GetPaletteInterpretationName(arg0);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static string DecToDMS(double arg0, string arg1, int arg2) {
    string ret = gdalPINVOKE.DecToDMS(arg0, arg1, arg2);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double PackedDMSToDec(double arg0) {
    double ret = gdalPINVOKE.PackedDMSToDec(arg0);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double DecToPackedDMS(double arg0) {
    double ret = gdalPINVOKE.DecToPackedDMS(arg0);
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static XMLNode ParseXMLString(string arg0) {
    IntPtr cPtr = gdalPINVOKE.ParseXMLString(arg0);
    XMLNode ret = (cPtr == IntPtr.Zero) ? null : new XMLNode(cPtr, true? null : new object());
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static string SerializeXMLTree(XMLNode xmlnode) {
    string ret = gdalPINVOKE.SerializeXMLTree(XMLNode.getCPtr(xmlnode));
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static int GetDriverCount() {
    int ret = gdalPINVOKE.GetDriverCount();
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Driver GetDriverByName(string name) {
    IntPtr cPtr = gdalPINVOKE.GetDriverByName(name);
    Driver ret = (cPtr == IntPtr.Zero) ? null : new Driver(cPtr, false? null : new object());
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Driver GetDriver(int i) {
    IntPtr cPtr = gdalPINVOKE.GetDriver(i);
    Driver ret = (cPtr == IntPtr.Zero) ? null : new Driver(cPtr, false? null : new object());
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Dataset Open(string name, int eAccess) {
    IntPtr cPtr = gdalPINVOKE.Open(name, eAccess);
    Dataset ret = (cPtr == IntPtr.Zero) ? null : new Dataset(cPtr, true? null : new object());
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Dataset OpenShared(string name, int eAccess) {
    IntPtr cPtr = gdalPINVOKE.OpenShared(name, eAccess);
    Dataset ret = (cPtr == IntPtr.Zero) ? null : new Dataset(cPtr, true? null : new object());
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Dataset AutoCreateWarpedVRT(Dataset src_ds, string src_wkt, string dst_wkt, int eResampleAlg, double maxerror) {
    IntPtr cPtr = gdalPINVOKE.AutoCreateWarpedVRT(Dataset.getCPtr(src_ds), src_wkt, dst_wkt, eResampleAlg, maxerror);
    Dataset ret = (cPtr == IntPtr.Zero) ? null : new Dataset(cPtr, true? null : new object());
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static string[] GeneralCmdLineProcessor(string[] papszArgv, int nOptions) {
    
    if (gdalPINVOKE.SWIGPendingException.Pending) throw gdalPINVOKE.SWIGPendingException.Retrieve();
    throw new System.NotSupportedException("Returning string arrays is not implemented yet.");
}

}

}
