Пространства имён
Варианты
Действия

std::numpunct

Материал из cppreference.com

 
 
Локализация библиотеки
Языки и граней
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
Персонаж классификации
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.
Преобразования
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 классов категории базу
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 категорий
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.
Язык конкретных аспектов
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.
Код аспекты преобразования
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 локали
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::numpunct
 
Заголовочный файл <locale>
template< class CharT >
class numpunct;
Гранью std::numpunct инкапсулирует числовые предпочтения пунктуации. Поток операций ввода / вывода использовать std::numpunct через std::num_get и std::num_put для разбора цифрового ввода и форматирования цифровой выход.
Original:
The facet std::numpunct encapsulates numeric punctuation preferences. Stream I/O operations use std::numpunct through std::num_get and std::num_put for parsing numeric input and formatting numeric output.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cpp/locale/locale/facetstd-numpunct-inheritance.svg
Описание изображения

Диаграмма наследования

Две специализации осуществляется стандартной библиотеки
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.
Определено в файле <locale>
std::numpunct<char>
предоставляет эквиваленты "C" локали предпочтений
Original:
provides equivalents of the "C" locale preferences
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::numpunct<wchar_t>
предоставляет широкий эквиваленты характер "C" локали предпочтений
Original:
provides wide character equivalents of the "C" locale preferences
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Содержание

[править] Член типов

Член типа
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>

[править] Член функций

строит новую грань numpunct
Original:
constructs a new numpunct facet
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(public функция-член) [edit]
разрушает numpunct грань
Original:
destructs a numpunct facet
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(protected функция-член) [edit]
Вызывает do_decimal_point
Original:
invokes do_decimal_point
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(public функция-член) [edit]
Вызывает do_thousands_sep
Original:
invokes do_thousands_sep
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(public функция-член) [edit]
Вызывает do_grouping
Original:
invokes do_grouping
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(public функция-член) [edit]
Вызывает do_truename
Original:
invokes do_truename
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(public функция-член) [edit]
Вызывает do_falsename
Original:
invokes do_falsename
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(public функция-член) [edit]

[править] Охраняемые функций-членов

обеспечивает характера для использования в качестве десятичной точки
Original:
provides the character to use as decimal point
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtual protected функция-член) [edit]
обеспечивает знак, используемый в качестве разделителя тысяч
Original:
provides the character to use as thousands separator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtual protected функция-член) [edit]
[virtual]
обеспечивает количество цифр между каждой парой тысяч сепараторов
Original:
provides the numbers of digits between each pair of thousands separators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtual protected функция-член) [edit]
[virtual]
предоставляет строку, используемую в качестве имени логического true
Original:
provides the string to use as the name of the boolean true
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtual protected функция-член) [edit]
[virtual]
предоставляет строку, используемую в качестве имени логического false
Original:
provides the string to use as the name of the boolean false
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtual protected функция-член) [edit]

[править] Член объектов

static std::locale::id id
' Идентификатор локали
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.

(public объект-член)

[править] Пример

В следующем примере строка представления true и false
Original:
The following example changes the string representations of true and false
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>
 
struct french_bool : std::numpunct<char> {
    string_type do_truename() const { return "oui"; }
    string_type do_falsename() const { return "non"; }
};
 
int main()
{
    std::cout << "default locale: "
              << std::boolalpha << true << ", " << false << '\n';
    std::cout.imbue(std::locale(std::cout.getloc(), new french_bool()));
    std::cout << "locale with modified numpunct: "
              << std::boolalpha << true << ", " << false << '\n';
}

Вывод:

default locale: true, false
locale with modified numpunct: oui, non

[править] См. также

создает numpunct аспект для указанного языка
Original:
creates a numpunct facet for the named locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(шаблон класса)