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

namespace libsbml {

using System;
using System.Runtime.InteropServices;

public class XMLParser : IDisposable {
	private HandleRef swigCPtr;
	protected bool swigCMemOwn;
	
	internal XMLParser(IntPtr cPtr, bool cMemoryOwn)
	{
		swigCMemOwn = cMemoryOwn;
		swigCPtr    = new HandleRef(this, cPtr);
	}
	
	internal static HandleRef getCPtr(XMLParser obj)
	{
		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
	}
	
	internal static HandleRef getCPtrAndDisown (XMLParser obj)
	{
		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
		
		if (obj != null)
		{
			ptr             = obj.swigCPtr;
			obj.swigCMemOwn = false;
		}
		
		return ptr;
	}

  ~XMLParser() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
        swigCMemOwn = false;
        libsbmlPINVOKE.delete_XMLParser(swigCPtr);
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
    }
  }

  public static XMLParser create(XMLHandler handler, string library) {
    IntPtr cPtr = libsbmlPINVOKE.XMLParser_create__SWIG_0(XMLHandler.getCPtr(handler), library);
    XMLParser ret = (cPtr == IntPtr.Zero) ? null : new XMLParser(cPtr, false);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static XMLParser create(XMLHandler handler) {
    IntPtr cPtr = libsbmlPINVOKE.XMLParser_create__SWIG_1(XMLHandler.getCPtr(handler));
    XMLParser ret = (cPtr == IntPtr.Zero) ? null : new XMLParser(cPtr, false);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual bool parse(string content, bool isFile) {
    bool ret = libsbmlPINVOKE.XMLParser_parse__SWIG_0(swigCPtr, content, isFile);
    return ret;
  }

  public virtual bool parse(string content) {
    bool ret = libsbmlPINVOKE.XMLParser_parse__SWIG_1(swigCPtr, content);
    return ret;
  }

  public virtual bool parseFirst(string content, bool isFile) {
    bool ret = libsbmlPINVOKE.XMLParser_parseFirst__SWIG_0(swigCPtr, content, isFile);
    return ret;
  }

  public virtual bool parseFirst(string content) {
    bool ret = libsbmlPINVOKE.XMLParser_parseFirst__SWIG_1(swigCPtr, content);
    return ret;
  }

  public virtual bool parseNext() {
    bool ret = libsbmlPINVOKE.XMLParser_parseNext(swigCPtr);
    return ret;
  }

  public virtual void parseReset() {
    libsbmlPINVOKE.XMLParser_parseReset(swigCPtr);
  }

  public virtual long getColumn() { return (long)libsbmlPINVOKE.XMLParser_getColumn(swigCPtr); }

  public virtual long getLine() { return (long)libsbmlPINVOKE.XMLParser_getLine(swigCPtr); }

  public XMLErrorLog getErrorLog() {
    IntPtr cPtr = libsbmlPINVOKE.XMLParser_getErrorLog(swigCPtr);
    XMLErrorLog ret = (cPtr == IntPtr.Zero) ? null : new XMLErrorLog(cPtr, false);
    return ret;
  }

  public void setErrorLog(XMLErrorLog log) {
    libsbmlPINVOKE.XMLParser_setErrorLog(swigCPtr, XMLErrorLog.getCPtr(log));
  }

}

}
