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