Logo Search packages:      
Sourcecode: xapian-bindings version File versions  Download package

Query.cs

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

namespace Xapian {

using System;
using System.Runtime.InteropServices;

public class Query : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal Query(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(Query obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~Query() {
    Dispose();
  }

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

  public Query(string tname, uint wqf, uint term_pos) : this(XapianPINVOKE.new_Query__SWIG_0(tname, wqf, term_pos), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query(string tname, uint wqf) : this(XapianPINVOKE.new_Query__SWIG_1(tname, wqf), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query(string tname) : this(XapianPINVOKE.new_Query__SWIG_2(tname), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query(Query.op op_, Query left, Query right) : this(XapianPINVOKE.new_Query__SWIG_3((int)op_, Query.getCPtr(left), Query.getCPtr(right)), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query(Query.op op_, string left, string right) : this(XapianPINVOKE.new_Query__SWIG_4((int)op_, left, right), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query(Query copyme) : this(XapianPINVOKE.new_Query__SWIG_5(Query.getCPtr(copyme)), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query(Query.op op, SWIGTYPE_p_std__vectorTstd__string_t subqs, uint param) : this(XapianPINVOKE.new_Query__SWIG_6((int)op, SWIGTYPE_p_std__vectorTstd__string_t.getCPtr(subqs), param), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query(Query.op op, SWIGTYPE_p_std__vectorTstd__string_t subqs) : this(XapianPINVOKE.new_Query__SWIG_7((int)op, SWIGTYPE_p_std__vectorTstd__string_t.getCPtr(subqs)), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query(Query.op op, SWIGTYPE_p_std__vectorTXapian__Query_t subqs, uint param) : this(XapianPINVOKE.new_Query__SWIG_8((int)op, SWIGTYPE_p_std__vectorTXapian__Query_t.getCPtr(subqs), param), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query(Query.op op, SWIGTYPE_p_std__vectorTXapian__Query_t subqs) : this(XapianPINVOKE.new_Query__SWIG_9((int)op, SWIGTYPE_p_std__vectorTXapian__Query_t.getCPtr(subqs)), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query(Query.op op_, Query q) : this(XapianPINVOKE.new_Query__SWIG_10((int)op_, Query.getCPtr(q)), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query() : this(XapianPINVOKE.new_Query__SWIG_11(), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public uint GetLength() {
    uint ret = XapianPINVOKE.Query_GetLength(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public TermIterator GetTermsBegin() {
    TermIterator ret = new TermIterator(XapianPINVOKE.Query_GetTermsBegin(swigCPtr), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public TermIterator GetTermsEnd() {
    TermIterator ret = new TermIterator(XapianPINVOKE.Query_GetTermsEnd(swigCPtr), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool Empty() {
    bool ret = XapianPINVOKE.Query_Empty(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool IsEmpty() {
    bool ret = XapianPINVOKE.Query_IsEmpty(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public string GetDescription() {
    string ret = XapianPINVOKE.Query_GetDescription(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public enum op {
    OP_AND,
    OP_OR,
    OP_AND_NOT,
    OP_XOR,
    OP_AND_MAYBE,
    OP_FILTER,
    OP_NEAR,
    OP_PHRASE,
    OP_ELITE_SET = 10
  }

}

}

Generated by  Doxygen 1.6.0   Back to index