FBB::X2a(3bobcat) | X-to-ASCII conversions | FBB::X2a(3bobcat) |
FBB::X2a - Objects performing x-to-Ascii conversions
#include <bobcat/x2a>
Linking option: -lbobcat
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.
FBB
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace FBB.
std::ostringstream
The copy constructor and the copy assignment operator are available.
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.
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.
bobcat/x2a - defines the class interface
bobcat(7), a2x(3bobcat)
none reported
Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.
This is free software, distributed under the terms of the GNU General Public License (GPL).
Frank B. Brokken (f.b.brokken@rug.nl).
2005-2023 | libbobcat-dev_6.04.00 |