Namespace
Varianti

std::messages

Da cppreference.com.
< cpp‎ | locale

 
 
Localizzazioni libreria
Impostazioni internazionali e sfaccettature
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
Carattere classificazione
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.
Conversioni
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 categoria classi di base
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.
Facet categorie
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.
Locale specifici aspetti
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.
Codice di conversione sfaccettature
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 locale
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::messages
Membri funzioni
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.
messages::messages
messages::~messages
messages::open
messages::do_open
messages::get
messages::do_get
messages::close
messages::do_close
 
Defined in header <locale>
template< class CharT >
class messages;

Class template std::messages encapsulates retrieval of strings from message catalogs, such as the ones provided by GNU gettext or by POSIX catgets.

cpp/locale/messages basecpp/locale/locale/facetstd-messages-inheritance.svg
Informazioni sull'immagine

Inheritance diagram

Due specializzazioni sono forniti dalla libreria standard e sono attuate da tutti gli oggetti delle impostazioni locali creati in un programma C + +:
Original:
Two specializations are provided by the standard library and are implemented by all locale objects created in a C++ program:
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<char> accesses narrow string message catalog
std::messages<wchar_t> accesses wide string message catalog

Indice

[modifica] Membri tipi

Membro 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>

[modifica] Membri funzioni

constructs a new messages facet
(membro pubblico funzione)
destructs a messages facet
(protetto funzione membro)
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.

(membro pubblico funzione) [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.

(membro pubblico funzione) [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.

(membro pubblico funzione) [edit]

[modifica] Membri oggetti

static std::locale::id id
' Id del locale
Original:
id of the locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(membro oggetto pubblico)

[modifica] Protetto funzioni membro

[virtuale]
apre un catalogo di messaggi di nome
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.

(virtuale protetto funzione membro) [edit]
[virtuale]
recupera un messaggio da un catalogo messaggio aperto
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.

(virtuale protetto funzione membro) [edit]
[virtuale]
chiude un catalogo di messaggi
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.

(virtuale protetto funzione membro) [edit]

Inherited from std::messages_base

Tipo
Original:
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 int


[modifica] Esempio

The following example demonstrated retrieval of messages: on a typical GNU/Linux system it reads from /usr/share/locale/de/LC_MESSAGES/sed.mo

#include <iostream>
#include <locale>
 
int main()
{
    std::locale loc("de_DE.utf8");
    std::cout.imbue(loc);
    auto& facet = std::use_facet<std::messages<char>>(loc);
    auto cat = facet.open("sed", loc);
    if(cat < 0 )
        std::cout << "Could not open german \"sed\" message catalog\n";
    else
        std::cout << "\"No match\" in German: "
                  << facet.get(cat, 0, 0, "No match") << '\n'
                  << "\"Memory exhausted\" in German: "
                  << facet.get(cat, 0, 0, "Memory exhausted") << '\n';
    facet.close(cat);
}

Output:

"No match" in German: Keine Übereinstimmung
"Memory exhausted" in German: Speicher erschöpft

[modifica] Vedi anche

definisce il catalogo messaggi tipo
Original:
defines messages catalog type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(classe template)
creates a messages facet for the named locale
(classe template)