std::locale::locale
Aus 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. |
<metanoindex/>
<tbody> </tbody>| definiert 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)
Standardkonstruktor. Erzeugt eine Kopie des globalen C + + locale (das heißt, das Gebietsschema zuletzt als Argument für
std::locale::global oder eine Kopie des std::locale::classic verwendet, wenn kein Anruf std::locale::global gemacht wurde .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.
You can help to correct and verify the translation. Click here for instructions.
2)
Copy-Konstruktor. Konstruiert eine Kopie
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.
You can help to correct and verify the translation. Click here for instructions.
3-4)
Erstellt eine Kopie des Systemgebietsschema mit bestimmten
std_name (z. B. "C" oder "POSIX" oder "de_DE.UTF-8" oder "English_US.1251"), wenn eine solche locale vom Betriebssystem unterstützt wird. Das Gebietsschema auf diese Weise konstruiert hat einen Namen .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.
You can help to correct and verify the translation. Click here for instructions.
5-6)
Konstruiert eine Kopie
other außer allen Facetten vom cat Argument, das aus der durch seine Systemgebietsschema std_name identifizierten kopierten identifiziert. Das Gebietsschema auf diese Weise konstruiert hat den gleichen Namen wie 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.
You can help to correct and verify the translation. Click here for instructions.
7)
Konstruiert eine Kopie
other Ausnahme der Facette des Typs Facet (typischerweise von der Art des Arguments abgeleitet), die aus dem Argument facet installiert ist. Wenn facet NULL ist, ist die konstruierte locale eine vollständige Kopie other. Das Gebietsschema auf diese Weise konstruiert hat keinen Namen .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.
You can help to correct and verify the translation. Click here for instructions.
8)
Erzeugt eine Kopie des
other außer für alle Facetten von der cat Argument, das von one kopiert werden identifiziert. Wenn beide other und one Namen haben, dann ist das resultierende locale hat auch einen Namen .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.
You can help to correct and verify the translation. Click here for instructions.
Parameter
| other | - | andere locale zu kopieren
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 | - | Name des Systems locale zu bedienen
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 | - | Zeiger auf eine Facette mit
other verschmelzen 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 | - | das Gebietsschema Kategorie verwendet, um die Facetten zu identifizieren, um mit
other verschmelzen 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 | - | anderes Gebietsschema Facetten zu nehmen
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. |
Ausnahmen
1-2)
3)
std::runtime_error wenn das Betriebssystem hat keine locale benannt
std_name oder wenn std_name ist NULL .Original:
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.
4)
std::runtime_error wenn das Betriebssystem keine locale benannt
std_name hat .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.
You can help to correct and verify the translation. Click here for instructions.
5)
std::runtime_error wenn das Betriebssystem hat keine locale benannt
std_name oder wenn std_name ist NULL .Original:
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.
6)
std::runtime_error wenn das Betriebssystem keine locale benannt
std_name hat .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.
You can help to correct and verify the translation. Click here for instructions.
7-8)
(None)
Original:
(none)
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.
Beispiel
#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: *
Siehe auch
zerstört sich das Gebietsschema und die Facetten, deren Referenzzähler Null wird 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. (öffentliche Elementfunktion) | |