std::basic_filebuf::is_open
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody> bool is_open() const; |
||
Restituisce
true se la chiamata più recente open() avuto successo e non vi è stata chiamata a close() da allora.Original:
Returns
true if the most recent call to open() succeeded and there has been no call to close() since then.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.
Parametri
(Nessuno)
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.
Valore di ritorno
true se il file associato è aperto, altrimenti false.Original:
true if the associated file is open, false otherwise.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.
Note
Questa funzione viene in genere chiamato da
std::basic_fstream::is_open.Original:
This function is typically called by
std::basic_fstream::is_open.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.
Esempio
#include <fstream>
#include <iostream>
int main()
{
std::ifstream fs("test.txt");
std::filebuf fb;
fb.open("test.txt", std::ios_base::in);
std::cout << std::boolalpha
<< "direct call: " << fb.is_open() << '\n'
<< "through streambuf: " << fs.rdbuf()->is_open() << '\n'
<< "through fstream: " << fs.is_open() << '\n';
}
Output:
direct call: true
through streambuf: true
through fstream: true
Vedi anche
apre un file e lo configura come la sequenza di caratteri associata 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. (metodo pubblico) | |
svuota il buffer dell'area mettere e chiude il file associato 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. (metodo pubblico) | |