14 #ifndef __PFSTREAMBUF_H__ 15 #define __PFSTREAMBUF_H__ 26 #define WIN_PIPE_CALLS 1 30 #ifndef WIN32_LEAN_AND_MEAN 31 #define WIN32_LEAN_AND_MEAN 1 35 #else // WIN_PIPE_CALLS 39 #define pclose _pclose 42 #endif // WIN_PIPE_CALLS 46 enum Direction { Input, Output };
52 void command(
const std::string);
55 virtual int overflow(
int c);
56 virtual int sync(
void);
57 virtual int underflow(
void);
61 bool eof_pipe()
const;
62 bool open_pipe(
const std::string &cmd);
64 size_t write_pipe(
const char *data,
size_t len);
65 size_t read_pipe(
char *data,
size_t len);
68 std::string _line_buffer;
70 #ifndef WIN_PIPE_CALLS 73 #else // WIN_PIPE_CALLS 75 #endif // WIN_PIPE_CALLS 77 void write_chars(
const char*,
int,
bool);