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

QueryParser.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 QueryParser : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

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

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

  ~QueryParser() {
    Dispose();
  }

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

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

  public void SetStemmer(Stem stemmer) {
    XapianPINVOKE.QueryParser_SetStemmer(swigCPtr, Stem.getCPtr(stemmer));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetStemmingStrategy(QueryParser.stem_strategy strategy) {
    XapianPINVOKE.QueryParser_SetStemmingStrategy(swigCPtr, (int)strategy);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetStopper(Stopper stop) {
    XapianPINVOKE.QueryParser_SetStopper__SWIG_0(swigCPtr, Stopper.getCPtr(stop));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetStopper() {
    XapianPINVOKE.QueryParser_SetStopper__SWIG_1(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetDefaultOp(Query.op default_op_) {
    XapianPINVOKE.QueryParser_SetDefaultOp(swigCPtr, (int)default_op_);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query.op GetDefaultOp() {
    Query.op ret = (Query.op)XapianPINVOKE.QueryParser_GetDefaultOp(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public void SetDatabase(Database db_) {
    XapianPINVOKE.QueryParser_SetDatabase(swigCPtr, Database.getCPtr(db_));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public Query ParseQuery(string q) {
    Query ret = new Query(XapianPINVOKE.QueryParser_ParseQuery__SWIG_0(swigCPtr, q), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Query ParseQuery(string q, uint flags) {
    Query ret = new Query(XapianPINVOKE.QueryParser_ParseQuery__SWIG_1(swigCPtr, q, flags), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public void AddPrefix(string field, string prefix) {
    XapianPINVOKE.QueryParser_AddPrefix(swigCPtr, field, prefix);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public void AddBooleanPrefix(string field, string prefix) {
    XapianPINVOKE.QueryParser_AddBooleanPrefix(swigCPtr, field, prefix);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

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

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

  public TermIterator UnstemBegin(string term) {
    TermIterator ret = new TermIterator(XapianPINVOKE.QueryParser_UnstemBegin(swigCPtr, term), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public TermIterator UnstemEnd(string term) {
    TermIterator ret = new TermIterator(XapianPINVOKE.QueryParser_UnstemEnd(swigCPtr, term), true);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

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

  public enum feature_flag {
    FLAG_BOOLEAN = 1,
    FLAG_PHRASE = 2,
    FLAG_LOVEHATE = 4,
    FLAG_BOOLEAN_ANY_CASE = 8,
    FLAG_WILDCARD = 16
  }

  public enum stem_strategy {
    STEM_NONE,
    STEM_SOME,
    STEM_ALL
  }

}

}

Generated by  Doxygen 1.6.0   Back to index