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