FBB::A2x(3bobcat)

Error handler
(libbobcat-dev_4.08.03-x.tar.gz)

2005-2018

NAME

FBB::A2x - Objects performing ascii-to-x (anything) conversions

SYNOPSIS

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

DESCRIPTION

FBB::A2x objects offer the C++ equivalent of the standard C conversion functions atoi(3), atol(3), atof(3) etc. A2x objects generalize these C functions to any type that can be extracted from an istream object. Since FBB::A2x represents the object-variant of the C functions, and is therefore type-safe and extensible, their use is greatly preferred over using the standard C functions.

Conversions to most standard numeric types is also available through functions like std::stol, std::stod, etc.

NAMESPACE

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

INHERITS FROM

std::istringstream

CONSTRUCTORS

The copy constructor is available.

STATIC MEMBER FUNCTION

MEMBER FUNCTION

All members of the istringstream class are available.

OVERLOADED OPERATORS

EXAMPLE


    int x = A2x("12");

    A2x a2x("12.50");

    double d;

    d = a2x;

    a2x = "err";

    d = a2x;        // d now 0

    a2x = " a";

    char c = a2x;   // c now 'a'

                    // explicit conversion to `double'
    cout << A2x("12.4").to<double>() << endl;
        

FILES

bobcat/a2x - defines the class interface

SEE ALSO

bobcat(7), x2a(3bobcat), atoi(3), atol(3), atof(3), strtod(3), strtol(3), strdoul(3)

BUGS

None Reported.

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