#include "pstream.h" #include // TODO add input buffering to pstreambuf // TODO abstract process creation and control to a process class. // TODO capitalise class names ? // basic_pstreambuf -> BasicPStreamBuf // basic_opstream -> BasicOPStream // basic_ipstream -> BasicIPStream // basic_pstream -> BasicPStream // basic_rpstream -> BasicRPStream // // change Traits to TraitsT ? // don't use C and T, could be used by some char_type ? // instantiate pstreams() base in pstreambuf ctor() ? template class redi::basic_pstreambuf; template class redi::pstream_common; template class redi::basic_pstream; template class redi::basic_ipstream; template class redi::basic_opstream; template class redi::basic_rpstream; int main() { using namespace redi; char c; ipstream who("whoami"); if (!(who >> c)) return 1; redi::opstream cat("cat"); if (!(cat << c)) return 2; while (who >> c) cat << c; cat << '\n' << peof; pstream fail("ghghghg", pstreambuf::pstderr); std::string s; if (!std::getline(fail, s)) return 3; std::cerr << s << '\n'; rpstream who2("whoami"); if (!(who2.out() >> c)) return 4; return 0; }