Espaços nominais
Variantes
Acções

std::ws

Da cppreference.com
< cpp‎ | io‎ | manip

 
 
De entrada / saída da biblioteca
I / O manipuladores
C estilo de I / O
Buffers
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf(obsoleta)
Streams
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstrações
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
File I / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
Cordas I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
Matriz de I / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream(obsoleta)
ostrstream(obsoleta)
strstream(obsoleta)
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
Interface de categoria de erro
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category(C++11)
io_errc(C++11)
 
Entrada / saída manipuladores
De ponto flutuante de formatação
Original:
Floating-point formatting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Formatação inteiro
Original:
Integer formatting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Formatação booleana
Original:
Boolean formatting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
boolalpha
noboolalpha
Largura do campo e controle de preenchimento
Original:
Field width and fill control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Outra formatação
Original:
Other formatting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Espaços de processamento
Original:
Whitespace processing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ws
ends
Saída de descarga
Original:
Output flushing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Sinalizadores de status manipulação
Original:
Status flags manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tempo e dinheiro I / O
Original:
Time and money I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
get_money(C++11)
get_time(C++11)
put_money(C++11)
put_time(C++11)
 
Defined in header <istream>
template< class CharT, class Traits >
std::basic_istream<CharT,Traits>& ws( std::basic_istream<CharT, Traits>& is );
Descarta o espaço em branco a partir de um fluxo de entrada.
Original:
Discards leading whitespace 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.
Se comporta como um UnformattedInputFunction, exceto que is.gcount() não seja modificado. Depois de construir e verificar o objeto de sentinela, extrai os caracteres do fluxo e descarta-los até qualquer uma das seguintes condições ocorre:
Original:
Behaves as an UnformattedInputFunction, except that is.gcount() is not modified. After constructing and checking the sentry object, extracts characters from the stream and discards them until any one of the following conditions occurs:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • condição de fim de arquivo ocorre na seqüência de entrada (caso em que a função chama setstate(eofbit) mas não define failbit.
    Original:
    end of file condition occurs in the input sequence (in which case the function calls setstate(eofbit) but does not set failbit.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • c o próximo caractere disponível na seqüência de entrada não é espaço em branco como determinado pelo std::isspace(c, is.getloc())., o carácter não-branco não é extraído.
    Original:
    the next available character c in the input sequence is not whitespace as determined by std::isspace(c, is.getloc()). The non-whitespace character is not extracted.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
Isto é uma entrada de somente manipulador de I / O, que pode ser chamada com uma indicação tal como in << std::ws para qualquer tipo de in std::basic_istream.
Original:
This is an input-only I/O manipulator, it may be called with an expression such as in << std::ws for any in of type std::basic_istream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[editar] Parâmetros

is -
referência ao fluxo de entrada
Original:
reference to input stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

is (referência ao fluxo após a extracção consecutiva de espaços em branco)
Original:
is (reference to the stream after extraction of consecutive whitespace)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Exemplo

#include <iostream>
#include <sstream>
int main()
{
    std::istringstream s("     this is a test");
    std::string line;
    s >> std::ws;
    getline(s, line);
    std::cout << "ws + getline returns: \"" << line << "\"\n";
}

Output:

ws + getline returns: "this is a test"

[editar] Veja também

extratos e personagens descarta até o caráter dado foi encontrado
Original:
extracts and discards characters until the given character is found
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(of std::basic_istream função pública membro) [edit]