/* ----------------------------------------------------------------------------
 * 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 XmlContainer : IDisposable {
  private IntPtr swigCPtr;
  protected bool swigCMemOwn;

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

  protected XmlContainer() : this(IntPtr.Zero, false) {
  }

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

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

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

  public XmlContainer(DbEnv dbenv, SWIGTYPE_p_std__string name, uint flags) : this(dbxml_dotnetPINVOKE.new_XmlContainer(DbEnv.getCPtr(dbenv), SWIGTYPE_p_std__string.getCPtr(name), flags), true) {
  }

  public void setPageSize(uint pagesize) {
    dbxml_dotnetPINVOKE.XmlContainer_setPageSize(swigCPtr, pagesize);
  }

  public void open(DbTxn txn, uint flags, int mode) {
    dbxml_dotnetPINVOKE.XmlContainer_open(swigCPtr, DbTxn.getCPtr(txn), flags, mode);
  }

  public bool exists(DbTxn txn) {
    return dbxml_dotnetPINVOKE.XmlContainer_exists(swigCPtr, DbTxn.getCPtr(txn));
  }

  public bool isOpen() {
    return dbxml_dotnetPINVOKE.XmlContainer_isOpen(swigCPtr);
  }

  public void close(uint flags) {
    dbxml_dotnetPINVOKE.XmlContainer_close(swigCPtr, flags);
  }

  public void setIndexSpecification(DbTxn txn, XmlIndexSpecification index) {
    dbxml_dotnetPINVOKE.XmlContainer_setIndexSpecification(swigCPtr, DbTxn.getCPtr(txn), XmlIndexSpecification.getCPtr(index));
  }

  public void addIndex(DbTxn txn, SWIGTYPE_p_std__string uri, SWIGTYPE_p_std__string name, SWIGTYPE_p_std__string index) {
    dbxml_dotnetPINVOKE.XmlContainer_addIndex(swigCPtr, DbTxn.getCPtr(txn), SWIGTYPE_p_std__string.getCPtr(uri), SWIGTYPE_p_std__string.getCPtr(name), SWIGTYPE_p_std__string.getCPtr(index));
  }

  public void deleteIndex(DbTxn txn, SWIGTYPE_p_std__string uri, SWIGTYPE_p_std__string name, SWIGTYPE_p_std__string index) {
    dbxml_dotnetPINVOKE.XmlContainer_deleteIndex(swigCPtr, DbTxn.getCPtr(txn), SWIGTYPE_p_std__string.getCPtr(uri), SWIGTYPE_p_std__string.getCPtr(name), SWIGTYPE_p_std__string.getCPtr(index));
  }

  public void replaceIndex(DbTxn txn, SWIGTYPE_p_std__string uri, SWIGTYPE_p_std__string name, SWIGTYPE_p_std__string index) {
    dbxml_dotnetPINVOKE.XmlContainer_replaceIndex(swigCPtr, DbTxn.getCPtr(txn), SWIGTYPE_p_std__string.getCPtr(uri), SWIGTYPE_p_std__string.getCPtr(name), SWIGTYPE_p_std__string.getCPtr(index));
  }

  public void upgrade(uint flags) {
    dbxml_dotnetPINVOKE.XmlContainer_upgrade(swigCPtr, flags);
  }

  public XmlIndexSpecification getIndexSpecification(DbTxn txn) {
    IntPtr cPtr = dbxml_dotnetPINVOKE.XmlContainer_getIndexSpecification(swigCPtr, DbTxn.getCPtr(txn));
    return (cPtr == IntPtr.Zero) ? null : new XmlIndexSpecification(cPtr, true);
  }

  public SWIGTYPE_p_std__string getName() {
    return new SWIGTYPE_p_std__string(dbxml_dotnetPINVOKE.XmlContainer_getName(swigCPtr), false);
  }

  public void setName(SWIGTYPE_p_std__string name) {
    dbxml_dotnetPINVOKE.XmlContainer_setName(swigCPtr, SWIGTYPE_p_std__string.getCPtr(name));
  }

  public uint putDocument(DbTxn txn, XmlDocument document, XmlUpdateContext context, uint flags) {
    return dbxml_dotnetPINVOKE.XmlContainer_putDocument(swigCPtr, DbTxn.getCPtr(txn), XmlDocument.getCPtr(document), XmlUpdateContext.getCPtr(context), flags);
  }

  public void updateDocument(DbTxn txn, XmlDocument document, XmlUpdateContext context) {
    dbxml_dotnetPINVOKE.XmlContainer_updateDocument(swigCPtr, DbTxn.getCPtr(txn), XmlDocument.getCPtr(document), XmlUpdateContext.getCPtr(context));
  }

  public void remove(DbTxn txn, uint flags) {
    dbxml_dotnetPINVOKE.XmlContainer_remove(swigCPtr, DbTxn.getCPtr(txn), flags);
  }

  public void rename(DbTxn txn, SWIGTYPE_p_std__string newName, uint flags) {
    dbxml_dotnetPINVOKE.XmlContainer_rename(swigCPtr, DbTxn.getCPtr(txn), SWIGTYPE_p_std__string.getCPtr(newName), flags);
  }

  public void deleteDocument(DbTxn txn, uint id, XmlUpdateContext context, uint flags) {
    dbxml_dotnetPINVOKE.XmlContainer_deleteDocument__SWIG_0(swigCPtr, DbTxn.getCPtr(txn), id, XmlUpdateContext.getCPtr(context), flags);
  }

  public void deleteDocument(DbTxn txn, XmlDocument document, XmlUpdateContext context, uint flags) {
    dbxml_dotnetPINVOKE.XmlContainer_deleteDocument__SWIG_1(swigCPtr, DbTxn.getCPtr(txn), XmlDocument.getCPtr(document), XmlUpdateContext.getCPtr(context), flags);
  }

  public void modifyDocument(DbTxn txn, XmlModify modify, XmlUpdateContext context, uint flags) {
    dbxml_dotnetPINVOKE.XmlContainer_modifyDocument(swigCPtr, DbTxn.getCPtr(txn), XmlModify.getCPtr(modify), XmlUpdateContext.getCPtr(context), flags);
  }

  public XmlDocument getDocument(DbTxn txn, uint id, uint flags) {
    IntPtr cPtr = dbxml_dotnetPINVOKE.XmlContainer_getDocument(swigCPtr, DbTxn.getCPtr(txn), id, flags);
    return (cPtr == IntPtr.Zero) ? null : new XmlDocument(cPtr, true);
  }

  public XmlQueryExpression parseXPathExpression(DbTxn txn, SWIGTYPE_p_std__string query, XmlQueryContext context) {
    IntPtr cPtr = dbxml_dotnetPINVOKE.XmlContainer_parseXPathExpression(swigCPtr, DbTxn.getCPtr(txn), SWIGTYPE_p_std__string.getCPtr(query), XmlQueryContext.getCPtr(context));
    return (cPtr == IntPtr.Zero) ? null : new XmlQueryExpression(cPtr, true);
  }

  public XmlResults queryWithXPath(DbTxn txn, SWIGTYPE_p_std__string query, XmlQueryContext context, uint flags) {
    IntPtr cPtr = dbxml_dotnetPINVOKE.XmlContainer_queryWithXPath__SWIG_0(swigCPtr, DbTxn.getCPtr(txn), SWIGTYPE_p_std__string.getCPtr(query), XmlQueryContext.getCPtr(context), flags);
    return (cPtr == IntPtr.Zero) ? null : new XmlResults(cPtr, true);
  }

  public XmlResults queryWithXPath(DbTxn txn, XmlQueryExpression query, uint flags) {
    IntPtr cPtr = dbxml_dotnetPINVOKE.XmlContainer_queryWithXPath__SWIG_1(swigCPtr, DbTxn.getCPtr(txn), XmlQueryExpression.getCPtr(query), flags);
    return (cPtr == IntPtr.Zero) ? null : new XmlResults(cPtr, true);
  }

  public void dump(string filename, uint flags) {
    dbxml_dotnetPINVOKE.XmlContainer_dump(swigCPtr, filename, flags);
  }

  public void load(string filename, uint flags) {
    dbxml_dotnetPINVOKE.XmlContainer_load(swigCPtr, filename, flags);
  }

  public void verify(string filename, uint flags) {
    dbxml_dotnetPINVOKE.XmlContainer_verify(swigCPtr, filename, flags);
  }

  public static void setLogLevel(int level, bool enabled) {
    dbxml_dotnetPINVOKE.XmlContainer_setLogLevel(level, enabled);
  }

  public static void setLogCategory(int category, bool enabled) {
    dbxml_dotnetPINVOKE.XmlContainer_setLogCategory(category, enabled);
  }

  public static int get_version_major() {
    return dbxml_dotnetPINVOKE.XmlContainer_get_version_major();
  }

  public static int get_version_minor() {
    return dbxml_dotnetPINVOKE.XmlContainer_get_version_minor();
  }

  public static int get_version_patch() {
    return dbxml_dotnetPINVOKE.XmlContainer_get_version_patch();
  }

  public static string get_version_string() {
    return dbxml_dotnetPINVOKE.XmlContainer_get_version_string();
  }

}
