Espaços nominais
Variantes
Acções

std::money_get

Da cppreference.com
< cpp‎ | locale

 
 
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.
locale
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.
codecvt_utf8(C++11)
codecvt_utf16(C++11)
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.
 
std::money_get
Funções de membro
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.
money_get::money_get
money_get::~money_get
money_get::get
money_get::do_get
 
Defined in header <locale>
template<

    class CharT,
    class InputIt = std::istreambuf_iterator<CharT>

> class money_get;
std::money_get modelo de classe encapsula as regras para análise de valores monetários a partir de fluxos de caracteres. O std::get_money manipulador padrão de I / O utiliza a faceta std::money_get da localidade do fluxo de I / O de.
Original:
Class template std::money_get encapsulates the rules for parsing monetary values from character streams. The standard I/O manipulator std::get_money uses the std::money_get facet of the I/O stream's locale.
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-money get-inheritance.svg
Sobre esta imagem

Inheritance diagram

Índice

[editar] Requisitos de tipo

-
InputIt must meet the requirements of InputIterator.

[editar] Especializações

Duas especializações e duas especializações parciais são fornecidos pela biblioteca padrão e são implementadas por todos os objetos localidade criado em um programa em C + +:
Original:
Two specializations and two partial 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::money_get<char>
analisa representações de seqüência estreitas de valores monetários
Original:
parses narrow string representations of monetary values
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::money_get<wchar_t>
analisa representações de seqüência de grandes valores monetários
Original:
parses wide string representations of monetary values
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::money_get<char, InputIt>
analisa representações de seqüência estreitas de valores monetários usando iterador de entrada personalizado
Original:
parses narrow string representations of monetary values using custom input iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::money_get<wchar_t, InputIt>
analisa representações de seqüência de grandes valores monetários usando iterador de entrada personalizado
Original:
parses wide string representations of monetary values using custom input iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] 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
char_type CharT
string_type std::basic_string<CharT>
iter_type InputIt

[editar] Funções de membro

constrói uma faceta money_get novo
Original:
constructs a new money_get 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 money_get
Original:
destructs a money_get 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)
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.

(função pública membro)

[editar] Protegido funções de membro

[virtual]
analisa um valor monetário de um fluxo de entrada
Original:
parses a monetary value from an input stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtual protegido função de membro)

[editar] Objetos Membros

static std::locale::id id
' ID da localidade
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.

(objeto membro público)

[editar] Exemplo

#include <iostream>
#include <sstream>
#include <locale>
#include <iomanip>
#include <iterator>
int main()
{
    std::string str = "$1.11 $2.22 $3.33";
    std::cout << std::fixed << std::setprecision(2);
 
    std::cout << '"' << str << "\" parsed with the I/O manipulator: ";
    std::istringstream s1(str);
    s1.imbue(std::locale("en_US.UTF-8"));
    long double val;
    while(s1 >> std::get_money(val))
        std::cout << val/100 << ' ';
    std::cout << '\n';
 
    str = "USD  1,234.56";
    std::cout << '"' << str << "\" parsed with the facet directly: ";
    std::istringstream s2(str);
    s2.imbue(std::locale("en_US.UTF-8"));
    auto& f = std::use_facet<std::money_get<char>>(s2.getloc());
    std::ios_base::iostate err;
    std::istreambuf_iterator<char> beg(s2), end;
    f.get(beg, end, true, s2, err, val);
    std::cout << val/100 << '\n';
}

Output:

"$1.11 $2.22 $3.33" parsed with the I/O manipulator: 1.11 2.22 3.33
"USD  1,234.56" parsed with the facet directly: 1234.56

[editar] Veja também

define parâmetros de formatação monetários utilizados por std::money_get e std::money_put
Original:
defines monetary formatting parameters used by std::money_get and std::money_put
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]
formatos de valor monetário para a saída como uma seqüência de caracteres
Original:
formats a monetary value for output as a character sequence
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]
(C++11)
analisa um valor monetário
Original:
parses a monetary value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de função)