名稱空間
變體
操作

std::moneypunct

來自 cppreference.com
< cpp‎ | locale
 
 
 
 
 
定義於標頭檔案 <locale>
template< class CharT, bool International = false >
class moneypunct;

std::moneypunct facet 封裝了貨幣值格式偏好。流 I/O 操縱器 std::get_moneystd::put_money 透過 std::money_getstd::money_put 使用 std::moneypunct 來解析貨幣值輸入和格式化貨幣值輸出。

cpp/locale/money basecpp/locale/locale/facetstd-moneypunct-inheritance.svg

繼承圖

目錄

[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) [edit]
呼叫 do_decimal_point
(public member function) [edit]
呼叫 do_thousands_sep
(public member function) [edit]
呼叫 do_grouping
(public member function) [edit]
呼叫 do_curr_symbol
(public member function) [edit]
呼叫 do_positive_signdo_negative_sign
(public member function) [edit]
呼叫 do_frac_digits
(public member function) [edit]
呼叫 do_pos_format/do_neg_format
(public member function) [edit]

[edit] 受保護成員函式

銷燬 moneypunct facet
(protected member function) [edit]
提供用作小數點的字元
(virtual protected member function) [edit]
提供用作千位分隔符的字元
(virtual protected member function) [edit]
[virtual]
提供每對千位分隔符之間的數字個數
(virtual protected member function) [edit]
提供用作貨幣識別符號的字串
(virtual protected member function) [edit]
提供指示正值或負值的字串
(virtual protected member function) [edit]
提供小數點後顯示的位數
(virtual protected member function) [edit]
提供貨幣值的格式模式
(virtual protected member function) [edit]

繼承自 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_signstd::moneypunct::negative_sign 返回的字元中的第一個
value 需要絕對的數字貨幣值

[edit] 另請參閱

定義貨幣格式模式
(class) [edit]
表示命名語言環境的系統提供的 std::moneypunct
(class template) [edit]
從輸入字元序列解析和構造貨幣值
(class template) [edit]
將貨幣值格式化為字元序列輸出
(class template) [edit]