FilePtr Class Reference

A smart pointer for stdio streams. More...

#include <FilePtr.h++>

List of all members.

Public Member Functions

 FilePtr (const char *name, const char *mode) throw ()
 Construct a new FilePtr for the given filename and attributes.
 FilePtr (const String &name, const String &mode) throw ()
 Construct a new FilePtr for the given filename and attributes.
 FilePtr (FILE *fp) throw ()
 Construct a new FilePtr for an existing stdio stream.
 ~FilePtr () throw ()
 Destructor.
 operator FILE * () throw ()
 Cast operator.
bool isValid () const throw ()
 Determine if the stream is valid (non-NULL).
bool operator! () const throw ()
 Determine if the stream is invalid (NULL).

Detailed Description

A smart pointer for stdio streams.

Author:
Mark Lindner

Constructor & Destructor Documentation

FilePtr ( const char *  name,
const char *  mode 
) throw ()

Construct a new FilePtr for the given filename and attributes.

The constructor calls fopen() to open the stream.

Parameters:
name The filename.
mode The open mode.
FilePtr ( const String name,
const String mode 
) throw ()

Construct a new FilePtr for the given filename and attributes.

The constructor calls fopen() to open the stream.

Parameters:
name The filename.
mode The open mode.
FilePtr ( FILE *  fp  )  throw ()

Construct a new FilePtr for an existing stdio stream.

Parameters:
fp The stream pointer.
~FilePtr (  )  throw ()

Destructor.

Closes the stream.


Member Function Documentation

bool isValid (  )  const throw () [inline]

Determine if the stream is valid (non-NULL).

operator FILE * (  )  throw () [inline]

Cast operator.

bool operator! (  )  const throw () [inline]

Determine if the stream is invalid (NULL).


The documentation for this class was generated from the following files:
Generated on Sat Nov 26 16:49:09 2011 for libcommonc++ by  doxygen 1.6.3