#include <io.hh>
Public Member Functions | |
Stream () | |
Create an empty stream. | |
Stream (std::string file_name, std::string mode, bool allow_close=true) | |
Create and open a stream (see open() for details). | |
~Stream () | |
Destroy the stream and close the possible open file if close_allowed is true . | |
void | open (std::string file_name, std::string mode, bool allow_close=true) |
Open a stream. | |
void | close () |
Close the file, but only if close_allowed is true . | |
Public Attributes | |
FILE * | file |
The handle for the file or pipe. | |
bool | is_pipe |
Is the opened file pipe that must be closed with pclose. | |
bool | close_allowed |
Should the close() function close the file. |
|
Open a stream. If the file name ends with ".gz" a pipe through gzip is created. If the file name ends with "|", an input pipe is created. In that case, the mode must be "r". If the file name starts with "|", an output pipe is created. If the stream was open already, close the previous stream before opening a new one.
|