std::messages_byname
De cppreference.com
|
|
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
| Definido en el archivo de encabezado <locale>
|
||
template< class CharT >
class messages_byname : public std::messages<CharT>;
|
||
std::messages_byname es una faceta std::messages que encapsula la recuperación de las cadenas de catálogos de mensajes del entorno local especificado en su construcción .
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.
Dos especializaciones son proporcionados por la biblioteca estándar
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.
Definido en el encabezado
<locale> | |
std::messages_byname<char>
|
estrecho / multibyte acceso a mensajes catálogo
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>
|
mensaje amplia cadena de acceso catálogo
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. |
Tipos de miembros
Miembro de tipo
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>
|
Las funciones miembro
construye una nueva faceta 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. (función miembro pública) | |
destructs una faceta 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. (función miembro protegida) |
Heredado de std::messages
Member types
Miembro de tipo
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
Persona
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 (estático)
|
std::locale::id |
Member functions
Invoca 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. (función miembro pública de std::messages)
| |
Invoca 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. (función miembro pública de std::messages)
| |
Invoca 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. (función miembro pública de std::messages)
|
Protected member functions
[virtual] |
abre un catálogo de mensajes identificado 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. (función miembro virtual protegida de std::messages)
|
[virtual] |
recupera un mensaje de un catálogo de mensajes abiertos 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. (función miembro virtual protegida de std::messages)
|
[virtual] |
cierra un catálogo de mensajes 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. (función miembro virtual protegida de std::messages)
|
Ejemplo
Ejecuta este código
#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")));
}
Posible salida:
"No match" Keine Übereinstimmung
"Memory exhausted" Speicher erschöpft
"No match" Pas de concordance
"Memory exhausted" Mémoire épuisée
"No match" 照合しません
"Memory exhausted" メモリーが足りません
Ver también
| Implementa la recuperación de cadenas de los catálogos de mensajes. (plantilla de clase) |