std::basic_filebuf::close — cppreference.com
De cppreference.com
<metanoindex/>
<tbody> </tbody>
|
|
||
Si une zone de mise exister (par exemple le fichier a été ouvert en écriture), overflow(Traits::eof()) premiers appels d'écrire toutes les sorties en attente d' le fichier, y compris les séquences unshift .
Original:
If a put area exist (e.g. file was opened for writing), first calls overflow(Traits::eof()) to write all pending output to the file, including any unshift sequences.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si la dernière fonction appelée, sur underflow(), overflow(), seekpos() et seekoff(), était overflow(), puis appelle std::codecvt::unshift(), peut-être plusieurs fois, afin de déterminer la séquence unshift fonction de la localisation imprégnée et écrit que la séquence de déposer auprès overflow(Traits::eof()) .
Original:
If the most recently called function, out of underflow(), overflow(), seekpos(), and seekoff(), was overflow(), then calls std::codecvt::unshift(), perhaps multiple times, to determine the unshift sequence according to the imbued locale, and writes that sequence to file with overflow(Traits::eof()).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Ensuite, ferme le fichier comme s'il en appelant std::fclose, indépendamment du fait que l'un des appels précédents réussi ou échoué .
Original:
Then, closes the file as if by calling std::fclose, regardless of whether any of the preceding calls succeeded or failed.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si l'un des faits les appels de fonction, y compris l'appel à std::fclose, échoue, retourne un pointeur nul. Si l'un des faits les appels de fonction lève une exception, l'exception est interceptée et relancée après l'appel de std::fclose. Si le fichier est déjà fermé, renvoie un pointeur nul tout de suite .
Original:
If any of the function calls made, including the call to std::fclose, fails, returns a null pointer. If any of the function calls made throws an exception, the exception is caught and rethrown after calling std::fclose. If the file is already closed, 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.
En tout cas, met à jour la variable membre privée qui est accessible par is_open() .
Original:
In any case, updates the private member variable that is accessed by is_open().
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Paramètres
(Aucun)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Retourne la valeur
*this en cas de succès, un pointeur NULL en cas d'échec .
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.
Notes
close() est généralement appelée par le destructeur de std::basic_filebuf (qui, à son tour, est généralement appelée par le destructeur de std::basic_fstream .
Original:
close() is typically called through the destructor of std::basic_filebuf (which, in turn, is typically called by the destructor 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.
Exemple
Voir aussi
| checks if the associated file is open (fonction membre publique) [edit] | |
[ virtuel Original: virtual The text has been machine-translated via Google Translate. |
Détruit un objet basic_filebuf et ferme le fichier si elle est ouverte Original: destructs a basic_filebuf object and closes the file if it is open The text has been machine-translated via Google Translate. (function membre virtuelle publique) [edit] |