Page 1 of 1

Coding with TA3D::String

Posted: Thu Jul 10, 2008 8:34 am
by milipili
The project now uses our own implementation for strings (TA3D::String). In fact, it is only a descendant of the std::string, but with additional features.

For example, you can do this :

Code: Select all

String s;
s << "Total : " << 42 << " (" << 3.65f << " sec.)";
This class can make convertion too :

Code: Select all

String s("On");
if (s.toBool())
   std::cout << "Enabled." << std::endl;

String t(42);
switch (t.toInt32())
{
   case 42: ; // do something
   default : ; // do something
}
You may refer to src/misc/string.h for more information.

Posted: Thu Jul 10, 2008 10:56 am
by zuzuf
hm that's nice :)