std::basic_filebuf::is_open
Aus cppreference.com
< cpp | io | basic filebuf
![]() |
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. |
bool is_open() const; |
||
Versandkosten true wenn der letzte Aufruf
open()
gelungen und es hat keine Veranlassung, close()
seitdem .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.
Inhaltsverzeichnis |
[Bearbeiten] Parameter
(None)
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.
[Bearbeiten] Rückgabewert
true, wenn die zugehörige Datei geöffnet ist, false sonst .
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.
[Bearbeiten] Notes
Diese Funktion wird normalerweise durch std::basic_fstream::is_open genannt .
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.
[Bearbeiten] Beispiel
#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
[Bearbeiten] Siehe auch
öffnet eine Datei und konfiguriert es wie die zugehörige Zeichenfolge 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. (öffentliche Elementfunktion) | |
spült die Put-Bereich Puffer und schließt die zugehörige Datei 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. (öffentliche Elementfunktion) |