Coding with TA3D::String

Everything related to the code /
Tout ce qui touche au code
Post Reply
milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Coding with TA3D::String

Post by milipili » Thu Jul 10, 2008 8:34 am

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.
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Thu Jul 10, 2008 10:56 am

hm that's nice :)
=>;-D Penguin Powered

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests