std::messages_byname
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>
|
||
template< class CharT > class messages_byname : public std::messages<CharT>; |
||
std::messages_byname ist ein std::messages Facette, die Abfrage von Strings aus Nachricht Katalogen der Gebietsschema seiner Konstruktion angegeben kapselt .
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.
Zwei Spezialisierungen werden durch die Standard-Bibliothek zur Verfügung gestellt
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.
definiert in Header
<locale> | |
std::messages_byname<char>
|
schmal / Multibyte Meldungskatalog Zugang
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>
|
breite string message Katalog zugreifen
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. |
Mitglied Typen
Mitglied Typ
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>
|
Member-Funktionen
baut eine neue messages_byname Facette 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. (öffentliche Elementfunktion) | |
zerstört sich eine messages_byname Facette 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. (geschützt Member-Funktion) | |
Inherited from std::messages
Member types
Mitglied Typ
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
Member name
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 (statisch)
|
std::locale::id |
Member functions
Beruft 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. (öffentliche Elementfunktion of std::messages)
| |
Beruft 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. (öffentliche Elementfunktion of std::messages)
| |
Beruft 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. (öffentliche Elementfunktion of std::messages)
| |
Protected member functions
[virtuell] |
öffnet eine benannte Meldung Katalog ein 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. (virtuellen geschützten Member-Funktion of std::messages)
|
[virtuell] |
ruft eine Nachricht aus einer geöffneten Nachricht Katalog ein 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. (virtuellen geschützten Member-Funktion of std::messages)
|
[virtuell] |
schließt eine Nachricht Katalog ein 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. (virtuellen geschützten Member-Funktion of std::messages)
|
Beispiel
#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" メモリーが足りません
Siehe auch
implementiert Abruf von Strings aus Nachrichtenkatalogen 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. (Klassen-Template) | |