std::locale::name
De 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>| Definido no cabeçalho <locale>
|
||
std::string name() const; |
||
Retorna o nome do local, que é o nome pelo qual é conhecido pelo sistema operativo, tal como "POSIX" ou "en_US.UTF8" ou "English_United States.1252". Se o local não é uma cópia de uma localidade fornecido pelo sistema, a string "*" é retornado.
Original:
Returns the name of the locale, which is the name by which it is known to the operating system, such as "POSIX" or "en_US.UTF8" or "English_United States.1252". If the locale is not a copy of a system-supplied locale, the string "*" is returned.
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.
Valor de retorno
O nome da localidade ou "*" se não identificado.
Original:
The name of the locale or "*" if unnamed.
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.
Exemplo
#include <locale>
#include <iostream>
#include <string>
int main()
{
std::locale loc(std::locale(), new std::ctype<char>);
std::cout << "The default locale is " << std::locale().name() << '\n'
<< "The user's locale is " << std::locale("").name() << '\n'
<< "A nameless locale is " << loc.name() << '\n';
}
Saída:
The default locale is C
The user's locale is en_US.UTF8
A nameless locale is *
Veja também
constrói uma nova localidade Original: constructs a new locale 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) | |