Espacios de nombres
Variantes
Acciones

std::basic_istringstream::basic_istringstream

De cppreference.com

 
 
Entrada / salida de la biblioteca
I / O manipuladores
C-estilo 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(obsoleto)
Arroyos
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstracciones
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
Cadena de 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 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(obsoleto)
ostrstream(obsoleto)
strstream(obsoleto)
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
Error interfaz categoría
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)
 
std::basic_istringstream
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.
basic_istringstream::basic_istringstream
basic_istringstream::operator=
basic_istringstream::swap
basic_istringstream::rdbuf
Operaciones con cadenas
Original:
String operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream::str
 
basic_istringstream( ios_base::openmode mode = ios_base::in );
(1)
basic_istringstream( const std::basic_string<CharT,Traits,Allocator>& str,
                     ios_base::openmode mode = ios_base::in );
(2)
basic_istringstream( basic_istringstream&& other );
(3) (desde C++11)
Construye corriente nueva cadena .
Original:
Constructs new string stream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
Construye nuevo dispositivo cadena subyacente. El objeto basic_stringbuf subyacente se construye como basic_stringbuf<Char,Traits,Allocator>(mode | ios_base::in).
Original:
Constructs new underlying string device. The underlying basic_stringbuf object is constructed as basic_stringbuf<Char,Traits,Allocator>(mode | ios_base::in).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Utiliza una copia del str como contenido inicial del dispositivo cadena subyacente. El objeto basic_stringbuf subyacente se construye como basic_stringbuf<Char,Traits,Allocator>(str, mode | ios_base::in).
Original:
Uses a copy of str as initial contents of the underlying string device. The underlying basic_stringbuf object is constructed as basic_stringbuf<Char,Traits,Allocator>(str, mode | ios_base::in).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
Mueva constructor. Construye el flujo de archivos con el estado de other utilizando la semántica de movimiento .
Original:
Move constructor. Constructs the file stream with the state of other using move semantics.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Parámetros

str -
cadena que se utiliza como contenido inicial de la corriente de cadena
Original:
string to use as initial contents of the string stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mode -
especifica el modo de transmisión abierta. Es el tipo de máscara de bits, las siguientes constantes son definidas:
Constant
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Explanation
app
buscan al final del flujo antes de cada escritura
Original:
seek to the end of stream before each write
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
binary
abrir en modo binario
Original:
open in binary mode
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
in
abierto para la lectura
Original:
open for reading
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
out
abrir para escritura
Original:
open for writing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
trunc
descartar el contenido de la corriente cuando se abre
Original:
discard the contents of the stream when opening
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ate
buscar al extremo de corriente inmediatamente después de abierto
Original:
seek to the end of stream immediately after open
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Original:
specifies stream open mode. It is bitmask type, the following constants are defined:
Constant
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Explanation
app
buscan al final del flujo antes de cada escritura
Original:
seek to the end of stream before each write
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
binary
abrir en modo binario
Original:
open in binary mode
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
in
abierto para la lectura
Original:
open for reading
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
out
abrir para escritura
Original:
open for writing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
trunc
descartar el contenido de la corriente cuando se abre
Original:
discard the contents of the stream when opening
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ate
buscar al extremo de corriente inmediatamente después de abierto
Original:
seek to the end of stream immediately after open
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
other -
otra corriente de cadena que se utiliza como fuente
Original:
another string stream to use as source
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ejemplo

#include <iostream>
#include <sstream>
int main()
{
    // default constructor (input/output stream)
    std::stringstream buf1;
    buf1 << 7;
    int n = 0;
    buf1 >> n;
    std::cout << "buf1 = " << buf1.str() << " n = " << n << '\n';
 
    // input stream
    std::istringstream inbuf("-10");
    inbuf >> n;
    std::cout << "n = " << n << '\n';
 
    // output stream in append mode (C++11)
    std::ostringstream buf2("test", std::ios_base::ate);
    buf2 << '1';
    std::cout << buf2.str() << '\n';
}

Output:

buf1 = 7 n = 7
n = -10
test1

[editar] Ver también

obtiene o establece el contenido del objeto subyacente dispositivo cadena
Original:
gets or sets the contents of underlying string device object
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 objeto basic_stringbuf
Original:
constructs a basic_stringbuf object
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::basic_stringbuf función) [edit]