Espacios de nombres
Variantes
Acciones

std::locale

De cppreference.com
< cpp‎ | locale

 
 
Localizaciones biblioteca
Locales y 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.
locale
Carácter clasificación
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.
Conversiones
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 clases categoría 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.
Categorías 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ífico de la localidad 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 código de conversión
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::locale
Tipos de miembros
Original:
Member types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
locale::id
locale::facet
Las funciones miembro
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.
locale::locale
locale::~locale
locale::operator=
locale::combine
locale::name
locale::operator==
locale::operator!=
locale::operator()
Funciones miembro estáticas
Original:
Static member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
locale::global
locale::classic
 
Defined in header <locale>
class locale;
Un objeto de std::locale clase es un conjunto indexado de punteros contados referencia a facetas. Cada objeto de flujo de la C + + de entrada / salida biblioteca está asociado con una std::locale y utiliza sus facetas para analizar y formateo de todos los datos. Además, un objeto de configuración regional está asociado con cada objeto basic_regex. Objetos Locale también se puede utilizar como predicados que realizan la ordenación de cadenas con los contenedores estándar y algoritmos y se puede acceder directamente para obtener o modificar las facetas que tienen .
Original:
An object of class std::locale is an indexed set of reference-counted pointers to facets. Each stream object of the C++ input/output library is associated with an std::locale and uses its facets for parsing and formatting of all data. In addition, a locale object is associated with each basic_regex object. Locale objects can also be used as predicates that perform string collation with the standard containers and algorithms and can be accessed directly to obtain or modify the facets they hold.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Cada entorno nacional construido en un programa en C + + contiene al menos los siguientes aspectos estándar, pero un programa puede definir especializaciones adicionales o facetas totalmente nuevas y añadirlas a cualquier objeto existente locale .
Original:
Each locale constructed in a C++ program holds at least the following standard facets, but a program may define additional specializations or completely new facets and add them to any existing locale object.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Supported facets
std::collate<char> std::collate<wchar_t>
std::ctype<char> std::ctype<wchar_t>
std::codecvt<char,char,mbstate_t>
std::codecvt<char16_t,char,mbstate_t>
std::codecvt<char32_t,char,mbstate_t>
std::codecvt<wchar_t,char,mbstate_t>
std::moneypunct<char>
std::moneypunct<char,true>
std::moneypunct<wchar_t>
std::moneypunct<wchar_t,true>
std::money_get<char> std::money_get<wchar_t>
std::money_put<char> std::money_put<wchar_t>
std::numpunct<char> std::numpunct<wchar_t>
std::num_get<char> std::num_get<wchar_t>
std::num_put<char> std::num_put<wchar_t>
std::time_get<char> std::time_get<wchar_t>
std::time_put<char> std::time_put<wchar_t>
std::messages<char> std::messages<wchar_t>

Contenido

[editar] Tipos de miembros

el tipo de índice faceta: cada faceta clase debe declarar o heredar un miembro público estático de este tipo
Original:
the facet index type: each facet class must declare or inherit a public static member of this type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(clase) [edit]
la clase base para todas las categorías de faceta: cada faceta de cualquier categoría se deriva de este tipo
Original:
the base class for all facet categories: each facet of any category is derived from this type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(clase) [edit]
category
int
(typedef)

[editar] Objetos miembros

none
[estático]
un valor cero de tipo category indica que no hay categoría faceta
Original:
a zero value of type category indicating no facet category
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(público miembro constante estática)
collate
[estático]
un valor de máscara de bits de category tipo que indica la categoría faceta cotejo
Original:
a bitmask value of type category indicating the collate facet category
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(público miembro constante estática)
ctype
[estático]
un valor de máscara de bits de category tipo que indica la categoría faceta ctype
Original:
a bitmask value of type category indicating the ctype facet category
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(público miembro constante estática)
monetary
[estático]
un valor de máscara de bits de category tipo que indica la categoría faceta monetaria
Original:
a bitmask value of type category indicating the monetary facet category
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(público miembro constante estática)
numeric
[estático]
un valor de máscara de bits de category tipo que indica la categoría faceta numérico
Original:
a bitmask value of type category indicating the numeric facet category
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(público miembro constante estática)
time
[estático]
un valor de máscara de bits de category tipo que indica la categoría faceta tiempo
Original:
a bitmask value of type category indicating the time facet category
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(público miembro constante estática)
messages
[estático]
un valor de máscara de bits de category tipo que indica la categoría faceta mensajes
Original:
a bitmask value of type category indicating the messages facet category
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(público miembro constante estática)
all
[estático]
collate | ctype | monetary | numeric | time | messages
(público miembro constante estática)

[editar] Las funciones miembro

construye un nuevo local
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.

(miembro público función) [edit]
destruye la configuración regional y las facetas cuya referencia cuenta llega a cero
Original:
destructs the locale and the facets whose reference count becomes zero
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
sustituye a una localidad
Original:
replaces a locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
construye un local con aspecto de tiempo de compilación identificado copiado de otro lugar
Original:
constructs a locale with compile-time identified facet copied from another locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
devuelve el nombre de la localidad o "*" si tiene nombre
Original:
returns 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.

(miembro público función) [edit]
igualdad comparación entre los objetos de configuración regional
Original:
equality comparison between locale objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
lexicographically compares two strings using this locale's collate facet
(miembro público función) [edit]
[estático]
cambia la configuración regional global
Original:
changes the global locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro estático público función) [edit]
[estático]
obtiene una referencia a la localización "C"
Original:
obtains a reference to the "C" locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro estático público función) [edit]

[editar] Ejemplo

Demuestra el prólogo típico de un programa sensible a la localidad (multiplataforma)
Original:
Demonstrates the typical prologue of a locale-sensitive program (cross-platform)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <iostream>
#include <locale>
 
int main()
{
    std::wcout << "User-preferred locale setting is " << std::locale("").name().c_str() << '\n';
    // on startup, the global locale is the "C" locale
    std::wcout << 1000.01 << '\n';
    // replace the C++ global locale as well as the C locale with the user-preferred locale
    std::locale::global(std::locale("") );
    // use the new global locale for future wide character output
    std::wcout.imbue(std::locale());
    // output the same number again
    std::wcout << 1000.01 << '\n';
}

Output:

User-preferred locale setting is en_US.UTF8
1000.01
1,000.01

[editar] Ver también

obtiene una faceta de una localidad
Original:
obtains a facet from a locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función de plantilla) [edit]
Comprueba si un local implementa una faceta específica
Original:
checks if a locale implements a specific 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 de plantilla) [edit]
establece la configuración regional
Original:
sets locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público of std::ios_base función) [edit]
devuelve localización actual
Original:
returns current locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público of std::ios_base función) [edit]