std::basic_fstream::open
Da cppreference.com
< cpp | io | basic fstream
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
void open( const char *filename, ios_base::openmode mode = ios_base::in|ios_base::out ); |
||
void open( const std::string &filename, ios_base::openmode mode = ios_base::in|ios_base::out ); |
(desde C++11) | |
Abre e associados arquivo com o fluxo de arquivo. clear() chama de sucesso ou fracasso em setstate(failbit).
Original:
Opens and associates file with the file stream. Calls clear() on success or setstate(failbit) on failure.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
A primeira versão efetivamente chama rdbuf()->open(filename, mode).
Original:
The first version effectively calls rdbuf()->open(filename, mode).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
A segunda versão efetivamente chama open(filename.c_str(), mode).
Original:
The second version effectively calls open(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.
You can help to correct and verify the translation. Click here for instructions.
Índice |
[editar] Parâmetros
filename | - | o nome do arquivo a ser aberto
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 o modo de fluxo aberto. Ele é o tipo de máscara de bits, as seguintes constantes são definidas:
Original: specifies stream open mode. It is bitmask type, the following constants are defined:
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
(Nenhum)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[editar] Exemplo
Esta seção está incompleta Motivo: sem exemplo |
[editar] Veja também
Verifica se o fluxo tem um arquivo associado Original: checks if the stream has an associated file 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) | |
fecha o arquivo associado Original: 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. (função pública membro) |