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
Errno():
This constructor stores the current system errno value and its textual
interpretation. No textual errno conversion is stored if errno equals
0.
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.
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.
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.
int which() const:
Returns the internally stored errno value: either the system-errno
value, or the value provided by the third constructor.
MANIPULATORS
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:
FBB::insertable:
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.
FBB::throwable:
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: