First public contribution.
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
23 #include <StifParser.h>
24 #include <Stiftestinterface.h>
26 #include<stl/_locale.h>
30 #define STDCPP_OOM FALSE
32 // ============================ MEMBER FUNCTIONS ===============================
34 // -----------------------------------------------------------------------------
36 // Delete here all resources allocated and opened from test methods.
37 // Called from destructor.
38 // -----------------------------------------------------------------------------
40 void Ctlocale::Delete()
45 // -----------------------------------------------------------------------------
46 // Ctlocale::RunMethodL
47 // Run specified method. Contains also table of test mothods and their names.
48 // -----------------------------------------------------------------------------
50 TInt Ctlocale::RunMethodL(
51 CStifItemParser& aItem )
54 static TStifFunctionInfo const KFunctions[] =
56 // Copy this line for every implemented function.
57 // First string is the function name used in TestScripter script file.
58 // Second is the actual implementation member function.
59 ENTRY( "hasfacet", Ctlocale::hasfacet ),
60 ENTRY( "usefacet", Ctlocale::usefacet ),
61 ENTRY( "numget", Ctlocale::numget ),
62 ENTRY( "numput", Ctlocale::numput ),
63 ENTRY( "num_punct", Ctlocale::num_punct ),
64 ENTRY( "numpunctbyname", Ctlocale::numpunctbyname ),
65 ENTRY( "moneyget", Ctlocale::moneyget ),
66 ENTRY( "moneyput", Ctlocale::moneyput ),
67 ENTRY( "money_punct", Ctlocale::money_punct ),
68 ENTRY( "moneypunctbyname", Ctlocale::moneypunctbyname ),
69 ENTRY( "timeget", Ctlocale::timeget ),
70 ENTRY( "timeput", Ctlocale::timeput ),
71 ENTRY( "messagesL", Ctlocale::messagesL ),
72 ENTRY( "messagesbyname", Ctlocale::messagesbyname ),
73 ENTRY( "collateL", Ctlocale::collateL ),
74 ENTRY( "collatebyname", Ctlocale::collatebyname ),
75 ENTRY( "codecvt1", Ctlocale::codecvt1 ),
76 ENTRY( "codecvt2", Ctlocale::codecvt2 ),
77 ENTRY( "codecvtbyname1", Ctlocale::codecvtbyname1 ),
78 ENTRY( "codecvtbyname2", Ctlocale::codecvtbyname2 ),
79 ENTRY( "catalog", Ctlocale::catalog ),
80 ENTRY( "c_type", Ctlocale::c_type ),
84 const TInt count = sizeof( KFunctions ) /
85 sizeof( TStifFunctionInfo );
87 return RunInternalL( KFunctions, count, aItem );
92 // -----------------------------------------------------------------------------
93 // Ctlocale::has_facet
94 // has_facet test method function.
96 // -----------------------------------------------------------------------------
100 TInt Ctlocale::hasfacet( CStifItemParser& aItem )
108 bool result_w = true;
114 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
117 // const char* _Loc_ctype_default(p) ;
119 locale loc("en_GB.UTF-8") ;
120 result = has_facet <ctype<char> > ( loc );
121 result_w = has_facet <ctype<wchar_t> > ( loc );
123 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
158 // -----------------------------------------------------------------------------
159 // Ctlocale::use_facet
160 // use_facet test method function.
162 // -----------------------------------------------------------------------------
166 TInt Ctlocale::usefacet( CStifItemParser& aItem )
174 locale loc ("en_GB.UTF-8");
177 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
179 bool result = use_facet<ctype<char> > ( loc ).is(ctype_base::alpha, 'b');
180 bool result_w = use_facet<ctype<wchar_t> > ( loc ).is(ctype_base::alpha, L'b');
182 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
216 // -----------------------------------------------------------------------------
218 // num_get test method function.
220 // -----------------------------------------------------------------------------
224 TInt Ctlocale::numget( CStifItemParser& aItem )
232 typedef istreambuf_iterator<char,char_traits<char> >
241 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
243 const num_get<char,iter_type>& tg = use_facet<num_get<char,iter_type> >(loc);
246 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
267 // -----------------------------------------------------------------------------
269 // num_put test method function.
271 // -----------------------------------------------------------------------------
273 TInt Ctlocale::numput( CStifItemParser& aItem )
280 typedef ostreambuf_iterator<char,char_traits<char> >
286 // Construct a ostreambuf_iterator on cout
287 iter_type begin(cout);
289 // Get a num_put facet reference
292 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
294 const num_put<char,iter_type>& np = use_facet<num_put<char,iter_type> >(loc);
296 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
319 // -----------------------------------------------------------------------------
320 // Ctlocale::num_punct
321 // num_punct test method function.
323 // -----------------------------------------------------------------------------
325 TInt Ctlocale::num_punct( CStifItemParser& aItem )
335 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
337 const numpunct <char> &npunct = use_facet <numpunct <char> >( loc);
338 const numpunct <wchar_t> &npunct_w = use_facet <numpunct <wchar_t> >( loc);
339 // const numpunct <unsigned> &n1punct = use_facet <numpunct <unsigned> >( loc);
341 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
344 if(npunct.truename() == "true")
345 if(npunct.falsename()=="false")
346 if(npunct.decimal_point() =='.')
347 if(npunct.thousands_sep() ==',')
353 return KErrGeneral;*/
354 if(npunct.truename() != "true")
356 if(npunct.falsename()!="false")
358 if(npunct.decimal_point() !='.')
360 if(npunct.thousands_sep() !=',')
364 if(npunct_w.truename() != L"true")
366 if(npunct_w.falsename()!=L"false")
368 if(npunct_w.decimal_point() != L'.')
370 if(npunct_w.thousands_sep() !=L',')
390 // -----------------------------------------------------------------------------
391 // Ctlocale::numpunct_byname
392 // numpunct_byname test method function.
394 // -----------------------------------------------------------------------------
396 TInt Ctlocale::numpunctbyname( CStifItemParser& aItem )
407 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
409 const numpunct_byname <char> &npunct = use_facet <numpunct_byname <char> >( loc);
410 const numpunct_byname <wchar_t> &npunct_w = use_facet <numpunct_byname <wchar_t> >( loc);
412 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
415 /*if(npunct.truename() == "true")
416 if(npunct.falsename()=="false")
417 if(npunct.decimal_point( ) =='.')
418 if(npunct.thousands_sep( ) ==',')
424 return KErrGeneral;*/
426 if(npunct.truename() != "true")
428 if(npunct.falsename()!="false")
430 if(npunct.decimal_point( ) !='.')
432 if(npunct.thousands_sep( ) !=',')
437 if(npunct_w.truename() != L"true")
439 if(npunct_w.falsename()!= L"false")
441 if(npunct_w.decimal_point( ) != L'.')
443 if(npunct_w.thousands_sep( ) != L',')
463 // -----------------------------------------------------------------------------
464 // Ctlocale::money_get
465 // money_get test method function.
467 // -----------------------------------------------------------------------------
470 TInt Ctlocale::moneyget( CStifItemParser& aItem )
478 typedef istreambuf_iterator<char,char_traits<char> >
482 string buffer("$100.02");
484 // long double ldest;
485 // ios_base::iostate state;
489 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
491 // Get a money_get facet
492 const money_get<char,iter_type>& mgf = use_facet<money_get<char,iter_type> >(loc);
495 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
517 // -----------------------------------------------------------------------------
518 // Ctlocale::money_put
519 // money_put test method function.
521 // -----------------------------------------------------------------------------
523 TInt Ctlocale::moneyput( CStifItemParser& aItem )
531 typedef ostreambuf_iterator<char,char_traits<char> >
535 string buffer("10002");
536 // long double ldval = 10002;
538 iter_type begin(cout);
541 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
543 const money_put<char,iter_type>& mp = use_facet<money_put<char,iter_type> >(loc);
546 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
570 // -----------------------------------------------------------------------------
571 // Ctlocale::moneypunct
572 // moneypunct test method function.
574 // -----------------------------------------------------------------------------
576 TInt Ctlocale::money_punct( CStifItemParser& aItem )
588 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
593 const moneypunct<char,false>& mp = use_facet<moneypunct<char,false> >(loc);
594 const moneypunct<char,true>& mp_true = use_facet<moneypunct<char,true> >(loc);
597 const moneypunct<wchar_t,false>& mp_w = use_facet<moneypunct<wchar_t,false> >(loc);
599 const moneypunct<wchar_t,true>& mp_w_true = use_facet<moneypunct<wchar_t,true> >(loc);
601 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
612 mp_true.curr_symbol();
613 mp_true.negative_sign();
615 mp_true.curr_symbol();
616 mp_true.frac_digits();
617 mp_true.pos_format() ;
618 mp_true.neg_format();
621 mp_w.negative_sign();
629 mp_w_true.curr_symbol();
630 mp_w_true.negative_sign();
631 mp_w_true.grouping();
632 mp_w_true.curr_symbol();
633 mp_w_true.frac_digits();
634 mp_w_true.pos_format() ;
635 mp_w_true.neg_format();
637 /* if(mp.decimal_point() == '.')
638 if(mp.thousands_sep() == ',')
639 if( mp.frac_digits() == 0)
646 return KErrGeneral;*/
648 if(mp.decimal_point() != '.')
650 if(mp.thousands_sep() != ',')
652 if( mp.frac_digits() != 0)
656 if(mp_true.decimal_point() != '.')
658 if(mp_true.thousands_sep() != ',')
660 if( mp_true.frac_digits() != 0)
666 if(mp_w.decimal_point() != L'.')
668 if(mp_w.thousands_sep() != L',')
670 if( mp_w.frac_digits() != 0)
674 if(mp_w_true.decimal_point() != L'.')
676 if(mp_w_true.thousands_sep() != L',')
678 if( mp_w_true.frac_digits() != 0)
700 // -----------------------------------------------------------------------------
701 // Ctlocale::moneypunct_byname
702 // moneypunct_byname test method function.
704 // -----------------------------------------------------------------------------
707 TInt Ctlocale::moneypunctbyname( CStifItemParser& aItem )
720 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
722 const moneypunct_byname<char,false>& mp =
724 use_facet<moneypunct_byname<char,false> >(loc);
726 const moneypunct_byname<char,true>& mp_true =
728 use_facet<moneypunct_byname<char,true> >(loc);
731 const moneypunct_byname<wchar_t,false>& mp_w =
733 use_facet<moneypunct_byname<wchar_t,false> >(loc);
737 const moneypunct_byname<wchar_t,true>& mp_w_true =
739 use_facet<moneypunct_byname<wchar_t,true> >(loc);
743 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
748 if(mp.decimal_point() != '.')
750 if(mp.thousands_sep() != ',')
752 if( mp.frac_digits() != 0)
756 mp_true.curr_symbol();
757 mp_true.negative_sign();
758 if(mp_true.decimal_point() != '.')
760 if(mp_true.thousands_sep() != ',')
762 if( mp_true.frac_digits() != 0)
767 mp_w.negative_sign();
768 if(mp_w.decimal_point() != L'.')
770 if(mp_w.thousands_sep() != L',')
772 if( mp_w.frac_digits() != 0)
776 mp_w_true.curr_symbol();
777 mp_w_true.negative_sign();
778 if(mp_w_true.decimal_point() != L'.')
780 if(mp_w_true.thousands_sep() != L',')
782 if( mp_w_true.frac_digits() != 0)
803 // -----------------------------------------------------------------------------
804 // Ctlocale::time_get
805 // time_get test method function.
807 // -----------------------------------------------------------------------------
811 TInt Ctlocale::timeget( CStifItemParser& aItem )
819 typedef std::istreambuf_iterator<char,
820 std::char_traits<char> > Iter;
821 // static struct tm timeb;
822 // std::ios_base::iostate state;
825 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
827 const std::time_get<char, Iter> &tg =
828 std::use_facet<std::time_get<char, Iter> >(std::locale ("C"));
830 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
852 // -----------------------------------------------------------------------------
853 // Ctlocale::time_put
854 // time_put test method function.
856 // -----------------------------------------------------------------------------
858 TInt Ctlocale::timeput( CStifItemParser& aItem )
866 /* std::tm t = std::tm ();
879 const char* const fmt[] = {
880 "%a", "%A", "%b", "%B", "%c", "%C", "%d", "%D",
881 "%e", "%F", "%g", "%G", "%h", "%H", "%I", "%j",
882 "%k", "%l", "%m", "%M", "%n", "%p", "%r", "%R",
883 "%S", "%t", "%T", "%u", "%U", "%V", "%w", "%W", "%x",
884 "%X", "%y", "%Y", "%z", "%Z", "%%", "%Ec", "%EC", "%Ex",
885 "%EX", "%Ey", "%EY", "%Od", "%Oe", "%OH", "%OI", "%Om",
886 "%OM", "%OS", "%Ou", "%OU", "%OV", "%Ow", "%OW", "%Oy"
890 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
892 const std::time_put<char> &tput =
893 std::use_facet<std::time_put<char> >(std::cout.getloc ());
896 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
919 // -----------------------------------------------------------------------------
920 // Ctlocale::messages
921 // messages test method function.
923 // -----------------------------------------------------------------------------
926 TInt Ctlocale::messagesL( CStifItemParser& aItem )
937 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
939 const messages<char>& mess =use_facet<messages<char> >(loc);
941 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
943 // no support to .cat files
946 string def("Message Not Found");
947 messages<char>::catalog cat =
948 mess.open("./rwstdmessages.cat",loc);
951 string msg0 = mess.get(cat,1,1,def);
952 string msg1 = mess.get(cat,1,2,def);
953 string msg2 = mess.get(cat,1,6,def); // invalid msg #
954 string msg3 = mess.get(cat,2,1,def);
957 cout << msg0 << endl << msg1 << endl
958 << msg2 << endl << msg3 << endl;
961 cout << "Unable to open message catalog" << endl;*/
984 // -----------------------------------------------------------------------------
985 // Ctlocale::messages_byname
986 // messages_byname test method function.
988 // -----------------------------------------------------------------------------
990 TInt Ctlocale::messagesbyname( CStifItemParser& aItem )
1001 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1003 const messages_byname<char>& mess =
1005 use_facet<messages_byname<char> >(loc);
1007 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1010 // no support to .cat files
1012 string def("Message Not Found");
1013 messages_byname<char>::catalog cat =
1014 mess.open("./rwstdmessages.cat",loc);
1017 string msg0 = mess.get(cat,1,1,def);
1018 string msg1 = mess.get(cat,1,2,def);
1019 string msg2 = mess.get(cat,1,6,def); // invalid msg #
1020 string msg3 = mess.get(cat,2,1,def);
1023 cout << msg0 << endl << msg1 << endl
1024 << msg2 << endl << msg3 << endl;
1027 cout << "Unable to open message catalog" << endl;*/
1048 // -----------------------------------------------------------------------------
1049 // Ctlocale::collate
1050 // collate test method function.
1052 // -----------------------------------------------------------------------------
1054 TInt Ctlocale::collateL( CStifItemParser& aItem )
1064 wstring ws1(L"blue");
1065 wstring ws2(L"blues");
1068 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1070 const collate<char>& co =
1071 use_facet<collate<char> >(loc);
1074 const collate<wchar_t>& w_co =
1075 use_facet<collate<wchar_t> >(loc); //wchar
1077 if( co.compare(s1.begin(),s1.end(),s2.begin(),s2.end()-1) != 0)
1080 if( co.compare(s1.begin(),s1.end(), s2.begin(),s2.end()) != -1)
1083 // Retrieve hash values for two strings
1084 if( co.hash(s1.begin(),s1.end())!= 15636)
1089 if( w_co.compare(ws1.begin(),ws1.end(),ws2.begin(),ws2.end()-1) != 0)
1092 if( w_co.compare(ws1.begin(),ws1.end(), ws2.begin(),ws2.end()) != -1)
1095 // Retrieve hash values for two strings
1096 if( w_co.hash(ws1.begin(),ws1.end())!= 15636)
1099 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1122 // -----------------------------------------------------------------------------
1123 // Ctlocale::collatebyname
1124 // collatebyname test method function.
1126 // -----------------------------------------------------------------------------
1128 TInt Ctlocale::collatebyname( CStifItemParser& aItem )
1139 wstring ws1(L"blue");
1140 wstring ws2(L"blues");
1143 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1145 const collate_byname<char>& co = use_facet<collate_byname<char> >(loc);
1146 const collate_byname<wchar_t>& w_co = use_facet<collate_byname<wchar_t> >(loc);
1148 if( co.compare(s1.begin(),s1.end(),s2.begin(),s2.end()-1) != 0)
1151 if( co.compare(s1.begin(),s1.end(), s2.begin(),s2.end()) != -1)
1154 // Retrieve hash values for two strings
1155 if( co.hash(s1.begin(),s1.end())!= 15636)
1160 if( w_co.compare(ws1.begin(),ws1.end(),ws2.begin(),ws2.end()-1) != 0)
1163 if( w_co.compare(ws1.begin(),ws1.end(), ws2.begin(),ws2.end()) != -1)
1166 // Retrieve hash values for two strings
1167 if( w_co.hash(ws1.begin(),ws1.end())!= 15636)
1170 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1197 // -----------------------------------------------------------------------------
1198 // Ctlocale::codecvt1
1199 // codecvt1 test method function.
1201 // -----------------------------------------------------------------------------
1204 TInt Ctlocale::codecvt1( CStifItemParser& aItem )
1206 /* locale loc ( "de_DE.ISO-8859-15" );
1212 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1214 int result = use_facet<codecvt<char, char, mbstate_t> > ( loc ).encoding ();
1221 char* str = "This is the string whose length is to be measured!";
1222 mbstate_t state = {0};
1223 locale loc1("C");//English_Britain");//German_Germany
1224 //int res = use_facet<codecvt<wchar_t, char, mbstate_t>>( loc ).length( state,str, &str[strlen(str)], 90 );
1227 int res = use_facet<codecvt<wchar_t, char, mbstate_t> >
1228 ( loc1 ).length( state,str, &str[strlen(str)], 90 );
1237 locale loc2( "C");//English_Britain" );//German_Germany
1238 int res2 = use_facet<codecvt<char, char, mbstate_t> >
1239 ( loc ).max_length( );
1245 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1262 return KErrGeneral;*/
1266 // -----------------------------------------------------------------------------
1267 // Ctlocale::codecvt2
1268 // codecvt2 test method function.
1270 // -----------------------------------------------------------------------------
1272 TInt Ctlocale::codecvt2( CStifItemParser& aItem )
1280 wchar_t *strin = L"This is the wchar_t string to be converted.";
1281 memset( &strout[0], 0, ( sizeof( char ) )*( 91 ) );
1283 const wchar_t* pwszNext;
1288 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1290 int res = use_facet<codecvt<wchar_t, char, mbstate_t> >
1291 ( loc ).out( state,strin, &strin[wcslen( strin )], pwszNext ,
1292 strout, &strout[wcslen( strin )], strnext );
1294 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1296 strout[wcslen( strin )] = 0;
1298 string str = "This is the wchar_t string to be converted.";
1300 /*if(str.compare(&strout[0]) == 0)
1307 if(str.compare(&strout[0]) != 0)
1331 // -----------------------------------------------------------------------------
1332 // Ctlocale::codecvtbyname1
1333 // codecvtbyname1 test method function.
1335 // -----------------------------------------------------------------------------
1338 TInt Ctlocale::codecvtbyname1( CStifItemParser& aItem )
1340 /* locale loc ( "de_DE.ISO-8859-15" );
1346 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1348 int result = use_facet<codecvt_byname<char, char, mbstate_t> > ( loc ).encoding ();
1350 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1356 char* str = "This is the string whose length is to be measured!";
1357 mbstate_t state = {0};
1361 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1363 int res = use_facet<codecvt_byname<wchar_t, char, mbstate_t> >
1364 ( loc1 ).length( state,str, &str[strlen(str)], 90 );
1367 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1377 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1379 int res2 = use_facet<codecvt_byname<char, char, mbstate_t> >( loc ).max_length( );
1381 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1401 return KErrGeneral;*/
1406 // -----------------------------------------------------------------------------
1407 // Ctlocale::codecvtbyname2
1408 // codecvtbyname2 test method function.
1410 // -----------------------------------------------------------------------------
1412 TInt Ctlocale::codecvtbyname2( CStifItemParser& aItem )
1419 char* strout = "This is the string to be converted!";
1421 memset(&strin[0], 0, (sizeof(wchar_t))*(91));
1422 const char* pszNext;
1424 mbstate_t state = {0};
1428 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1430 int res = use_facet<codecvt<wchar_t, char, mbstate_t> >
1431 ( loc ).in( state, strout, &strout[strlen(strout)], pszNext,
1432 strin, &strin[strlen(strout)], pwszNext );
1434 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1436 strin[strlen(strout)] = 0;
1438 wstring str = L"This is the string to be converted!";
1441 if(str.compare(&strin[0]) == 0)
1447 if(str.compare(&strin[0]) != 0)
1471 TInt Ctlocale::catalog(CStifItemParser& aItem )
1483 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1486 /* const char* _Loc_ctype_default(p);
1487 const char* _Loc_numeric_default(p) ;
1488 const char* _Loc_time_default(p) ;
1489 const char* _Loc_collate_default(p) ;
1490 const char* _Loc_monetary_default(p) ;
1491 const char* _Loc_messages_default(p) ;*/
1493 /* locale::category c;
1495 const char* name1 = "catalog";
1496 const char* name2="test";*/
1499 const locale& L1= 0;
1500 const locale& L2= 0;
1501 // const char* name = "testing";
1502 // void _Stl_loc_combine_names(L,name1,name2,c);
1503 //locale::locale(const locale& L1, const locale& L2, category c)
1504 //locale::category c;
1508 //locale loc1(L1,name,c);
1509 //locale loc(L1,L2,c);
1513 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1547 TInt Ctlocale::c_type(CStifItemParser& aItem )
1559 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1564 locale loc1 ( "C" );
1566 char *string = "Hello, my name is John!";
1567 // wchar_t *wstring = L"Hello, my name is John!";
1569 const char* i = use_facet<ctype<char> > ( loc1 ).scan_is ( ctype_base::punct, &string[0], &string[strlen(&string[0])-1] );
1570 // const wchar_t* wi = use_facet<ctype<wchar_t> > ( loc1 ).scan_is ( ctype_base::punct, &wstring[0], &wstring[strlen(&wstring[0])-1] );
1571 const char* j = use_facet<ctype<char> > ( loc1 ).scan_not( ctype_base::alpha, &string[0], &string[strlen(&string[0])-1] );
1584 char string2[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
1585 wchar_t wstring2[] = L"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
1586 char to_lower = 'a';
1587 wchar_t wto_lower = L'a';
1589 use_facet<ctype<char> > ( loc1 ).tolower( &string2[0], &string2[strlen(&string2[0])] );
1590 use_facet<ctype<wchar_t> > ( loc1 ).tolower( &wstring2[0], &wstring2[27] );
1592 use_facet<ctype<char> > ( loc1 ).tolower(to_lower);
1593 use_facet<ctype<wchar_t> > ( loc1 ).tolower(wto_lower);
1597 char string3[] = "abcdefghijklmnopqrstuvwxyz";
1598 wchar_t wstring3[] = L"abcdefghijklmnopqrstuvwxyz";
1599 char to_upper = 'A';
1601 wchar_t wto_upper = L'A';
1606 use_facet<ctype<char> > ( loc1 ).toupper( &string3[0], &string3[strlen(&string3[0])] );
1607 use_facet<ctype<wchar_t> > ( loc1 ).toupper( &wstring3[0], &wstring3[27] );
1609 use_facet<ctype<char> > ( loc1 ).toupper(to_upper);
1610 use_facet<ctype<wchar_t> > ( loc1 ).toupper(wto_upper);
1614 bool result1 = (use_facet<ctype<wchar_t> > ( loc1 ).narrow
1615 (wstring3, wstring3 + wcslen(wstring3), 'X', &str2[0] ) != 0);
1617 bool result2 = (use_facet<ctype<char> > ( loc1 ).narrow
1618 (string3, string3 + strlen(string3), 'X', &str2[0] ) != 0);
1620 const ctype_base::mask* _get_classic_table();
1621 const unsigned char* _get_S_upper_table();
1622 const unsigned char* _get_S_lower_table();
1623 void Dummy_API(void);
1624 // ctype::narrow(to_upper,test);
1626 //char ctype<char>::do_narrow(char __c, char /* dfault */ )
1628 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);