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

#include <fdiostream.h>

Inheritance diagram for libdap::fdoutbuf:
Inheritance graph

Public Member Functions

 fdoutbuf (int _fd, bool _close)
 
virtual ~fdoutbuf ()
 

Protected Member Functions

int flushBuffer ()
 
virtual int overflow (int c)
 
virtual int sync ()
 
virtual std::streamsize xsputn (const char *s, std::streamsize num)
 

Protected Attributes

char buffer [bufferSize]
 
bool close
 
int fd
 

Static Protected Attributes

static const int bufferSize = 4096
 

Detailed Description

fdoutbuf is a stream buffer specialization designed specifically for files that are referenced using a file descriptor. This class implements a 4k buffer for data and optionally closes the file when the buffer is deleted.

Note
Instead of using this class, use fdostream.
See also
fdostream

Definition at line 50 of file fdiostream.h.

Constructor & Destructor Documentation

◆ fdoutbuf()

libdap::fdoutbuf::fdoutbuf ( int  _fd,
bool  _close 
)

Make an instance of fdoutbuf. To write to a file using an open file descriptor, use fdostream instead.

Parameters
_fdThe open file descriptor
_closeIf true, close the file when the stream buffer is deleted. False by default.
See also
fdostream

Definition at line 43 of file fdiostream.cc.

◆ ~fdoutbuf()

libdap::fdoutbuf::~fdoutbuf ( )
virtual

When deleting the stream buffer, be sure to call sync(). Close the associated file if specified.

Definition at line 51 of file fdiostream.cc.

Member Function Documentation

◆ overflow()

int libdap::fdoutbuf::overflow ( int  c)
protectedvirtual

Buffer full, write c and all previous characters

Definition at line 69 of file fdiostream.cc.

◆ sync()

int libdap::fdoutbuf::sync ( )
protectedvirtual

synchronize with file/destination

Definition at line 85 of file fdiostream.cc.

◆ xsputn()

std::streamsize libdap::fdoutbuf::xsputn ( const char *  s,
std::streamsize  num 
)
protectedvirtual

write multiple characters

Definition at line 95 of file fdiostream.cc.


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