Skip to content
Snippets Groups Projects
Commit 49345675 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add possibility to silent outputs or to redirect them

This is made in view of parallelism. One will be able to silent processors
or/and produce file output
parent 077ec470
Branches
Tags
1 merge request!9Feature/io
#include <PastisOStream.hpp>
#include <sstream>
#include <iomanip>
PastisOStream pout(std::cout);
PastisOStream perr(std::cerr);
std::stringstream null_stream;
const PastisOStream _null_stream_initializer(*[](std::stringstream& null_stream){
null_stream.setstate(std::ios::badbit);
return &null_stream;}(null_stream));
......@@ -3,6 +3,9 @@
#include <PastisMacros.hpp>
#include <iostream>
#include <sstream>
extern std::stringstream null_stream;
class PastisOStream
{
......@@ -37,5 +40,6 @@ class PastisOStream
extern PastisOStream pout;
extern PastisOStream perr;
extern const PastisOStream _null_stream_initializer;
#endif // PASTIS_OSTREAM_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment