cmake-d/samples/FullSkeleton/libraryA/io/INotify.d
2007-08-29 11:24:39 +00:00

95 lines
2.2 KiB
D

/**
*
* INotify Class
*
* Authors: Tim Burrell
* Copyright: Copyright (c) 2007
* License: <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
*
**/
////////////////////////////////////////////////////////////////////////////
// Module
///////////////////////////////////////
module libraryA.io.INotify;
////////////////////////////////////////////////////////////////////////////
// Imports
///////////////////////////////////////
import libraryA.core.Exception;
////////////////////////////////////////////////////////////////////////////
// C Bindings
///////////////////////////////////////
extern (C) int inotify_init();
////////////////////////////////////////////////////////////////////////////
// Typedef's / Enums
///////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// INotify Definition
///////////////////////////////////////
/**
* INotify Class
**/
class INotify {
////////////////////////////////////////////////////////////////////
// Constants
///////////////////////////////
////////////////////////////////////////////////////////////////////
// Public members
///////////////////////////////
////////////////////////////////////////////////////////////////////
// Construction
///////////////////////////////
/**
* Default Constructor
**/
this () {
// init inotify
if ((mInotifyFD = inotify_init()) < 0)
throw new Exception("Failed to Initialize INotify!");
}
/**
* Destructor
**/
~this () {
//close(mInotifyFD);
}
////////////////////////////////////////////////////////////////////
// Public Functions
///////////////////////////////
/**
* Add a path to be watched by INotify
*
* Params: WatchPatch = Patch to Watch
* Throws:
**/
void addWatch(char [] WatchPatch) {
}
////////////////////////////////////////////////////////////////////
private:
////////////////////////////////////////////////////////////////////
// Private Functions
///////////////////////////////
////////////////////////////////////////////////////////////////////
// Private Members
///////////////////////////////
int mInotifyFD; ///< Inotify File Descriptor
}