FBB::A2x(3bobcat)
π FBB::A2x β ascii-to-x (anything) conversions π
okay bestie, welcome to the 3bobcat manual page for FBB::A2x, aka the "Text to X convertor" and honestly? it's giving glow-up-from-a-string. π
β¨ NAME β¨
FBB::A2x β Objects performing ascii-to-x (anything) conversions π¦
β¨ SYNOPSIS β¨
#include <bobcat/a2x>
Linking option: -lbobcat
β¨ DESCRIPTION β¨
so like, FBB::A2x objects are literally the C++ equivalent of the standard C++ string conversion functions β you know, stol, stoul, stod and the whole squad. Those standard C++ string functions are extremely useful and should probably be preferred over using the members of A2x objects. no cap. π
but here's the slay: A2x offers additional benefits because it generalizes these functions to any type that can be extracted from an istream object. main character energy, honestly. π
β¨ NAMESPACE β¨
FBB
Every single constructor, member, and operator mentioned in this man-page lives in the namespace FBB. periodt. π
β¨ INHERITS FROM β¨
std::istringstream
bestie really said "I contain multitudes (and a stringstream)". π«Ά
β¨ CONSTRUCTORS β¨
A2x()β constructs an emptyA2xobject. and likeβ¦ no information can be converted from a thus constructedA2xobject. it's giving empty. πA2x(char const *text)β this one storestext. Iftextrepresents a textual value of some type, theA2xobject may be used to initialize or assign this value to a variable of that particular type. Extraction, however, is also still possible. β¨A2x(std::string const &str)β stores the text contained instr. If this text represents a textual value of some type, theA2xobject may be used to initialize or assign this value to a variable of that particular type. Extraction is also still possible. π
The copy and move constructors are available. lowkey iconic of them. π¦
β¨ STATIC MEMBER FUNCTION β¨
bool lastFail()β returnstrueif the last conversion failed (i.e., the object'sfail()member returnedtrue, andfalseotherwise). This member allows checks on the success of the extraction/conversion using anonymousA2xobjects β sneaky and efficient, we love that. π
it also returns true when no conversions have as yet been performed. π
heads up!! this member returns the value of athread_localstatic member: different threads cannot inspect other threads'lastFailstatus. it's giving β¨personal spaceβ¨. no cross-thread snooping.
β¨ MEMBER FUNCTION β¨
All members of the istringstream class are available β you inherit the whole closet, bestie. π
Type to()β returns any type Type supporting extractions fromi[string]streams. If the extraction fails, theA2xobject'sgood()member returnsfalse, and the Type's default value is returned. This operator was implemented as a template member function. π₯
there's also a type conversion operator available (peep below π), but the member function variant may be preferred over the conversion operator in situations where explicit disambiguation is required β e.g., in cases where a conversion has no obvious type solution such as direct insertions. an example is provided in the EXAMPLE section below. π
β¨ OVERLOADED OPERATORS β¨
operator Type()β conversion to any type Type supporting extractions fromistreams. If the extraction fails, theA2xobject'sgood()member will returnfalse, and the Type's default value is returned. This operator was implemented as a member template. β¨istream &operator>>(istream &, Type &)β extraction to any type Type supporting extractions fromistreams. If the extraction fails, theA2xobject'sgood()member returnsfalse, and the Type's default value is returned. (this facility is implied by the fact that this class inherits fromistringstream, but it's probably useful to stress that the extraction operation is still available π )A2x &operator=(char const *)β stores new text in theA2xobject, resets the status flags toios::good. π«Ά and if a0-pointer is passed, an empty string is stored. noted.A2x &operator=(std::string const &)β stores the text stored in thestd::stringargument in theA2xobject, resets the status flags toios::good. clean slate vibes. πΈ
The overloaded assignment operator is available.
β¨ EXAMPLE β¨
okay watch this, fr fr:
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;
it ate and left no crumbs. π₯
β¨ FILES β¨
bobcat/a2xβ defines the class interface
β¨ SEE ALSO β¨
the whole friend group π«Ά
β¨ BUGS β¨
None Reported. we're flawless, your honor. π
β¨ BOBCAT PROJECT FILES β¨
https://fbb-git.gitlab.io/bobcat/: gitlab project page;
Debian Bobcat project files:
libbobcat6: debian package containing the shared library, changelog and copyright note;libbobcat-dev: debian package containing the static library, headers, manual pages, and developer info;
β¨ 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).
and that's the whole vibe, bestie β this was libbobcat-dev_6.15.01, dated 2005-2026. ty for coming to my ted talk, mwah ππβ¨
π¦ where this page comes from
- ubuntu stonking: libbobcat-dev 6.15.01-1 Β· GPL-3.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms