名前空間
変種
操作

std::messages

提供: cppreference.com
< cpp‎ | locale

 
 
ローカライゼーションライブラリ
ロケールおよびファセット
Original:
Locales and facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
locale
文字分類
Original:
Character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
変換
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ファセットカテゴリの基底クラスです
Original:
Facet category base classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ファセットカテゴリ
Original:
Facet categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ロケール固有のファセット
Original:
Locale-specific facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
コー​​ド変換ファセット
Original:
Code conversion facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
codecvt_utf8(C++11)
codecvt_utf16(C++11)
Cロケール
Original:
C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
std::messages
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
messages::messages
messages::~messages
messages::open
messages::do_open
messages::get
messages::do_get
messages::close
messages::do_close
 
Defined in header <locale>
template< class CharT >
class messages;

Class template std::messages encapsulates retrieval of strings from message catalogs, such as the ones provided by GNU gettext or by POSIX catgets.

cpp/locale/messages basecpp/locale/locale/facetstd-messages-inheritance.svg
画像の詳細

Inheritance diagram

2つの専門分野は、標準ライブラリによって提供されており、C + +プログラムで作成されたすべてのロケール·オブジェクトによって実装されます
Original:
Two specializations are provided by the standard library and are implemented by all locale objects created in a C++ program:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <locale>
std::messages<char> accesses narrow string message catalog
std::messages<wchar_t> accesses wide string message catalog

目次

[編集] メンバータイプ

メンバー·タイプ
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>

[編集] メンバ関数

constructs a new messages facet
(パブリックメンバ関数)
destructs a messages facet
(protectedメンバー関数)
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.

(パブリックメンバ関数) [edit]
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.

(パブリックメンバ関数) [edit]
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.

(パブリックメンバ関数) [edit]

[編集] メンバーオブジェクト

static std::locale::id id
idはロケールの
Original:
id of the locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバオブジェクト)

[編集] メンバ関数を保護しました

[仮想]
という名前のメッセージ·カタログをオープン
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メンバ関数) [edit]
[仮想]
オープンメッセージカタログからメッセージを取得します
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メンバ関数) [edit]
[仮想]
メッセージ·カタログをクローズします
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メンバ関数) [edit]

Inherited from std::messages_base

タイプ
Original:
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 int


[編集]

The following example demonstrated retrieval of messages: on a typical GNU/Linux system it reads from /usr/share/locale/de/LC_MESSAGES/sed.mo

#include <iostream>
#include <locale>
 
int main()
{
    std::locale loc("de_DE.utf8");
    std::cout.imbue(loc);
    auto& facet = std::use_facet<std::messages<char>>(loc);
    auto cat = facet.open("sed", loc);
    if(cat < 0 )
        std::cout << "Could not open german \"sed\" message catalog\n";
    else
        std::cout << "\"No match\" in German: "
                  << facet.get(cat, 0, 0, "No match") << '\n'
                  << "\"Memory exhausted\" in German: "
                  << facet.get(cat, 0, 0, "Memory exhausted") << '\n';
    facet.close(cat);
}

Output:

"No match" in German: Keine Übereinstimmung
"Memory exhausted" in German: Speicher erschöpft

[編集] も参照してください

メッセージカタログの種類を定義します
Original:
defines messages catalog type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(クラステンプレート)
creates a messages facet for the named locale
(クラステンプレート)