X-Git-Url: http://www.andromeda.nl/gitweb/?a=blobdiff_plain;f=demos%2Facltest.cpp;h=46743a94cb6b781dea40d539e3b11567b2bd69b9;hb=00c7a023c7d4f8c322b81d211972932cc50af9de;hp=9cdaf042dca37781a454d0fcef7cf05ccc766ea1;hpb=b5b889ce26ff2b0d4b1e604d2b7001d9c4f00553;p=AXE.git diff --git a/demos/acltest.cpp b/demos/acltest.cpp index 9cdaf04..46743a9 100644 --- a/demos/acltest.cpp +++ b/demos/acltest.cpp @@ -5,7 +5,7 @@ *********************** ** FILE NAME : acltest.cpp ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation -** VERSION NUMBER : $Revision: 1.4 $ +** VERSION NUMBER : $Revision: 1.5 $ ** ** DESCRIPTION : Test routine for non-X classes ** @@ -22,7 +22,10 @@ /***************************** $Log: acltest.cpp,v $ - Revision 1.4 2002-09-26 14:48:46 arjen + Revision 1.5 2002-11-03 13:19:33 arjen + New functions - String::escape() and String::unescape() + + Revision 1.4 2002/09/26 14:48:46 arjen Use the std: namespace for STL objects Revision 1.3 2002/09/02 06:18:12 arjen @@ -37,7 +40,7 @@ *****************************/ -static const char *RCSID = "$Id: acltest.cpp,v 1.4 2002-09-26 14:48:46 arjen Exp $"; +static const char *RCSID = "$Id: acltest.cpp,v 1.5 2002-11-03 13:19:33 arjen Exp $"; #include "String.h" #include "integer.h" @@ -105,6 +108,22 @@ int main() String num(3737); std::cout << num << "\n"; + std::cout << "***********************\nEscape Test\n*********************\n"; + + x = "\a\b\f\n\r\t\v\"'\\\xC0\x02"; + y = x.escape(); + std::cout << "Escaped sequence = " << y << "\n"; + if (y.unescape() == x) + { + std::cout << "Escape sequence converts back into original string.\n"; + } + else + { + std::cout << "Escape sequence does NOT convert back into original string.\n"; + x = y.unescape(); + std::cout << x.escape() << "\n"; + } + std::cout << "***********************\nInteger Test\n*********************\n"; integer a(2000000000), b(2048); integer c;