107 lines
2.3 KiB
D
107 lines
2.3 KiB
D
|
/**
|
||
|
*
|
||
|
* 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
|
||
|
|