std::moneypunct
來自 cppreference.com
定義於標頭檔案 <locale> |
||
template< class CharT, bool International = false > class moneypunct; |
||
std::moneypunct
facet 封裝了貨幣值格式偏好。流 I/O 操縱器 std::get_money 和 std::put_money 透過 std::money_get 和 std::money_put 使用 std::moneypunct
來解析貨幣值輸入和格式化貨幣值輸出。
繼承圖
目錄 |
[edit] 特化
標準庫保證提供以下特化(它們 要求由任何區域設定物件實現)
定義於標頭檔案
<locale> | |
std::moneypunct<char> | 提供“C”語言環境偏好的等價物 |
std::moneypunct<wchar_t> | 提供“C”語言環境偏好的寬字元等價物 |
std::moneypunct<char, true> | 提供“C”語言環境偏好的等價物,帶有國際貨幣符號 |
std::moneypunct<wchar_t, true> | 提供“C”語言環境偏好的寬字元等價物,帶有國際貨幣符號 |
[edit] 巢狀型別
型別 | 定義 |
char_type
|
CharT
|
string_type
|
std::basic_string<CharT> |
[edit] 資料成員
成員 | 描述 |
std::locale::id id [static] |
facet 的識別符號 |
const bool intl [static] |
International |
[edit] 成員函式
構造一個新的 moneypunct facet(public member function) | |
呼叫 do_decimal_point (public member function) | |
呼叫 do_thousands_sep (public member function) | |
呼叫 do_grouping (public member function) | |
呼叫 do_curr_symbol (public member function) | |
呼叫 do_positive_sign 或 do_negative_sign (public member function) | |
呼叫 do_frac_digits (public member function) | |
呼叫 do_pos_format /do_neg_format (public member function) |
[edit] 受保護成員函式
銷燬 moneypunct facet(protected member function) | |
[virtual] |
提供用作小數點的字元 (virtual protected member function) |
[virtual] |
提供用作千位分隔符的字元 (virtual protected member function) |
[virtual] |
提供每對千位分隔符之間的數字個數 (virtual protected member function) |
[virtual] |
提供用作貨幣識別符號的字串 (virtual protected member function) |
[virtual] |
提供指示正值或負值的字串 (virtual protected member function) |
[virtual] |
提供小數點後顯示的位數 (virtual protected member function) |
[virtual] |
提供貨幣值的格式模式 (virtual protected member function) |
繼承自 std::money_base
巢狀型別
型別 | 定義 |
enum part { none, space, symbol, sign, value }; | 非限定列舉型別 |
struct pattern { char field[4]; }; | 貨幣格式型別 |
列舉常量 | 描述 |
無
|
允許但不強制要求空格,除了在最後一個位置,該位置不允許有空格 |
space
|
需要一個或多個空格字元 |
symbol
|
需要 std::moneypunct::curr_symbol 返回的字元序列 |
sign
|
需要 std::moneypunct::positive_sign 或 std::moneypunct::negative_sign 返回的字元中的第一個 |
value
|
需要絕對的數字貨幣值 |
[edit] 另請參閱
定義貨幣格式模式 (class) | |
表示命名語言環境的系統提供的 std::moneypunct (class template) | |
從輸入字元序列解析和構造貨幣值 (class template) | |
將貨幣值格式化為字元序列輸出 (class template) |