libdap::fdostream Class Reference

#include <fdiostream.h>

Inheritance diagram for libdap::fdostream:

Inheritance graph
[legend]
Collaboration diagram for libdap::fdostream:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 fdostream (int _fd, bool _close=false)

Protected Attributes

fdoutbuf buf

Detailed Description

This specialization of ostream builds a fdoutbuf instance and binds it to an ostream. Thus it is possible to build an ostream from an open file, using its file descriptor, and write to it using C++ stream I/O methods.

Todo:
Generalize this so that it can take a FILE * as well and then make two classes file_istream and file_ostream that can be initialized with either a file descriptor of a FILE pointer.

Definition at line 77 of file fdiostream.h.


Constructor & Destructor Documentation

libdap::fdostream::fdostream ( int  _fd,
bool  _close = false 
) [inline]

Make a new fdostream and initialize it to use a specific file descriptor. If the file descriptor does not reference an open file, the first attempt to write data will fail.

Parameters:
_fd The file descriptor of an open file, socket, et cetera.
_close If true, close the file when the output stream buffer is deleted. Default: false.

Definition at line 87 of file fdiostream.h.


Member Data Documentation

fdoutbuf libdap::fdostream::buf [protected]

Definition at line 79 of file fdiostream.h.


The documentation for this class was generated from the following file:
Generated on Wed Feb 10 16:10:29 2010 for libdap++ by  doxygen 1.4.7