/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * 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;
using System.Runtime.InteropServices;

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

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

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

  ~SegmentInfo() {
    Dispose();
  }

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

  public Directory getDir() {
    IntPtr cPtr = libCLcsharpPINVOKE.SegmentInfo_getDir(swigCPtr);
    Directory ret = (cPtr == IntPtr.Zero) ? null : new Directory(cPtr, false);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public string name {
    set {
      libCLcsharpPINVOKE.set_SegmentInfo_name(swigCPtr, value);
      if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    } 
    get {
      string ret = libCLcsharpPINVOKE.get_SegmentInfo_name(swigCPtr);
      if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
      return ret;
    } 
  }

  public int docCount {
    get {
      int ret = libCLcsharpPINVOKE.get_SegmentInfo_docCount(swigCPtr);
      if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
      return ret;
    } 
  }

  public SegmentInfo(string Name, int DocCount, Directory Dir) : this(libCLcsharpPINVOKE.new_SegmentInfo(Name, DocCount, Directory.getCPtr(Dir)), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

}

}
