std::messages_byname
提供:cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <locale>
|
||
| template< class CharT > class messages_byname : public std::messages<CharT>; |
||
std::messages_bynameその建設時に指定したロケールのメッセージ·カタログからの文字列の取得をカプセルstd::messagesファセットです.
Original:
std::messages_byname is a std::messages facet which encapsulates retrieval of strings from message catalogs of the locale specified at its construction.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
2つの専門分野は、標準ライブラリで提供されています
Original:
Two specializations are provided by the standard library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
| Defined in header
<locale> | |
| std::messages_byname<char> | メッセージカタログへのアクセス/マルチバイト狭い
Original: narrow/multibyte message catalog access The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| std::messages_byname<wchar_t> | ワイド文字列のメッセージ·カタログへのアクセス
Original: wide string message catalog access The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
目次 |
[編集] メンバータイプ
| メンバー·タイプ
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
catalog
|
std::messages_base<CharT>::catalog
|
string_type
|
std::basic_string<CharT>
|
[編集] メンバ関数
| 新しいmessages_bynameファセットを構築します Original: constructs a new messages_byname facet The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
| messages_bynameファセットを破棄します Original: destructs a messages_byname facet The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (メンバー関数を保護しました) | |
Inherited from std::messages
Member types
| メンバー·タイプ
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
char_type
|
charT
|
string_type
|
std::basic_string<charT>
|
Member objects
| メンバー名
Original: Member name The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Type |
id (静的)
|
std::locale::id |
Member functions
do_openを呼び出します Original: invokes do_open The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数of std::messages)
| |
do_getを呼び出します Original: invokes do_get The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数of std::messages)
| |
do_closeを呼び出します Original: invokes do_close The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数of std::messages)
| |
Protected member functions
| [仮想] |
という名前のメッセージ·カタログをオープン Original: opens a named message catalog The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想protectedメンバ関数of std::messages)
|
| [仮想] |
オープンメッセージカタログからメッセージを取得します Original: retrieves a message from an open message catalog The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想protectedメンバ関数of std::messages)
|
| [仮想] |
メッセージ·カタログをクローズします Original: closes a message catalog The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想protectedメンバ関数of std::messages)
|
[編集] 例
#include <iostream> #include <locale> void try_with(const std::locale& loc) { const std::messages<char>& facet = std::use_facet<std::messages<char> >(loc) ; std::messages<char>::catalog cat = facet.open("sed", std::cout.getloc()); if(cat < 0 ) std::cout << "Could not open german \"sed\" message catalog\n"; else std::cout << "\"No match\" " << facet.get(cat, 0, 0, "No match") << '\n' << "\"Memory exhausted\" " << facet.get(cat, 0, 0, "Memory exhausted") << '\n'; facet.close(cat); } int main() { std::locale loc("en_US.utf8"); std::cout.imbue(loc); try_with(std::locale(loc, new std::messages_byname<char>("de_DE.utf8"))); try_with(std::locale(loc, new std::messages_byname<char>("fr_FR.utf8"))); try_with(std::locale(loc, new std::messages_byname<char>("ja_JP.utf8"))); }
Possible output:
"No match" Keine Übereinstimmung "Memory exhausted" Speicher erschöpft "No match" Pas de concordance "Memory exhausted" Mémoire épuisée "No match" 照合しません "Memory exhausted" メモリーが足りません
[編集] も参照してください
| メッセージ·カタログからの文字列の検索を実装しています Original: implements retrieval of strings from message catalogs The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラステンプレート) | |