Espaces de noms
Variantes
Affichages
Actions

std::basic_streambuf::pubsetbuf, std::basic_streambuf::setbuf

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

 
 
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_streambuf
Fonctions membres publiques
Original:
Public 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_streambuf::~basic_streambuf
Locales
Original:
Locales
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::pubimbue
basic_streambuf::getloc
Positionnement
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::pubsetbuf
basic_streambuf::pubseekoff
basic_streambuf::pubseekpos
basic_streambuf::pubsync
Obtenez région
Original:
Get area
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::in_avail
basic_streambuf::snextc
basic_streambuf::sbumpc
basic_streambuf::sgetc
basic_streambuf::sgetn
Mettez région
Original:
Put area
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::sputc
basic_streambuf::sputn
Putback
Original:
Putback
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::sputbackc
basic_streambuf::sungetc
Protégé fonctions membres
Original:
Protected 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_streambuf::basic_streambuf
basic_streambuf::operator= (C++11)
basic_streambuf::swap (C++11)
Locales
Original:
Locales
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::imbue
Positionnement
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::setbuf
basic_streambuf::seekoff
basic_streambuf::seekpos
basic_streambuf::sync
Obtenez région
Original:
Get area
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::showmanyc
basic_streambuf::underflow
basic_streambuf::uflow
basic_streambuf::xsgetn
basic_streambuf::eback
basic_streambuf::gptr
basic_streambuf::egptr
basic_streambuf::gbump
basic_streambuf::setg
Mettez région
Original:
Put area
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::xsputn
basic_streambuf::overflow
basic_streambuf::pbase
basic_streambuf::pptr
basic_streambuf::epptr
basic_streambuf::pbump
basic_streambuf::setp
Putback
Original:
Putback
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf::pbackfail
 
basic_streambuf<CharT,Traits>* pubsetbuf( char_type* s, std::streamsize n )
(1)
protected:
virtual basic_streambuf<CharT,Traits>* setbuf( char_type* s, std::streamsize n )
(2)
1)
Appels setbuf(s, n) de la classe la plus dérivée
Original:
Calls setbuf(s, n) of the most derived class
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
La version classe de base de cette fonction n'a aucun effet. Les classes dérivées peuvent substituer cette fonction pour permettre le retrait ou le remplacement de la séquence de caractères contrôlée (le tampon) avec un tableau fourni par l'utilisateur, ou pour toute autre application spécifique but .
Original:
The base class version of this function has no effect. The derived classes may override this function to allow removal or replacement of the controlled character sequence (the buffer) with a user-provided array, or for any other implementation-specific purpose.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Sommaire

[modifier] Paramètres

s -
pointeur vers le premier octet dans le tampon fourni par l'utilisateur
Original:
pointer to the first byte in the user-provided buffer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
n -
le nombre d'octets dans le tampon fourni par l'utilisateur
Original:
the number of bytes in the user-provided buffer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Retourne la valeur

*this

[modifier] Exemple

fournir un tampon 10k pour la lecture. Sur Linux, l'utilitaire strace peut être utilisé pour observer le nombre réel d'octets lus
Original:
provide a 10k buffer for reading. On linux, the strace utility may be used to observe the actual number of bytes read
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <fstream>
#include <iostream>
#include <string>
 
int main()
{
    int cnt=0;
    std::ifstream file;
    char buf[10241];
    file.rdbuf()->pubsetbuf(buf, sizeof buf);
    file.open("/usr/share/dict/words");
    for (std::string line; getline(file, line); ) {
        cnt++;
    }
 
    std::cout << cnt << '\n';
}


[modifier] Voir aussi

[
virtuel
Original:
virtual
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
fourni par l'utilisateur fournit tampon ou désactive cette filebuf mémoire sans tampon
Original:
provides user-supplied buffer or turns this filebuf unbuffered
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre virtuelle protégée de std::basic_filebuf) [edit]