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

namespace clucene.net {

using System;

public class Debug : IDisposable {
  private IntPtr swigCPtr;
  protected bool swigCMemOwn;

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

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

  ~Debug() {
    Dispose();
  }

  public virtual void Dispose() {
    if(swigCPtr != IntPtr.Zero && swigCMemOwn) {
      swigCMemOwn = false;
      libCLcsharpPINVOKE.delete_Debug(swigCPtr);
    }
    swigCPtr = IntPtr.Zero;
    GC.SuppressFinalize(this);
  }

  public static void PrintUnclosedObjects() {
    libCLcsharpPINVOKE.Debug_PrintUnclosedObjects();
  }

  public static void SetDebugValidityCheck(bool on) {
    libCLcsharpPINVOKE.Debug_SetDebugValidityCheck(on);
  }

  public static bool IsBooleanQuery(Query q) {
    return libCLcsharpPINVOKE.Debug_IsBooleanQuery(Query.getCPtr(q));
  }

  public static BooleanQuery ToBooleanQuery(Query q) {
    IntPtr cPtr = libCLcsharpPINVOKE.Debug_ToBooleanQuery(Query.getCPtr(q));
    return (cPtr == IntPtr.Zero) ? null : new BooleanQuery(cPtr, false);
  }

  public Debug() : this(libCLcsharpPINVOKE.new_Debug(), true) {
  }

}

}
