#include <io.hh>
Public Member Functions | |
Stream () | |
Create an empty stream. | |
Stream (std::string file_name, std::string mode="r", bool allow_close=true) | |
Create and open a stream (see open() for details). | |
Stream (const Stream &stream) | |
Copy constructor allowed only for closed streams. | |
~Stream () | |
Destroy the stream and close the possible open file if close_allowed is true . | |
void | open (std::string file_name, std::string mode="r", bool allow_close=true) |
Open a stream. | |
void | close () |
Close the file, but only if close_allowed is true . | |
operator FILE * () | |
Automatic typecast to FILE* structure. | |
bool | is_open () |
Check if stream is opened. | |
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. | |
Private Member Functions | |
const Stream & | operator= (const Stream &stream) |
A stream can be a file or a pipe.
|
Create an empty stream.
|
|
Create and open a stream (see open() for details).
|
|
Copy constructor allowed only for closed streams.
|
|
Destroy the stream and close the possible open file if close_allowed is
|
|
Close the file, but only if close_allowed is
|
|
Check if stream is opened.
|
|
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.
|
|
Automatic typecast to FILE* structure.
|
|
|
|
Should the close() function close the file.
|
|
The handle for the file or pipe.
|
|
Is the opened file pipe that must be closed with pclose.
|