名前空間
変種
操作

std::locale::locale

提供: cppreference.com
< cpp‎ | locale‎ | 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::locale
メンバータイプ
Original:
Member types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
locale::id
locale::facet
メンバ関数
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.
locale::locale
locale::~locale
locale::operator=
locale::combine
locale::name
locale::operator==
locale::operator!=
locale::operator()
静的メンバ関数
Original:
Static member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
locale::global
locale::classic
 
Defined in header <locale>
locale();
(1)
locale( const locale& other );
(2)
explicit locale( const char* std_name );
(3)
explicit locale( const std::string& std_name );
(4)
locale( const locale& other, const char* std_name, category cat );
(5)
locale( const locale& other, const std::string& std_name, category cat );
(6)
template< class Facet >
locale( const locale& other, Facet* f );
(7)
locale( const locale& other, const locale& one, category cat );
(8)
1)
デフォルトのコンストラクタです。グローバルのコピーを構築し、C + +のロケール(std::locale::globalへの呼び出しが行われていない場合、最近std::locale::classicまたはstd::locale::globalのコピーへの引数として使用されるロケール.
Original:
Default constructor. Constructs a copy of the global C++ locale (that is, the locale most recently used as the argument to std::locale::global or a copy of std::locale::classic if no call to std::locale::global has been made.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
コピーコンストラクタ。otherのコピーを構築されている.
Original:
Copy constructor. Constructs a copy of other.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3-4)
そのようなロケールがオペレーティングシステムでサポートされている場合。、指定std_name(例えば、 "C"または "POSIX"、または "en_US.UTF-8"と、あるいは "English_US.1251"など)でシステムロケールのコピーを作成します。このように構成されたロケールに名前が付けられている.
Original:
Constructs a copy of the system locale with specified std_name (such as "C", or "POSIX", or "en_US.UTF-8", or "English_US.1251"), if such locale is supported by the operating system. The locale constructed in this manner has a name.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5-6)
そのotherによって識別されるシステムのロケールからコピーされcat引数で識別されるすべての面を除いてstd_nameのコピーを作成します。このように構成されたロケールがotherと同じ名前を持つ.
Original:
Constructs a copy of other except for all the facets identified by the cat argument, which are copied from the system locale identified by its std_name. The locale constructed in this manner has the same name as other.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
7)
引数otherからインストールされているタイプFacetのファセット(通常は引数の型から推定)を除いてfacetのコピーを作成します。 facetNULLがある場合は、構築されたロケールがotherの完全なコピーです。このように構成されたロケールには名前がありません.
Original:
Constructs a copy of other except for the facet of type Facet (typically deduced from the type of the argument) which is installed from the argument facet. If facet is NULL, the constructed locale is a full copy of other. The locale constructed in this manner has no name.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
8)
otherからコピーされcat引数で識別されるすべての面を除いてoneのコピーを作成します。もし両方otheroneその結果のロケールも名前があり、名前を持って.
Original:
Constructs a copy of other except for all the facets identified by the cat argument, which are copied from one. If both other and one have names, then the resulting locale also has a name.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

other -
コピーするには、別のロケール
Original:
another locale to copy
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std_name -
使用するには、システム·ロケールの名前
Original:
name of the system locale to use
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
f -
otherと合併するファセットへのポインタ
Original:
pointer to a facet to merge with other
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cat -
ロケールのカテゴリがotherと合併するファセットを識別するために使用される
Original:
the locale category used to identify the facets to merge with other
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
one -
からファセットを取るために別のロケール
Original:
another locale to take facets from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 例外

1-2)
noexcept specification:  
noexcept
  (C + + 11以来)
3)
オペレーティングシステムがstd::runtime_errorまたはstd_name場合という名前のロケールを持たない場合はstd_nameNULLです.
Original:
std::runtime_error if the operating system has no locale named std_name or if std_name is NULL.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4)
std::runtime_errorオペレーティングシステムがstd_nameという名前のロケールが存在しない場合.
Original:
std::runtime_error if the operating system has no locale named std_name.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5)
オペレーティングシステムがstd::runtime_errorまたはstd_name場合という名前のロケールを持たない場合はstd_nameNULLです.
Original:
std::runtime_error if the operating system has no locale named std_name or if std_name is NULL.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
6)
std::runtime_errorオペレーティングシステムがstd_nameという名前のロケールが存在しない場合.
Original:
std::runtime_error if the operating system has no locale named std_name.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
7-8)
(なし)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

#include <iostream>
#include <locale>
#include <codecvt>
 
int main()
{
    std::locale l1;  // l1 is a copy of the classic "C" locale
    std::locale l2("en_US.UTF-8"); // l2 is a unicode locale
    std::locale l3(l1, l2, std::locale::ctype); // l3 is "C" except for ctype, which is unicode
    std::locale l4(l1, new std::codecvt_utf8<wchar_t>); // l4 is "C" except for codecvt
    std::cout << "Locale names:\nl1: " << l1.name() << "\nl2: " << l2.name()
               << "\nl3: " << l3.name() << "\nl4: " << l4.name() << '\n';
}

Output:

Locale names:
l1: C
l2: en_US.UTF-8
l3: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C
l4: *

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

ロケールおよびその参照カウントがゼロになるのファセットを破棄します
Original:
destructs the locale and the facets whose reference count becomes zero
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

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