Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright (c) 1999 |
michael@0 | 3 | * Silicon Graphics Computer Systems, Inc. |
michael@0 | 4 | * |
michael@0 | 5 | * Copyright (c) 1999 |
michael@0 | 6 | * Boris Fomitchev |
michael@0 | 7 | * |
michael@0 | 8 | * This material is provided "as is", with absolutely no warranty expressed |
michael@0 | 9 | * or implied. Any use is at your own risk. |
michael@0 | 10 | * |
michael@0 | 11 | * Permission to use or copy this software for any purpose is hereby granted |
michael@0 | 12 | * without fee, provided the above notices are retained on all copies. |
michael@0 | 13 | * Permission to modify the code and to distribute modified code is granted, |
michael@0 | 14 | * provided the above notices are retained, and a notice that the code was |
michael@0 | 15 | * modified is included with the above copyright notice. |
michael@0 | 16 | * |
michael@0 | 17 | */ |
michael@0 | 18 | #include "stlport_prefix.h" |
michael@0 | 19 | |
michael@0 | 20 | #include <locale> |
michael@0 | 21 | #include <istream> |
michael@0 | 22 | |
michael@0 | 23 | _STLP_BEGIN_NAMESPACE |
michael@0 | 24 | |
michael@0 | 25 | static void _Init_monetary_formats(money_base::pattern& pos_format, |
michael@0 | 26 | money_base::pattern& neg_format) { |
michael@0 | 27 | pos_format.field[0] = (char) money_base::symbol; |
michael@0 | 28 | pos_format.field[1] = (char) money_base::sign; |
michael@0 | 29 | pos_format.field[2] = (char) money_base::none; |
michael@0 | 30 | pos_format.field[3] = (char) money_base::value; |
michael@0 | 31 | |
michael@0 | 32 | neg_format.field[0] = (char) money_base::symbol; |
michael@0 | 33 | neg_format.field[1] = (char) money_base::sign; |
michael@0 | 34 | neg_format.field[2] = (char) money_base::none; |
michael@0 | 35 | neg_format.field[3] = (char) money_base::value; |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | // This is being used throughout the library |
michael@0 | 39 | static const char _S_empty_string[] = ""; |
michael@0 | 40 | #ifndef _STLP_NO_WCHAR_T |
michael@0 | 41 | static const wchar_t _S_empty_wstring[] = L""; |
michael@0 | 42 | #endif |
michael@0 | 43 | |
michael@0 | 44 | // |
michael@0 | 45 | // moneypunct<> |
michael@0 | 46 | // |
michael@0 | 47 | |
michael@0 | 48 | moneypunct<char, true>::moneypunct(size_t __refs) : locale::facet(__refs) |
michael@0 | 49 | { _Init_monetary_formats(_M_pos_format, _M_neg_format); } |
michael@0 | 50 | moneypunct<char, true>::~moneypunct() {} |
michael@0 | 51 | |
michael@0 | 52 | char moneypunct<char, true>::do_decimal_point() const {return ' ';} |
michael@0 | 53 | char moneypunct<char, true>::do_thousands_sep() const {return ' ';} |
michael@0 | 54 | string moneypunct<char, true>::do_grouping() const { return _S_empty_string; } |
michael@0 | 55 | string moneypunct<char, true>::do_curr_symbol() const { return _S_empty_string; } |
michael@0 | 56 | string moneypunct<char, true>::do_positive_sign() const { return _S_empty_string; } |
michael@0 | 57 | string moneypunct<char, true>::do_negative_sign() const { return _S_empty_string; } |
michael@0 | 58 | money_base::pattern moneypunct<char, true>::do_pos_format() const {return _M_pos_format;} |
michael@0 | 59 | money_base::pattern moneypunct<char, true>::do_neg_format() const {return _M_neg_format;} |
michael@0 | 60 | int moneypunct<char, true>::do_frac_digits() const {return 0;} |
michael@0 | 61 | |
michael@0 | 62 | moneypunct<char, false>::moneypunct(size_t __refs) : locale::facet(__refs) |
michael@0 | 63 | { _Init_monetary_formats(_M_pos_format, _M_neg_format); } |
michael@0 | 64 | moneypunct<char, false>::~moneypunct() {} |
michael@0 | 65 | |
michael@0 | 66 | char moneypunct<char, false>::do_decimal_point() const {return ' ';} |
michael@0 | 67 | char moneypunct<char, false>::do_thousands_sep() const {return ' ';} |
michael@0 | 68 | |
michael@0 | 69 | string moneypunct<char, false>::do_grouping() const { return _S_empty_string; } |
michael@0 | 70 | string moneypunct<char, false>::do_curr_symbol() const { return _S_empty_string; } |
michael@0 | 71 | string moneypunct<char, false>::do_positive_sign() const { return _S_empty_string; } |
michael@0 | 72 | string moneypunct<char, false>::do_negative_sign() const { return _S_empty_string; } |
michael@0 | 73 | money_base::pattern moneypunct<char, false>::do_pos_format() const {return _M_pos_format;} |
michael@0 | 74 | money_base::pattern moneypunct<char, false>::do_neg_format() const {return _M_neg_format;} |
michael@0 | 75 | int moneypunct<char, false>::do_frac_digits() const {return 0;} |
michael@0 | 76 | |
michael@0 | 77 | #ifndef _STLP_NO_WCHAR_T |
michael@0 | 78 | moneypunct<wchar_t, true>::moneypunct(size_t __refs) : locale::facet(__refs) |
michael@0 | 79 | { _Init_monetary_formats(_M_pos_format, _M_neg_format); } |
michael@0 | 80 | moneypunct<wchar_t, true>::~moneypunct() {} |
michael@0 | 81 | |
michael@0 | 82 | wchar_t moneypunct<wchar_t, true>::do_decimal_point() const {return L' ';} |
michael@0 | 83 | wchar_t moneypunct<wchar_t, true>::do_thousands_sep() const {return L' ';} |
michael@0 | 84 | string moneypunct<wchar_t, true>::do_grouping() const {return _S_empty_string;} |
michael@0 | 85 | |
michael@0 | 86 | wstring moneypunct<wchar_t, true>::do_curr_symbol() const |
michael@0 | 87 | {return _S_empty_wstring;} |
michael@0 | 88 | wstring moneypunct<wchar_t, true>::do_positive_sign() const |
michael@0 | 89 | {return _S_empty_wstring;} |
michael@0 | 90 | wstring moneypunct<wchar_t, true>::do_negative_sign() const |
michael@0 | 91 | {return _S_empty_wstring;} |
michael@0 | 92 | int moneypunct<wchar_t, true>::do_frac_digits() const {return 0;} |
michael@0 | 93 | money_base::pattern moneypunct<wchar_t, true>::do_pos_format() const |
michael@0 | 94 | {return _M_pos_format;} |
michael@0 | 95 | money_base::pattern moneypunct<wchar_t, true>::do_neg_format() const |
michael@0 | 96 | {return _M_neg_format;} |
michael@0 | 97 | |
michael@0 | 98 | moneypunct<wchar_t, false>::moneypunct(size_t __refs) : locale::facet(__refs) |
michael@0 | 99 | { _Init_monetary_formats(_M_pos_format, _M_neg_format); } |
michael@0 | 100 | moneypunct<wchar_t, false>::~moneypunct() {} |
michael@0 | 101 | |
michael@0 | 102 | wchar_t moneypunct<wchar_t, false>::do_decimal_point() const {return L' ';} |
michael@0 | 103 | wchar_t moneypunct<wchar_t, false>::do_thousands_sep() const {return L' ';} |
michael@0 | 104 | string moneypunct<wchar_t, false>::do_grouping() const { return _S_empty_string;} |
michael@0 | 105 | wstring moneypunct<wchar_t, false>::do_curr_symbol() const |
michael@0 | 106 | {return _S_empty_wstring;} |
michael@0 | 107 | wstring moneypunct<wchar_t, false>::do_positive_sign() const |
michael@0 | 108 | {return _S_empty_wstring;} |
michael@0 | 109 | wstring moneypunct<wchar_t, false>::do_negative_sign() const |
michael@0 | 110 | {return _S_empty_wstring;} |
michael@0 | 111 | int moneypunct<wchar_t, false>::do_frac_digits() const {return 0;} |
michael@0 | 112 | |
michael@0 | 113 | money_base::pattern moneypunct<wchar_t, false>::do_pos_format() const |
michael@0 | 114 | {return _M_pos_format;} |
michael@0 | 115 | money_base::pattern moneypunct<wchar_t, false>::do_neg_format() const |
michael@0 | 116 | {return _M_neg_format;} |
michael@0 | 117 | |
michael@0 | 118 | #endif /* WCHAR_T */ |
michael@0 | 119 | |
michael@0 | 120 | // |
michael@0 | 121 | // Instantiations |
michael@0 | 122 | // |
michael@0 | 123 | |
michael@0 | 124 | #if !defined (_STLP_NO_FORCE_INSTANTIATE) |
michael@0 | 125 | |
michael@0 | 126 | template class _STLP_CLASS_DECLSPEC money_get<char, istreambuf_iterator<char, char_traits<char> > >; |
michael@0 | 127 | template class _STLP_CLASS_DECLSPEC money_put<char, ostreambuf_iterator<char, char_traits<char> > >; |
michael@0 | 128 | // template class money_put<char, char*>; |
michael@0 | 129 | |
michael@0 | 130 | # ifndef _STLP_NO_WCHAR_T |
michael@0 | 131 | template class _STLP_CLASS_DECLSPEC money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >; |
michael@0 | 132 | template class _STLP_CLASS_DECLSPEC money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >; |
michael@0 | 133 | // template class money_put<wchar_t, wchar_t*>; |
michael@0 | 134 | // template class money_get<wchar_t, const wchar_t*>; |
michael@0 | 135 | # endif |
michael@0 | 136 | |
michael@0 | 137 | #endif |
michael@0 | 138 | |
michael@0 | 139 | #if !defined (_STLP_STATIC_CONST_INIT_BUG) && !defined (_STLP_NO_STATIC_CONST_DEFINITION) |
michael@0 | 140 | const bool moneypunct<char, true>::intl; |
michael@0 | 141 | const bool moneypunct<char, false>::intl; |
michael@0 | 142 | # ifndef _STLP_NO_WCHAR_T |
michael@0 | 143 | const bool moneypunct<wchar_t, true>::intl; |
michael@0 | 144 | const bool moneypunct<wchar_t, false>::intl; |
michael@0 | 145 | # endif |
michael@0 | 146 | #endif |
michael@0 | 147 | |
michael@0 | 148 | _STLP_END_NAMESPACE |
michael@0 | 149 | |
michael@0 | 150 | // Local Variables: |
michael@0 | 151 | // mode:C++ |
michael@0 | 152 | // End: |