stdcpp/src/numpunct.cpp
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /*
       
     2  * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
       
     3  *
       
     4  * Copyright (c) 1999
       
     5  * Silicon Graphics Computer Systems, Inc.
       
     6  *
       
     7  * Copyright (c) 1999 
       
     8  * Boris Fomitchev
       
     9  *
       
    10  * This material is provided "as is", with absolutely no warranty expressed
       
    11  * or implied. Any use is at your own risk.
       
    12  *
       
    13  * Permission to use or copy this software for any purpose is hereby granted 
       
    14  * without fee, provided the above notices are retained on all copies.
       
    15  * Permission to modify the code and to distribute modified code is granted,
       
    16  * provided the above notices are retained, and a notice that the code was
       
    17  * modified is included with the above copyright notice.
       
    18  *
       
    19  */ 
       
    20 # include "stlport_prefix.h"
       
    21 # include <stl/_numpunct.h>
       
    22 
       
    23 #if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
       
    24 #include "libstdcppwsd.h"
       
    25 # endif
       
    26 
       
    27 _STLP_BEGIN_NAMESPACE
       
    28 
       
    29 //----------------------------------------------------------------------
       
    30 // numpunct<char>
       
    31 # if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
       
    32 _STLP_STATIC_MEMBER_EXP_DECLSPEC  string numpunct<char>::_M_truename("true");
       
    33 _STLP_STATIC_MEMBER_EXP_DECLSPEC  string  numpunct<char>::_M_falsename("false");
       
    34 _STLP_STATIC_MEMBER_EXP_DECLSPEC  string numpunct<char>::_M_grouping("");
       
    35 # endif
       
    36 
       
    37 _STLP_EXP_DECLSPEC char   numpunct<char>::do_decimal_point() const {return '.';}
       
    38 _STLP_EXP_DECLSPEC char   numpunct<char>::do_thousands_sep() const { return ','; }
       
    39 _STLP_EXP_DECLSPEC string numpunct<char>::do_grouping()  const { return string();}
       
    40 
       
    41 #if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
       
    42 _STLP_EXP_DECLSPEC  string numpunct<char>::do_truename()  const { return GetNumPunct_M_truename();}
       
    43 _STLP_EXP_DECLSPEC  string numpunct<char>::do_falsename() const { return GetNumPunct_M_falsename(); }
       
    44 # else
       
    45 string numpunct<char>::do_truename()  const { return _M_truename;}
       
    46 string numpunct<char>::do_falsename() const { return _M_falsename; }
       
    47 # endif
       
    48 
       
    49 #if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
       
    50 void numpunct_name_init()
       
    51 {	
       
    52 	numpunct<char>::GetNumPunct_M_truename() = "true";	
       
    53 	numpunct<char>::GetNumPunct_M_falsename() = "false";
       
    54 # ifndef _STLP_NO_WCHAR_T	
       
    55 	numpunct<wchar_t>::GetNumPunct_M_Wchar_truename() = L"true";
       
    56 	numpunct<wchar_t>::GetNumPunct_M_Wchar_falsename() = L"false";
       
    57 # endif	
       
    58 }
       
    59 # endif
       
    60 
       
    61 
       
    62 # ifndef _STLP_NO_WCHAR_T
       
    63 
       
    64 _STLP_EXP_DECLSPEC  wchar_t numpunct<wchar_t>::do_decimal_point() const { return L'.'; }
       
    65 
       
    66 _STLP_EXP_DECLSPEC wchar_t numpunct<wchar_t>::do_thousands_sep() const
       
    67 {
       
    68   return L',';
       
    69 }
       
    70 
       
    71 _STLP_EXP_DECLSPEC string numpunct<wchar_t>::do_grouping() const
       
    72 {
       
    73   return string();
       
    74 }
       
    75 
       
    76 _STLP_EXP_DECLSPEC wstring numpunct<wchar_t>::do_truename() const
       
    77 {
       
    78   return GetNumPunct_M_Wchar_truename();
       
    79 }
       
    80  
       
    81 _STLP_EXP_DECLSPEC wstring numpunct<wchar_t>::do_falsename() const
       
    82 {
       
    83   return GetNumPunct_M_Wchar_falsename();
       
    84 } 
       
    85 
       
    86 # if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
       
    87 _STLP_STATIC_MEMBER_EXP_DECLSPEC  wstring numpunct<wchar_t>::_M_truename(L"true");
       
    88 _STLP_STATIC_MEMBER_EXP_DECLSPEC  wstring numpunct<wchar_t>::_M_falsename(L"false");
       
    89 _STLP_STATIC_MEMBER_EXP_DECLSPEC  string numpunct<wchar_t>::_M_grouping("");
       
    90 #endif
       
    91 
       
    92 # endif
       
    93 
       
    94 #ifdef	__SYMBIAN32__
       
    95 
       
    96 _Locale_numeric* __acquire_numeric(const char* name); 
       
    97 void __release_numeric(_Locale_numeric* cat);
       
    98 
       
    99 _STLP_EXP_DECLSPEC _Locale_numeric* __acquire_numericE(const char* name){return __acquire_numeric(name); }
       
   100 _STLP_EXP_DECLSPEC void __release_numericE(_Locale_numeric* _M_numeric){ __release_numeric(_M_numeric);}
       
   101 _STLP_EXP_DECLSPEC const char* _Locale_trueE(_Locale_numeric* _M_numeric){ return _Locale_true(_M_numeric);}
       
   102 _STLP_EXP_DECLSPEC const char* _Locale_falseE(_Locale_numeric* _M_numeric){ return _Locale_false(_M_numeric); }
       
   103 _STLP_EXP_DECLSPEC char _Locale_decimal_pointE(_Locale_numeric* _M_numeric){return _Locale_decimal_point(_M_numeric); }
       
   104 _STLP_EXP_DECLSPEC char _Locale_thousands_sepE(_Locale_numeric* _M_numeric){return _Locale_thousands_sep(_M_numeric); }
       
   105 _STLP_EXP_DECLSPEC const char*_Locale_groupingE(_Locale_numeric* _M_numeric){return _Locale_grouping(_M_numeric); }
       
   106 
       
   107 
       
   108 #endif//__SYMBIAN32
       
   109 _STLP_END_NAMESPACE
       
   110 
       
   111 // Local Variables:
       
   112 // mode:C++
       
   113 // End:
       
   114