/* ----------------------------------------------------------------------------
 * 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 XMLTokenizer : XMLHandler {
	private HandleRef swigCPtr;
	
	internal XMLTokenizer(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.XMLTokenizerUpcast(cPtr), cMemoryOwn)
	{
		//super(libsbmlPINVOKE.XMLTokenizerUpcast(cPtr), cMemoryOwn);
		swigCPtr = new HandleRef(this, cPtr);
	}
	
	internal static HandleRef getCPtr(XMLTokenizer obj)
	{
		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
	}
	
	internal static HandleRef getCPtrAndDisown (XMLTokenizer obj)
	{
		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
		
		if (obj != null)
		{
			ptr             = obj.swigCPtr;
			obj.swigCMemOwn = false;
		}
		
		return ptr;
	}

  ~XMLTokenizer() {
    Dispose();
  }

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

  public XMLTokenizer() : this(libsbmlPINVOKE.new_XMLTokenizer(), true) {
  }

  public string getEncoding() {
    string ret = libsbmlPINVOKE.XMLTokenizer_getEncoding(swigCPtr);
    return ret;
  }

  public string getVersion() {
    string ret = libsbmlPINVOKE.XMLTokenizer_getVersion(swigCPtr);
    return ret;
  }

  public bool hasNext() {
    bool ret = libsbmlPINVOKE.XMLTokenizer_hasNext(swigCPtr);
    return ret;
  }

  public bool isEOF() {
    bool ret = libsbmlPINVOKE.XMLTokenizer_isEOF(swigCPtr);
    return ret;
  }

  public XMLToken next() {
    XMLToken ret = new XMLToken(libsbmlPINVOKE.XMLTokenizer_next(swigCPtr), true);
    return ret;
  }

  public XMLToken peek() {
    XMLToken ret = new XMLToken(libsbmlPINVOKE.XMLTokenizer_peek(swigCPtr), false);
    return ret;
  }

  public string toString() {
    string ret = libsbmlPINVOKE.XMLTokenizer_toString(swigCPtr);
    return ret;
  }

  public override void XML(string version, string encoding) {
    libsbmlPINVOKE.XMLTokenizer_XML(swigCPtr, version, encoding);
  }

  public override void startElement(XMLToken element) {
    libsbmlPINVOKE.XMLTokenizer_startElement(swigCPtr, XMLToken.getCPtr(element));
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public override void endDocument() {
    libsbmlPINVOKE.XMLTokenizer_endDocument(swigCPtr);
  }

  public override void endElement(XMLToken element) {
    libsbmlPINVOKE.XMLTokenizer_endElement(swigCPtr, XMLToken.getCPtr(element));
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public override void characters(XMLToken data) {
    libsbmlPINVOKE.XMLTokenizer_characters(swigCPtr, XMLToken.getCPtr(data));
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

}

}
