Very basic stuff working on linux 32-bit with dmd and phobos2.
This commit is contained in:
parent
f23eee9828
commit
67f0225e42
152 changed files with 113 additions and 0 deletions
95
tests/FullSkeleton/libraryA/io/INotify.d
Normal file
95
tests/FullSkeleton/libraryA/io/INotify.d
Normal file
|
@ -0,0 +1,95 @@
|
|||
/**
|
||||
*
|
||||
* 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
|
||||
}
|
106
tests/FullSkeleton/libraryA/io/Output.d
Normal file
106
tests/FullSkeleton/libraryA/io/Output.d
Normal file
|
@ -0,0 +1,106 @@
|
|||
/**
|
||||
*
|
||||
* Output 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.Output;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Imports
|
||||
///////////////////////////////////////
|
||||
|
||||
version (Tango) {
|
||||
import tango.io.Stdout;
|
||||
} else {
|
||||
import std.stdio;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Typedef's / Enums
|
||||
///////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Output Definition
|
||||
///////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Output Class
|
||||
**/
|
||||
class Output {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Constants
|
||||
///////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Public members
|
||||
///////////////////////////////
|
||||
|
||||
public alias output opCall; /// Alias opCall
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Construction
|
||||
///////////////////////////////
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
**/
|
||||
this () {
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
**/
|
||||
~this () {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Public Functions
|
||||
///////////////////////////////
|
||||
|
||||
/**
|
||||
* Output some text
|
||||
*
|
||||
* Params: LogLevel = Level of output
|
||||
* Returns: Self
|
||||
**/
|
||||
final Output output(lazy char [] Output) {
|
||||
version (Tango) {
|
||||
Stdout(Output).newline;
|
||||
} else {
|
||||
writefln(Output);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
private:
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Private Functions
|
||||
///////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Private Members
|
||||
///////////////////////////////
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Globals
|
||||
///////////////////////////////////////
|
||||
|
||||
static this() {
|
||||
Out = new Output();
|
||||
}
|
||||
|
||||
public static Output Out; /// Global Logout object
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue