1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 2.0.5
4  *
5  * Do not make changes to this file unless you know what you are doing--modify
6  * the SWIG interface file instead.
7  * ----------------------------------------------------------------------------- */
8 
9 namespace Xapian {
10 
11 using System;
12 using System.Runtime.InteropServices;
13 
14 public class TermIterator : IDisposable {
15   private HandleRef swigCPtr;
16   protected bool swigCMemOwn;
17 
TermIterator(IntPtr cPtr, bool cMemoryOwn)18   internal TermIterator(IntPtr cPtr, bool cMemoryOwn) {
19     swigCMemOwn = cMemoryOwn;
20     swigCPtr = new HandleRef(this, cPtr);
21   }
22 
getCPtr(TermIterator obj)23   internal static HandleRef getCPtr(TermIterator obj) {
24     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
25   }
26 
~TermIterator()27   ~TermIterator() {
28     Dispose();
29   }
30 
Dispose()31   public virtual void Dispose() {
32     lock(this) {
33       if (swigCPtr.Handle != IntPtr.Zero) {
34         if (swigCMemOwn) {
35           swigCMemOwn = false;
36           XapianPINVOKE.delete_TermIterator(swigCPtr);
37         }
38         swigCPtr = new HandleRef(null, IntPtr.Zero);
39       }
40       GC.SuppressFinalize(this);
41     }
42   }
43 
operator ++(TermIterator it)44     public static TermIterator operator++(TermIterator it) {
45 	return it.Next();
46     }
Equals(object o)47     public override bool Equals(object o) {
48 	return o is TermIterator && Equals((TermIterator)o);
49     }
operator ==(TermIterator a, TermIterator b)50     public static bool operator==(TermIterator a, TermIterator b) {
51 	if ((object)a == (object)b) return true;
52 	if ((object)a == null || (object)b == null) return false;
53 	return a.Equals(b);
54     }
operator !=(TermIterator a, TermIterator b)55     public static bool operator!=(TermIterator a, TermIterator b) {
56 	if ((object)a == (object)b) return false;
57 	if ((object)a == null || (object)b == null) return true;
58 	return !a.Equals(b);
59     }
60     // Implementing GetHashCode() to always return 0 is rather lame, but
61     // using iterators as keys in a hash table would be rather strange.
GetHashCode()62     public override int GetHashCode() { return 0; }
63 
TermIterator()64   public TermIterator() : this(XapianPINVOKE.new_TermIterator__SWIG_0(), true) {
65     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
66   }
67 
TermIterator(TermIterator other)68   public TermIterator(TermIterator other) : this(XapianPINVOKE.new_TermIterator__SWIG_1(TermIterator.getCPtr(other)), true) {
69     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
70   }
71 
GetTerm()72   public string GetTerm() {
73     string ret = XapianPINVOKE.TermIterator_GetTerm(swigCPtr);
74     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
75     return ret;
76   }
77 
Next()78   public TermIterator Next() {
79     TermIterator ret = new TermIterator(XapianPINVOKE.TermIterator_Next(swigCPtr), true);
80     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
81     return ret;
82   }
83 
Equals(TermIterator other)84   public bool Equals(TermIterator other) {
85     bool ret = XapianPINVOKE.TermIterator_Equals(swigCPtr, TermIterator.getCPtr(other));
86     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
87     return ret;
88   }
89 
SkipTo(string tname)90   public void SkipTo(string tname) {
91     XapianPINVOKE.TermIterator_SkipTo(swigCPtr, tname);
92     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
93   }
94 
GetWdf()95   public uint GetWdf() {
96     uint ret = XapianPINVOKE.TermIterator_GetWdf(swigCPtr);
97     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
98     return ret;
99   }
100 
GetTermFreq()101   public uint GetTermFreq() {
102     uint ret = XapianPINVOKE.TermIterator_GetTermFreq(swigCPtr);
103     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
104     return ret;
105   }
106 
PositionlistCount()107   public uint PositionlistCount() {
108     uint ret = XapianPINVOKE.TermIterator_PositionlistCount(swigCPtr);
109     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
110     return ret;
111   }
112 
PositionListBegin()113   public PositionIterator PositionListBegin() {
114     PositionIterator ret = new PositionIterator(XapianPINVOKE.TermIterator_PositionListBegin(swigCPtr), true);
115     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
116     return ret;
117   }
118 
PositionListEnd()119   public PositionIterator PositionListEnd() {
120     PositionIterator ret = new PositionIterator(XapianPINVOKE.TermIterator_PositionListEnd(swigCPtr), true);
121     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
122     return ret;
123   }
124 
GetDescription()125   public string GetDescription() {
126     string ret = XapianPINVOKE.TermIterator_GetDescription(swigCPtr);
127     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
128     return ret;
129   }
130 
131 }
132 
133 }
134