Espaces de noms
Variantes
Affichages
Actions

std::basic_ostream::seekp

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

 
 
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_ostream
Les objets globaux
Original:
Global objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
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_ostream::basic_ostream
basic_ostream::~basic_ostream
basic_ostream::operator= (C++11)
Entrée formaté
Original:
Formatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::operator<<
Entrée non formaté
Original:
Unformatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::put
basic_ostream::write
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_ostream::tellp
basic_ostream::seekp
Divers
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::flush
basic_ostream::swap (C++11)
Classes de membres
Original:
Member classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::sentry
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.
operator<<(std::basic_ostream)
 
basic_ostream& seekp( pos_type pos );
(1)
basic_ostream& seekp( off_type off, std::ios_base::seekdir dir);
(2)
Définit l'indicateur de position de sortie de l'objet associé streambuf courant .
Original:
Sets the output position indicator of the current associated streambuf object.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tout d'abord, construit un objet sentry qui vérifie le flux d'erreurs et les couleurs de la cravate () 'flux de sortie d. (depuis C++11) Ensuite,
Original:
First, constructs a sentry object which checks the stream for errors and flushes the tie()'d output streams. (depuis C++11) Afterwards,
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
définit l'indicateur de position de sortie à pos valeur absolue (par rapport au début du fichier) en appelant rdbuf()->pubseekoff(pos, std::ios_base::out). Si le rendement du (pos_type)-1 appel, exécute setstate(failbit) .
Original:
sets the output position indicator to absolute (relative to the beginning of the file) value pos by calling rdbuf()->pubseekoff(pos, std::ios_base::out). If the call returns (pos_type)-1, executes setstate(failbit).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
définit l'indicateur de position de sortie pour compenser off par rapport à dir en appelant rdbuf()->pubseekoff(off, dir, std::ios_base::out). Ne pas rapporter des erreurs .
Original:
sets the output position indicator to offset off relative to dir by calling rdbuf()->pubseekoff(off, dir, std::ios_base::out). Does not report errors.
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

pos -
position absolue pour régler l'indicateur de position de sortie de .
Original:
absolute position to set the output position indicator to.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
off -
position relative de définir l'indicateur de position de sortie de .
Original:
relative position to set the output position indicator to.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
dir -
définit la position de base pour appliquer le décalage par rapport à. Elle peut être une des constantes suivantes:
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
beg
le début d'un flux
Original:
the beginning of a stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
end
la fin d'un cours d'eau
Original:
the ending of a stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cur
la position actuelle de l'indicateur de position courant
Original:
the current position of stream position indicator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Original:
defines base position to apply the relative offset to. It can be one of the following constants:
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
beg
le début d'un flux
Original:
the beginning of a stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
end
la fin d'un cours d'eau
Original:
the ending of a stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cur
la position actuelle de l'indicateur de position courant
Original:
the current position of stream position indicator
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.

[modifier] Retourne la valeur

*this

[modifier] Exceptions

1)
Peut générer std::ios_base::failure en cas d'échec, si exceptions() & failbit != 0 .
Original:
May throw std::ios_base::failure in case of failure, if exceptions() & failbit != 0.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Ne jetez pas moins rdbuf()->pubseekoff() jette
Original:
Does not throw unless rdbuf()->pubseekoff() throws
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 <sstream>
#include <iostream>
 
int main()
{
    std::ostringstream os("hello, world");
    os.seekp(7);
    os << 'W';
    os.seekp(0, std::ios_base::end);
    os << '!';
    os.seekp(0);
    os << 'H';
    std::cout << os.str() << '\n';
}

Résultat :

Hello, World!

[modifier] Voir aussi

renvoie l'indicateur de position de sortie
Original:
returns the output position indicator
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]
renvoie l'indicateur de position d'entrée
Original:
returns the input position indicator
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]
sets the input position indicator
(fonction membre publique de std::basic_istream) [edit]