FBB::X2a(3bobcat)

X-to-ASCII conversions
(libbobcat-dev_6.04.00)

2005-2023

NAME

FBB::X2a - Objects performing x-to-Ascii conversions

SYNOPSIS

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

DESCRIPTION

FBB:X2a objects convert values of any (insertable) type to text. The returned text is automatically made available as a standard C++ string.

X2a was developed well before the std::to_string function became available. In many cases that latter function can often be used instead of using X2a: it is available for standard types. However, if another type must be used then X2a may still come in handy.

NAMESPACE

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

INHERITS FROM

std::ostringstream

CONSTRUCTORS

The copy constructor and the copy assignment operator are available.

STATIC MEMBER FUNCTION

MEMBER FUNCTIONS

All members of std::ostringstream are available, as FBB::X2a inherits from this class. In particular ostringstream::str() can be used to obtain the content of an X2a object's text buffer.

OVERLOADED OPERATORS

EXAMPLE


    string is(X2a(5));      // initializes `is' with "5"
    string ds(X2a(5.25));   // initializes `ds' with "5.25"

    cout << X2a(7.0 / 3, 4) << endl;
                            // display a value using 4 digits behind the
                            // decimal dot.
    cout << X2a(7.0 / 3, 8, 4) << endl;
                            // display a value over 8 positions, right
                            // adjusted, 4 digits behind the decimal dot.
    cout << X2a(7.0 / 3, 8, 4, std::ios::left) << endl;
                            // display a value over 8 positions, left
                            // adjusted, 4 digits behind the decimal dot.
        

FILES

bobcat/x2a - defines the class interface

SEE ALSO

bobcat(7), a2x(3bobcat)

BUGS

none reported

BOBCAT PROJECT FILES

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).