45 #ifndef INOUTFRAMEWORK_HPP
46 #define INOUTFRAMEWORK_HPP
68 template<
class IType,
class OType>
82 const std::string& applDesc )
100 inputOpt(
'i',
"input",
101 "A file to take the input from. The default is stdin."),
102 outputOpt(
'o',
"output",
103 "A file to receive the output. The default is stdout.");
108 if (inputOpt.getCount())
109 inputFn = inputOpt.getValue()[0];
114 input.copyfmt(std::cin);
115 input.clear(std::cin.rdstate());
116 input.ios::rdbuf(std::cin.rdbuf());
127 std::cerr <<
"Could not open: " <<
inputFn << std::endl;
137 output.copyfmt(std::cout);
138 output.clear(std::cout.rdstate());
139 output.ios::rdbuf(std::cout.rdbuf());
149 std::cerr <<
"Could not open: " <<
outputFn << std::endl;
155 std::cerr <<
"Sending output to " <<
outputFn << std::endl
156 <<
"Reading input from " <<
inputFn << std::endl;
181 #endif // INOUTFRAMEWORK_HPP