Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
FBB::OFdStreambuf(3boFile)Descriptor Output Stream BFBB::OFdStreambuf(3bobcat)

NAME
       FBB::OFdStreambuf - Output stream buffer	initialized by a file descrip-
       tor

SYNOPSIS
       #include	<bobcat/ofdstreambuf>
       Linking option: -lbobcat

DESCRIPTION
       FBB::OFdStreambuf objects may be	used as	a std::streambuf  of  std::os-
       tream objects to	allow insertions into a	file descriptor.

       File  descriptors  are  not defined within the context of C++, but they
       can be used on operating	systems	that support the concept. Realize that
       using file descriptors introduces operating system dependencies.

NAMESPACE
       FBB
       All  constructors,  members,  operators	and manipulators, mentioned in
       this man-page, are defined in the namespace FBB.

INHERITS FROM
       std::streambuf

ENUMERATION
       The public enumeration Mode defined in the class	FBB::OFdStreamBuf  has
       the following values:

       o      CLOSE_FD,	indicating that	the file descriptor used by the	object
	      must be closed;

       o      KEEP_FD (the default) indicating that the	file  descriptor  used
	      by the object must not be	closed.

CONSTRUCTORS
       o      OFdStreambuf():
	      This  constructor	initializes the	streambuf, without associating
	      it to a file descriptor, and without using buffering. The	member
	      open()  can be used to associate the object later	on with	a file
	      descriptor and optionally	a buffer size.	When the object	is de-
	      stroyed  or if the mode-less overloaded version of the open mem-
	      ber is called, the file descriptor will be closed.

       o      OFdStreambuf(Mode	mode):
	      This constructor initializes the streambuf, without  associating
	      it to a file descriptor, and without using buffering. The	member
	      open() can be used to associate the object later on with a  file
	      descriptor and optionally	a buffer size.	When the object	is de-
	      stroyed or if the	mode-less overloaded version of	the open  mem-
	      ber is called, the Mode argument determines whether the file de-
	      scriptor will be closed or will remain open.

       o      OFdStreambuf(int fd, size_t n = 1):
	      This constructor initializes the streambuf,  associating	it  to
	      file  descriptor	fd,  and an optional unget buffer size (by de-
	      fault having size	1).  When  open	is called subsequently,	or  if
	      the  object  is  destroyed  the provided file descriptor will be
	      closed.

       o      OFdStreambuf(int fd, size_t n = 1):
	      This constructor initializes the streambuf,  associating	it  to
	      file  descriptor	fd,  and an optional unget buffer size (by de-
	      fault having size	1).  When the object is	destroyed  or  if  the
	      mode-less	 overloaded  version of	the open member	is called, the
	      file descriptor will be closed.

       o      OFdStreambuf(int fd, Mode	mode, size_t n = 1):
	      This constructor initializes the streambuf,  associating	it  to
	      file  descriptor	fd,  and an optional unget buffer size (by de-
	      fault having size	1).  When the object is	destroyed  or  if  the
	      mode-less	 overloaded  version of	the open member	is called, the
	      Mode argument determines whether the  file  descriptor  will  be
	      closed or	will remain open.  There are no	copy or	move construc-
	      tors.

MEMBER FUNCTIONS
       All members of std::streambuf are available, as	FBB::OFdStreambuf  in-
       herits  from  this class. Some of the std::streambuf's member are over-
       ridden by FBB::OFdStreambuf, see	below.

       o      void close():
	      The file descriptor used by the OFdStreambuf  is	closed,	 irre-
	      spective	of  the	 Mode that was specified when the OFdStreambuf
	      object was constructed. Following	close the OFdStreambuf	object
	      can  no  longer  be  used	until one of its open members has been
	      called.

       o      int fd() const:
	      The file descriptor used by the OFdStreambuf object is returned.
	      If  the OFdStreambuf is not associated with a file descriptor -1
	      is returned.

       o      void open(int xfd, size_t	n = 1):
	      The streambuf is (re)initialized,	using file descriptor fd,  and
	      an  optional  unget buffer size (by default having size 1). When
	      called repeatedly, the Mode specification	used whem  the	object
	      was  constructed	determines whether the file descriptor will be
	      closed or	will remain open.

       o      void open(int xfd, Mode mode, size_t n = 1):
	      The streambuf is (re)initialized,	using file  descriptor	fd,  a
	      file  descriptor	closing	parameter and an optional unget	buffer
	      size (by default having size 1). Depending on the	Mode  argument
	      the  object's  currently	used file descriptor will be closed or
	      will remain open when the	IFdStreambuf object is destroyed.  The
	      overloaded assignment operator is	not available.

PROTECTED MEMBER FUNCTION
       The  member listed in this section implements the tasks of the compara-
       bly named virtual function in the class's private interface. This sepa-
       rates the redefinable interface from the	user-interface.	The class OFd-
       Streambuf can, in accordance with Liskov's Substitution	Principle,  be
       used  as	a std:streambuf; but it	also offers a facility for classes de-
       riving from OFdStreambuf. This facility is listed here.

       o      int pSync():
	      The contents of the OFdStreambuf's internal buffer are  flushed.
	      If  writing the contents to the file descriptor fails, a warning
	      message is displayed to the standard error stream.

EXAMPLE
       To do

FILES
       bobcat/ofdstreambuf - defines the class interface

SEE ALSO
       bobcat(7), ifdstreambuf(3bobcat), ofdstream(3bobcat), std::streambuf

BUGS
       None reported

DISTRIBUTION FILES
       o      bobcat_3.25.01-x.dsc: detached signature;

       o      bobcat_3.25.01-x.tar.gz: source archive;

       o      bobcat_3.25.01-x_i386.changes: change log;

       o      libbobcat1_3.25.01-x_*.deb:  debian  package  holding  the   li-
	      braries;

       o      libbobcat1-dev_3.25.01-x_*.deb:  debian  package holding the li-
	      braries, headers and manual pages;

       o      http://sourceforge.net/projects/bobcat: public archive location;

BOBCAT
       Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.

COPYRIGHT
       This is free software, distributed under	the terms of the  GNU  General
       Public License (GPL).

AUTHOR
       Frank B.	Brokken	(f.b.brokken@rug.nl).

libbobcat-dev_3.25.01-x.tar.gz	   2005-2015	    FBB::OFdStreambuf(3bobcat)

NAME | SYNOPSIS | DESCRIPTION | NAMESPACE | INHERITS FROM | ENUMERATION | CONSTRUCTORS | MEMBER FUNCTIONS | PROTECTED MEMBER FUNCTION | EXAMPLE | FILES | SEE ALSO | BUGS | DISTRIBUTION FILES | BOBCAT | COPYRIGHT | AUTHOR

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=ofdstreambuf&sektion=3bobcat&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help