ucommon::filestream Class Reference

Streamable tcp connection between client and server. More...

#include <stream.h>

Inheritance diagram for ucommon::filestream:

Inheritance graph
[legend]
Collaboration diagram for ucommon::filestream:

Collaboration graph
[legend]

Public Types

enum  access_t { RDONLY, WRONLY, RDWR }
 RDONLY
 RDWR
 WRONLY

Public Member Functions

void close (void)
 Close an active stream connection.
int err (void)
 Get error flag from last i/o operation.
 filestream (char *path, fsys::access_t access, size_t bufsize=512)
 Open file stream.
 filestream (char *path, unsigned mode, fsys::access_t access, size_t bufsize=512)
 Create and open a file stream.
 filestream (filestream &copy)
 Create duplicate stream.
 filestream ()
 Create an unopened pipe stream.
void open (char *filename, unsigned mode, fsys::access_t access, size_t buffering=512)
 Create a stream connection to a tcp service.
void open (char *filename, fsys::access_t access, size_t buffering=512)
 Open a stream connection to a tcp service.
 operator bool ()
 See if stream connection is active.
bool operator! ()
 See if stream is disconnected.
void seek (fsys::offset_t offset)
 Seek position.
virtual ~filestream ()
 Destroy a file stream.

Protected Member Functions

int overflow (int ch)
 This streambuf method is used to write the output buffer through the established pipe connection.
int underflow (void)
 This streambuf method is used to load the input buffer through the established pipe connection.

Protected Attributes

fsys::access_t ac
fsys_t fd

Detailed Description

Streamable tcp connection between client and server.

The tcp stream class can represent a client connection to a server or an instance of a service generated by a tcp listener. As a stream class, data can be manipulated using the << and >> operators.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 336 of file stream.h.


Member Function Documentation

int ucommon::filestream::err ( void   )  [inline]

Get error flag from last i/o operation.

Returns:
last error.

Definition at line 433 of file stream.h.

ucommon::filestream::operator bool (  )  [inline]

See if stream connection is active.

Returns:
true if stream is active.

Reimplemented from ucommon::StreamBuffer.

Definition at line 399 of file stream.h.

bool ucommon::filestream::operator! (  )  [inline]

See if stream is disconnected.

Returns:
true if stream disconnected.

Reimplemented from ucommon::StreamBuffer.

Definition at line 406 of file stream.h.

int ucommon::filestream::overflow ( int  ch  )  [protected]

This streambuf method is used to write the output buffer through the established pipe connection.

Parameters:
ch char to push through.
Returns:
char pushed through.

int ucommon::filestream::underflow ( void   )  [protected]

This streambuf method is used to load the input buffer through the established pipe connection.

Returns:
char from get buffer, EOF if not connected.


The documentation for this class was generated from the following file:
Generated on 14 Aug 2013 for UCommon by  doxygen 1.4.7