20 int main(
int argc,
char **argv)
28 JParser<> zap(
"Example program to test redirection of I/O streams.");
34 catch(
const exception &error) {
35 FATAL(error.what() << endl);
41 string message =
"hello world";
48 NOTICE(
"The message <" << message <<
"> is re-directed to <null> if debug < " <<
JEEP::debug_t << endl);
50 JRedirectStream redirect(cout, (
debug >=
JEEP::debug_t) ? static_cast<ostream&>(os) :
null);
52 cout << message << flush;
55 NOTICE(
"result <" << os.str() <<
">" << endl);
62 NOTICE(
"The following input message is re-directed to <null> if debug < " <<
JEEP::debug_t << endl);
64 JRedirectStream redirect(cin, (
debug >=
JEEP::debug_t) ? static_cast<istream&>(is) :
null);
68 DEBUG(
"message <" << message <<
">" << endl);
71 NOTICE(
"result <" << is.str() <<
">" << endl);