Espaces de noms
Variantes
Affichages
Actions

std::basic_ifstream::basic_ifstream

De cppreference.com
< cpp‎ | io‎ | basic ifstream

 
 
D'entrée / sortie de bibliothèque
I / O manipulateurs
C-style I / O
Tampons
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf (obsolète)
Cours d'eau
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstractions
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
Fichier E / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
Chaîne I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
Tableau I / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream (obsolète)
ostrstream (obsolète)
strstream (obsolète)
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
Interface catégorie d'erreur
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category (C++11)
io_errc (C++11)
 
std::basic_ifstream
Les fonctions membres
Original:
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_ifstream::basic_ifstream
basic_ifstream::operator= (C++11)
basic_ifstream::swap (C++11)
basic_ifstream::rdbuf
Opérations sur les fichiers
Original:
File operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream::is_open
basic_ifstream::open
basic_ifstream::close
Tiers fonctions
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.
basic_ifstream::swap(std::basic_ifstream) (C++11)
 
basic_ifstream();
(1)
basic_ifstream( const char* filename,
                ios_base::openmode mode = ios_base::in );
(2)
basic_ifstream( const string& filename,                                  
                ios_base::openmode mode = ios_base::in );
(3) (depuis C++11)
basic_ifstream( basic_ifstream&& other );
(4) (depuis C++11)
basic_ifstream( const basic_ifstream& rhs) = delete;
(5)
Construit flux nouveau fichier .
Original:
Constructs new file stream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
Constructeur par défaut: construit un ruisseau qui n'est pas associé à un fichier: default-construit le std::basic_filebuf et construit la base avec le pointeur de ce défaut-construit membre std::basic_filebuf .
Original:
Default constructor: constructs a stream that is not associated with a file: default-constructs the std::basic_filebuf and constructs the base with the pointer to this default-constructed std::basic_filebuf member.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Tout d'abord, effectue les mêmes étapes que le constructeur par défaut, puis asssociate le flux avec un fichier en appelant rdbuf()->open(filename, mode | std::ios_base::in).. Si l'appel open () renvoie un pointeur nul, définit setstate(failbit) .
Original:
First, performs the same steps as the default constructor, then asssociate the stream with a file by calling rdbuf()->open(filename, mode | std::ios_base::in).. If the open() call returns a null pointer, sets setstate(failbit).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
Même que basic_ifstream(filename.c_str(), mode) .
Original:
Same as basic_ifstream(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.
4)
Déplacez constructeur. Tout d'abord, mouvement construit à partir de la classe de base other (qui n'affecte pas le pointeur rdbuf()), puis déplacez-construit le membre std::basic_filebuf, puis appelle this->set_rdbuf() pour installer la nouvelle basic_filebuf que le pointeur rdbuf() dans la classe de base .
Original:
Move constructor. First, move-constructs the base class from other (which does not affect the rdbuf() pointer), then move-constructs the std::basic_filebuf member, then calls this->set_rdbuf() to install the new basic_filebuf as the rdbuf() pointer in the base class.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5)
Le constructeur de copie est supprimée: cette classe n'est pas copiable .
Original:
The copy-constructor is deleted: this class is not copyable.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Paramètres

filename -
le nom du fichier à ouvrir
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 -
spécifie le mode de flux ouvert. Il est de type masque, les constantes suivantes sont définies:
Constante
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Explanation
app
demander à l'extrémité du flux avant chaque écriture
Original:
seek to the end of stream before each write
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
binary
ouvrir en mode binaire
Original:
open in binary mode
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
in
ouvrir en lecture
Original:
open for reading
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
out
ouvrir en écriture
Original:
open for writing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
trunc
jeter le contenu du courant lors de l'ouverture
Original:
discard the contents of the stream when opening
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ate
demander à l'extrémité du flux immédiatement après ouverture
Original:
seek to the end of stream immediately after open
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Original:
specifies stream open mode. It is bitmask type, the following constants are defined:
Constante
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Explanation
app
demander à l'extrémité du flux avant chaque écriture
Original:
seek to the end of stream before each write
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
binary
ouvrir en mode binaire
Original:
open in binary mode
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
in
ouvrir en lecture
Original:
open for reading
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
out
ouvrir en écriture
Original:
open for writing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
trunc
jeter le contenu du courant lors de l'ouverture
Original:
discard the contents of the stream when opening
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ate
demander à l'extrémité du flux immédiatement après ouverture
Original:
seek to the end of stream immediately after open
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
other -
un autre flux de fichier à utiliser comme source
Original:
another file stream to use as source
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Exemple

#include <fstream>
#include <utility>
#include <string>
int main()
{
std::ifstream f0;
    std::ifstream f1("test.bin", std::ios::binary);
    std::string name = "example.txt";
    std::ifstream f2(name);
    std::ifstream f3(std::move(f1));
}


[modifier] Voir aussi

ouvre un fichier et l'associe avec le flux
Original:
opens a file and associates it with the stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre publique) [edit]
ouvre un fichier et le configure comme la séquence de caractères associé
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.

(fonction membre publique de std::basic_filebuf) [edit]
remplace le rdbuf sans effacer l'état d'erreur
Original:
replaces the rdbuf without clearing its error state
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre protégée) [edit]
Construit l'objet
Original:
constructs the object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre publique de std::basic_istream) [edit]