FBB::Errno(3bobcat)

NAME

FBB::Errno - Throwable objects handling error conditions

SYNOPSIS

#include <bobcat/errno>
Linking option: -lbobcat

DESCRIPTION

FBB::Errno objects may be thrown in exceptions. As they are also std::ostringstream objects, information may be inserted into them. Facilitities are offered to insert information into, and to throw anonymous FBB::Errno objects.

NAMESPACE

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

INHERITS FROM

std::ostringstream, std::exception

CONSTRUCTORS

o Errno():
This constructor stores the current system errno value and its textual interpretation. No textual errno conversion is stored if errno equals 0.
o Errno(char const *prefix):
This constructor stores the current system errno value. To this, the textual interpretation of errno is added unless errno equals 0. If, in this situation, prefix is a non-empty string, the text : is first appended to the prefix.
o Errno(int errnr, char const *text = 0): This constructor stores the provided errnr value, and the text text. The text argument may be omitted or empty, in which case no text will be prefixed to any additionally inserted information. With this version of FBB::Errno, no : is added to a non-empty text argument. The copy constructor is available.

MEMBER FUNCTIONS

All members of std::ostringstream and std::exception are available, as FBB::Errno inherits from these classes.

o virtual char const *what() const:
Returns the initialized and inserted text. No separators are inserted by the FBB::Errno object between the initializatin text and any text inserted later. If separators are required, the user of the FBB::Errno object must insert these explicitly.
o int which() const:Returns the internally stored errno value: either the system-errno value, or the value provided by the third constructor.
o int which() const:Returns the internally stored errno value: either the system-errno value, or the value provided by the third constructor.

OVERLOADED OPERATORS

o Errno const &operator<<(Errno const &in, Type const &t):
This overloaded insertion operator can be used to insert values of any type that can also be inserted into an ostringstream object. It is implemented as a template, with the generic Type representing the type of the value to be inserted. The overloaded assignment operator is not available.

OBSOLETED MANIPULATORS

The manipulators listed here are obsoleted and should no longer be used. They will be removed from Bobcat in some future version.

The following manipulators (which are not part of the FBB::Errno, class, but are defined in the FBB namespace) can be inserted into the FBB::Errno object:

o FBB::insertable:
(OBSOLETED) If inserted immediately after the construction of an anonymous FBB::Errno object, information may be inserted into the anonymous object immediately thereafter. The manipulator is not required for named Errno objects into which information is inserted after their construction.
o FBB::throwable:
(OBSOLETED) If placed at the end of a series of insertions into the FBB::Errno object, it allows the object to be thrown as an exception in one expression.

EXAMPLE

The following example shows the normal use of the manipulators:
if (exceptionalCondition)
throw FBB::Errno(1, "Failure") << ": Exceptional condition occurred";

FILES

bobcat/errno - defines the class interface

SEE ALSO

bobcat(7)

BUGS

None Reported.

DISTRIBUTION FILES

o bobcat_2.08.01-x.dsc: detached signature;

o bobcat_2.08.01-x.tar.gz: source archive;

o bobcat_2.08.01-x_i386.changes: change log;

o libbobcat1_2.08.01-x_*.deb: debian package holding the
libraries;
o libbobcat1-dev_2.08.01-x_*.deb: debian package holding the libraries, 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).
Copyright © 2010-2024 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout