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

using System;
public class XmlValue : IDisposable {
  private IntPtr swigCPtr;
  protected bool swigCMemOwn;

  internal XmlValue(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public virtual void Dispose() {
    delete();
  }

  protected virtual void delete() {
    if(swigCPtr != IntPtr.Zero && swigCMemOwn) {
      dbxml_dotnetPINVOKE.delete_XmlValue(swigCPtr);
      swigCMemOwn = false;
    }
    swigCPtr = IntPtr.Zero;
  }

  internal static IntPtr getCPtr(XmlValue obj) {
    return (obj == null) ? IntPtr.Zero : obj.swigCPtr;
  }

  public XmlValue() : this(dbxml_dotnetPINVOKE.new_XmlValue__SWIG_0(), true) {
  }

  public XmlValue(XmlDocument v) : this(dbxml_dotnetPINVOKE.new_XmlValue__SWIG_1(XmlDocument.getCPtr(v)), true) {
  }

  public XmlValue(double v) : this(dbxml_dotnetPINVOKE.new_XmlValue__SWIG_2(v), true) {
  }

  public XmlValue(string v) : this(dbxml_dotnetPINVOKE.new_XmlValue__SWIG_3(v), true) {
  }

  public XmlValue(bool v) : this(dbxml_dotnetPINVOKE.new_XmlValue__SWIG_4(v), true) {
  }

  public XmlValue(int type, string v) : this(dbxml_dotnetPINVOKE.new_XmlValue__SWIG_5(type, v), true) {
  }

  public int getType(XmlQueryContext context) {
    return dbxml_dotnetPINVOKE.XmlValue_getType(swigCPtr, XmlQueryContext.getCPtr(context));
  }

  public bool isNumber(XmlQueryContext context) {
    return dbxml_dotnetPINVOKE.XmlValue_isNumber(swigCPtr, XmlQueryContext.getCPtr(context));
  }

  public bool isString(XmlQueryContext context) {
    return dbxml_dotnetPINVOKE.XmlValue_isString(swigCPtr, XmlQueryContext.getCPtr(context));
  }

  public bool isBoolean(XmlQueryContext context) {
    return dbxml_dotnetPINVOKE.XmlValue_isBoolean(swigCPtr, XmlQueryContext.getCPtr(context));
  }

  public bool isNode(XmlQueryContext context) {
    return dbxml_dotnetPINVOKE.XmlValue_isNode(swigCPtr, XmlQueryContext.getCPtr(context));
  }

  public bool isDocument(XmlQueryContext context) {
    return dbxml_dotnetPINVOKE.XmlValue_isDocument(swigCPtr, XmlQueryContext.getCPtr(context));
  }

  public bool isVariable(XmlQueryContext context) {
    return dbxml_dotnetPINVOKE.XmlValue_isVariable(swigCPtr, XmlQueryContext.getCPtr(context));
  }

  public bool isNull() {
    return dbxml_dotnetPINVOKE.XmlValue_isNull(swigCPtr);
  }

  public double asNumber(XmlQueryContext context) {
    return dbxml_dotnetPINVOKE.XmlValue_asNumber(swigCPtr, XmlQueryContext.getCPtr(context));
  }

  public SWIGTYPE_p_std__string asString(XmlQueryContext context) {
    return new SWIGTYPE_p_std__string(dbxml_dotnetPINVOKE.XmlValue_asString(swigCPtr, XmlQueryContext.getCPtr(context)), true);
  }

  public bool asBoolean(XmlQueryContext context) {
    return dbxml_dotnetPINVOKE.XmlValue_asBoolean(swigCPtr, XmlQueryContext.getCPtr(context));
  }

  public XmlDocument asDocument(XmlQueryContext context) {
    return new XmlDocument(dbxml_dotnetPINVOKE.XmlValue_asDocument(swigCPtr, XmlQueryContext.getCPtr(context)), true);
  }

  public bool equals(XmlValue value, XmlQueryContext context) {
    return dbxml_dotnetPINVOKE.XmlValue_equals(swigCPtr, XmlValue.getCPtr(value), XmlQueryContext.getCPtr(context));
  }

  // enums and constants
  public static int NONE = dbxml_dotnetPINVOKE.get_XmlValue_NONE();
  public static int STRING = dbxml_dotnetPINVOKE.get_XmlValue_STRING();
  public static int NUMBER = dbxml_dotnetPINVOKE.get_XmlValue_NUMBER();
  public static int BOOLEAN = dbxml_dotnetPINVOKE.get_XmlValue_BOOLEAN();
  public static int DOCUMENT = dbxml_dotnetPINVOKE.get_XmlValue_DOCUMENT();
  public static int NODE = dbxml_dotnetPINVOKE.get_XmlValue_NODE();
  public static int VARIABLE = dbxml_dotnetPINVOKE.get_XmlValue_VARIABLE();
  public static int BINARY = dbxml_dotnetPINVOKE.get_XmlValue_BINARY();
}
