/* Pipestream: A simple C++ interface to UNIX pipes
Version 0.05
Copyright (C) 2005-2014 John C. Bowman,
with contributions from Mojca Miklavec
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
// bidirectional stream for reading and writing to pipes
class iopipestream {
protected:
int in[2];
int out[2];
static const int BUFSIZE=SHRT_MAX;
char buffer[BUFSIZE];
string sbuffer;
int pid;
bool Running;
bool pipeopen;
bool pipein;
public: