Espacios de nombres
Variantes
Acciones

std::basic_filebuf::open

De cppreference.com
< cpp‎ | io‎ | basic filebuf
 
 
Biblioteca de E/S
Manipuladores de E/S
E/S estilo C
Búferes
(en desuso en C++98)
Flujos
Abstracciones
E/S de archivos
E/S de cadenas
E/S de arrays
(en desuso en C++98)
(en desuso en C++98)
(en desuso en C++98)
Salida sincronizada
Tipos
Interfaz de categoría de error
(C++11)
 
std::basic_filebuf
Las funciones públicas miembros
Original:
Public 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_filebuf::open
Protegido funciones miembro
Original:
Protected member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
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.
 
std::basic_filebuf<CharT, Traits>* open( const char* s, std::ios_base::openmode mode )
(1)
std::basic_filebuf<CharT, Traits>* open( const std::string& s, std::ios_base::openmode mode )
(2) (desde C++11)
Abre el archivo cuyo nombre está dado por
Original:
Opens the file whose name is given by
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
el byte de terminación nula estrecho s cadena
Original:
the null-terminated narrow byte string s
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
el byte de terminación nula estrecho s.c_str() cadena
Original:
the null-terminated narrow byte string s.c_str()
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
como si se aplicase std::fopen(s, modestring), donde modestring se determina como sigue:
Original:
as if by calling std::fopen(s, modestring), where modestring is determined as follows:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
modestring
Original:
modestring
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
openmode & ~ate
"r" in
"w" out, out|trunc
"a" app, out|app
"r+" out|in
"w+" out|in|trunc
"a+" out|in|app, in|app
"rb" binary|in
"wb" binary|out, binary|out|trunc
"ab" binary|app, binary|out|app
"r+b" binary|out|in
"w+b" binary|out|in|trunc
"a+b" binary|out|in|app, binary|in|app
Si openmode no es uno de los modos de la lista, el open() falla .
Original:
If openmode is not one of the modes listed, the open() fails.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si la operación tiene éxito y openmode & std::ios_base::ate != 0 abierto (el bit se establece ate), vuelve a colocar la posición del archivo al final del archivo, como si se aplicase std::fseek(file, 0, SEEK_END). Si el reposicionamiento de falla, llama close() y devuelve un puntero nulo para indicar el fallo .
Original:
If the open operation succeeds and openmode & std::ios_base::ate != 0 (the ate bit is set), repositions the file position to the end of file, as if by calling std::fseek(file, 0, SEEK_END). If the repositioning fails, calls close() and returns a null pointer to indicate failure.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si el archivo asociado ya estaba abierta, devuelve un puntero nulo en seguida .
Original:
If the associated file was already open, returns a null pointer right away.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Contenido

[editar] Parámetros

s -
el nombre del archivo para abrirlo
Original:
the file name to open
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
openmode -
el modo de apertura de archivo, un binario o de los modos de std::ios_base
Original:
the file opening mode, a binary OR of the std::ios_base modes
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

*this en caso de éxito, un puntero nulo en caso de fallo .
Original:
*this on success, a null pointer on failure.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Notas

open() se suele llamar a través del constructor o la función miembro open() de std::basic_fstream .
Original:
open() is typically called through the constructor or the open() member function of std::basic_fstream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ejemplo

[editar] Ver también

checks if the associated file is open
(función miembro pública) [editar]
vacía el búfer área de poner y cierra el archivo asociado
Original:
flushes the put area buffer and closes the associated file
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública) [editar]