epoc32/include/stdapis/stlport/stl/_numpunct.c
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 #ifndef _STLP_NUMPUNCT_C
    18 #define _STLP_NUMPUNCT_C
    19 #ifndef _STLP_INTERNAL_NUMPUNCT_H
    20 # include <stl/_numpunct.h>
    21 #endif
    22 
    23 
    24 template<class _CharT>
    25  numpunct<_CharT>::~numpunct() { }
    26 
    27 template<class _CharT>
    28 _CharT numpunct<_CharT>::do_decimal_point() const
    29 {
    30 	return (_CharT)'.'; 
    31 }
    32 
    33 template<class _CharT>
    34  _CharT numpunct<_CharT>::do_thousands_sep() const
    35 {
    36 	return (_CharT)','; 
    37 }
    38 
    39 
    40 template<class _CharT>
    41 string numpunct<_CharT>::do_grouping() const
    42 {
    43 	return _M_grouping;
    44 }
    45 
    46 template<class _CharT>
    47 basic_string<_CharT> numpunct<_CharT>::do_truename() const
    48 {
    49 	return _M_truename;
    50 }
    51 
    52 template<class _CharT>
    53 basic_string<_CharT> numpunct<_CharT>::do_falsename() const
    54 {
    55 	return _M_falsename;
    56 }
    57 
    58 
    59 template<class _CharT>
    60 numpunct_byname<_CharT>::numpunct_byname(const char* name, size_t refs)
    61 	: numpunct<_CharT> (refs),
    62     _M_numeric(__acquire_numericE(name))
    63 {
    64   if (!_M_numeric)
    65     locale::_M_throw_runtime_error();
    66 
    67   const char* truename  = _Locale_trueE(_M_numeric);
    68   const char* falsename = _Locale_falseE(_M_numeric);
    69 	
    70 }
    71 
    72 template<class _CharT>
    73 numpunct_byname<_CharT>::~numpunct_byname()
    74 { 	
    75 	__release_numericE(_M_numeric);
    76 }
    77 
    78 template<class _CharT>
    79 _CharT   numpunct_byname<_CharT>::do_decimal_point() const 
    80 { 
    81 	return (_CharT ) _Locale_decimal_pointE(_M_numeric);
    82 }
    83 template<class _CharT>
    84 _CharT   numpunct_byname<_CharT>::do_thousands_sep() const 
    85 {
    86 	return (_CharT) _Locale_thousands_sepE(_M_numeric); 
    87 }
    88 
    89 template<class _CharT>
    90 string numpunct_byname<_CharT>::do_grouping()      const 
    91 {  
    92 		const char * __grouping = _Locale_groupingE(_M_numeric);
    93   		if (__grouping != NULL && __grouping[0] == CHAR_MAX)
    94     		__grouping = "";
    95 		
    96   		return NULL;
    97 }
    98 
    99 
   100 
   101 
   102 //----------------------------------------------------------------------
   103 
   104 #endif //#ifndef _STLP_NUMPUNCT_C
   105