Espacios de nombres
Variantes
Acciones

std::basic_ifstream::basic_ifstream

De cppreference.com
< cpp‎ | io‎ | basic ifstream

 
 
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_ifstream
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_ifstream::basic_ifstream
basic_ifstream::operator=(C++11)
basic_ifstream::swap(C++11)
basic_ifstream::rdbuf
Las operaciones de archivo
Original:
File operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream::is_open
basic_ifstream::open
basic_ifstream::close
Terceros funciones
Original:
Non-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_ifstream::swap(std::basic_ifstream)(C++11)
 
basic_ifstream();
(1)
basic_ifstream( const char* filename,
                ios_base::openmode mode = ios_base::in );
(2)
basic_ifstream( const string& filename,                                  
                ios_base::openmode mode = ios_base::in );
(3) (desde C++11)
basic_ifstream( basic_ifstream&& other );
(4) (desde C++11)
basic_ifstream( const basic_ifstream& rhs) = delete;
(5)
Construye secuencia de archivo nuevo .
Original:
Constructs new file stream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
Constructor por defecto: construye una corriente que no está asociado con un archivo: default-construye el std::basic_filebuf y construye la base con el puntero para esta default-construido miembro std::basic_filebuf .
Original:
Default constructor: constructs a stream that is not associated with a file: default-constructs the std::basic_filebuf and constructs the base with the pointer to this default-constructed std::basic_filebuf member.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
En primer lugar, realiza los mismos pasos que el constructor por defecto, entonces asssociate la corriente con un archivo llamando rdbuf()->open(filename, mode | std::ios_base::in).. Si la llamada open () devuelve un puntero nulo, se establece setstate(failbit) .
Original:
First, performs the same steps as the default constructor, then asssociate the stream with a file by calling rdbuf()->open(filename, mode | std::ios_base::in).. If the open() call returns a null pointer, sets setstate(failbit).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
Igual que basic_ifstream(filename.c_str(), mode) .
Original:
Same as basic_ifstream(filename.c_str(), mode).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4)
Mueva constructor. En primer lugar, se mueven-construye la clase base de other (que no afecta el puntero rdbuf()), a continuación, mover-construye el miembro std::basic_filebuf, a continuación, llama this->set_rdbuf() para instalar el nuevo basic_filebuf como el puntero rdbuf() en la clase base .
Original:
Move constructor. First, move-constructs the base class from other (which does not affect the rdbuf() pointer), then move-constructs the std::basic_filebuf member, then calls this->set_rdbuf() to install the new basic_filebuf as the rdbuf() pointer in the base class.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5)
El constructor de copia se borra: esta clase no es copiable .
Original:
The copy-constructor is deleted: this class is not copyable.
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

filename -
el nombre del archivo que se abrirá
Original:
the name of the file to be opened
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 fuente de archivo que se utilizará como fuente
Original:
another file 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 <fstream>
#include <utility>
#include <string>
int main()
{
std::ifstream f0;
    std::ifstream f1("test.bin", std::ios::binary);
    std::string name = "example.txt";
    std::ifstream f2(name);
    std::ifstream f3(std::move(f1));
}


[editar] Ver también

abre un archivo y lo asocia con la corriente
Original:
opens a file and associates it with the stream
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]
abre un archivo y lo configura como la secuencia de caracteres asociados
Original:
opens a file and configures it as the associated character sequence
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_filebuf función) [edit]
sustituye a la rdbuf sin borrar su estado de error
Original:
replaces the rdbuf without clearing its error state
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(protegidos función miembro) [edit]
Construye el objeto
Original:
constructs the 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_istream función) [edit]