#ifndef DEBUGSTREAM_H
#define DEBUGSTREAM_H
-#ifdef _STANDARD_C_PLUS_PLUS
-#define MODERN_STL
-#endif
-
-#ifdef MODERN_STL
-#include <ostream>
-#else
#include <iostream>
-#endif
#ifdef TEST_DEBUGSTREAM
#include <string>
debug[Debug::type(Debug::INFO | Debug::CRIT)] << "...info/crit...\n";
*/
-class DebugStream : public std::ostream {
+class DebugStream : public ostream {
public:
/// Constructor, sets the debug level to t.
- DebugStream(Debug::type t = Debug::NONE);
+ explicit DebugStream(Debug::type t = Debug::NONE);
/// Constructor, sets the log file to f, and the debug level to t.
DebugStream(char const * f, Debug::type t = Debug::NONE);
current debug level otherwise the real debug stream
is used.
*/
- std::ostream & debug(Debug::type t = Debug::ANY) {
+ ostream & debug(Debug::type t = Debug::ANY) {
if (dt & t) return *this;
return nullstream;
}
/** This is an operator to give a more convenient use:
dbgstream[Debug::INFO] << "Info!\n";
*/
- std::ostream & operator[](Debug::type t) {
+ ostream & operator[](Debug::type t) {
return debug(t);
}
private:
/// The current debug level
Debug::type dt;
/// The no-op stream.
- std::ostream nullstream;
+ ostream nullstream;
struct debugstream_internal;
debugstream_internal * internal;
};