/* ----------------------------------------------------------------------------
 * 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 FSDirectory : Directory {
  private HandleRef swigCPtr;

  internal FSDirectory(IntPtr cPtr, bool cMemoryOwn) : base(libCLcsharpPINVOKE.FSDirectoryUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new HandleRef(this, cPtr);
  }

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

  ~FSDirectory() {
    Dispose();
  }

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

  public string getDirName() {
    string ret = libCLcsharpPINVOKE.FSDirectory_getDirName(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static FSDirectory getDirectory(string file, bool create) {
    IntPtr cPtr = libCLcsharpPINVOKE.FSDirectory_getDirectory(file, create);
    FSDirectory ret = (cPtr == IntPtr.Zero) ? null : new FSDirectory(cPtr, true);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static long fileModified(string dir, string name) {
    long ret = libCLcsharpPINVOKE.FSDirectory_fileModified__SWIG_1(dir, name);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
