Espaços nominais
Variantes
Ações

std::messages_byname

De cppreference.com

<metanoindex/>

 
 
Biblioteca localizações
Localidades e facetas
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.
Classificação de caracteres
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.
Conversões
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Facet classes base da categoria
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.
Categorias faceta
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.
Específicos da localidade facetas
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.
Facetas de conversão de código
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.
C localidade
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.
 
<tbody> </tbody>
Definido no cabeçalho <locale>
template< class CharT > class messages_byname : public std::messages<CharT>;
std::messages_byname é uma faceta std::messages que encapsula recuperação de cordas de catálogos de mensagens do local especificado na sua construção.
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.
Duas especializações são fornecidos pela biblioteca padrão
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.
Defined in header <locale>
std::messages_byname<char>
estreito / multibyte acesso catálogo de mensagens
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>
ampla cadeia de acesso catálogo de mensagens
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 membro

Tipo de membro
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>

Funções de membro

constrói uma faceta messages_byname novo
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.

(função pública membro)
destrói uma 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.

(protegido função de membro)

Herdado de std::messages

Member types

Tipo de membro
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

Nome do membro
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ática) 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.

(of std::messages função pública membro) [edit]
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.

(of std::messages função pública membro) [edit]
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.

(of std::messages função pública membro) [edit]

Protected member functions

[virtual]
abre um catálogo de mensagens chamado
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.

(virtual protegido of std::messages função de membro) [edit]
[virtual]
recupera uma mensagem a partir de um catálogo de mensagens aberta
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.

(virtual protegido of std::messages função de membro) [edit]
[virtual]
fecha um catálogo de mensagens
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.

(virtual protegido of std::messages função de membro) [edit]

Exemplo

#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")));
}

Potencial saída:

"No match" Keine Übereinstimmung
"Memory exhausted" Speicher erschöpft
"No match" Pas de concordance
"Memory exhausted" Mémoire épuisée
"No match" 照合しません
"Memory exhausted" メモリーが足りません

Veja também

implementa recuperação de cordas de catálogos de mensagens
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.

(modelo de classe) [edit]