#include "OutPipe.h" #include "Input.h" OutPipe::OutPipe() : Handle(pipe(p, 1)), hooked(0) { } OutPipe::~OutPipe() { if (hooked) { ::close(0); dup(Stdin.GetHandle()); } } void OutPipe::Hook() { if (!hooked) { hooked = 1; ::close(0); dup(p[0]); } } bool OutPipe::CanWrite() { return true; } bool OutPipe::CanRead() { return false; } String OutPipe::GetName() { return (String("Input pipe from stdout (") + (hooked ? "" : "not ") + "hooked)"); }