libcommonc++
0.7
|
A smart pointer for stdio streams. More...
#include <FilePtr.h++>
Public Member Functions | |
FilePtr (const char *name, const char *mode) | |
Construct a new FilePtr for the given filename and attributes. More... | |
FilePtr (const String &name, const String &mode) | |
Construct a new FilePtr for the given filename and attributes. More... | |
FilePtr (FILE *fp) | |
Construct a new FilePtr for an existing stdio stream. More... | |
~FilePtr () | |
Destructor. More... | |
operator FILE * () | |
Cast operator. More... | |
bool | isValid () const |
Determine if the stream is valid (non-NULL). More... | |
bool | operator! () |
Determine if the stream is invalid (NULL). More... | |
A smart pointer for stdio streams.
FilePtr | ( | const char * | name, |
const char * | mode | ||
) |
Construct a new FilePtr for the given filename and attributes.
The constructor calls fopen() to open the stream.
name | The filename. |
mode | The open mode. |
Construct a new FilePtr for the given filename and attributes.
The constructor calls fopen() to open the stream.
name | The filename. |
mode | The open mode. |
FilePtr | ( | FILE * | fp | ) |
Construct a new FilePtr for an existing stdio stream.
fp | The stream pointer. |
~FilePtr | ( | ) |
Destructor.
Closes the stream.
|
inline |
Determine if the stream is valid (non-NULL).
|
inline |
Cast operator.
|
inline |
Determine if the stream is invalid (NULL).