libdap  Updated for version 3.20.6
libdap4 is an implementation of OPeNDAP's DAP protocol.
libdap::fdostream Class Reference

#include <fdiostream.h>

Inheritance diagram for libdap::fdostream:
Inheritance graph

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 or a FILE pointer.

Definition at line 77 of file fdiostream.h.

Constructor & Destructor Documentation

◆ fdostream()

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
_fdThe file descriptor of an open file, socket, et cetera.
_closeIf true, close the file when the output stream buffer is deleted. Default: false.

Definition at line 87 of file fdiostream.h.


The documentation for this class was generated from the following file: