Espaces de noms
Variantes
Affichages
Actions

std::basic_filebuf::seekoff

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

 
 
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_filebuf
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_filebuf::basic_filebuf
basic_filebuf::~basic_filebuf
basic_filebuf::operator= (C++11)
basic_filebuf::swap (C++11)
basic_filebuf::is_open
basic_filebuf::open
basic_filebuf::close
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_filebuf::showmanyc
basic_filebuf::underflow
basic_filebuf::uflow
basic_filebuf::pbackfail
basic_filebuf::overflow
basic_filebuf::setbuf
basic_filebuf::seekoff
basic_filebuf::seekpos
basic_filebuf::sync
basic_filebuf::imbue
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.
swap(std::basic_filebuf) (C++11)
 
protected:

virtual pos_type seekoff( off_type off,
                          std::ios_base::seekdir way,

                          std::ios_base::openmode which = std::ios_base::in | std::ios_base::out );
Repositionne le pointeur de fichier, si possible, à la position qui correspond exactement aux caractères off de début, de fin ou de la position actuelle du fichier (en fonction de la valeur de way .
Original:
Repositions the file pointer, if possible, to the position that corresponds to exactly off characters from beginning, end, or current position of the file (depending on the value of way.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si le fichier associé n'est pas ouvert (is_open()==false, ne immédiatement .
Original:
If the associated file is not open (is_open()==false, fails immediately.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si l'encodage de caractères multi-octets est dépendant de l'état (codecvt::encoding() retourné -1) ou de longueur variable (codecvt::encoding() retourné 0) et le off offset n'est pas 0, échoue immédiatement:. cette fonction ne peut pas déterminer le nombre d'octets qui correspondent à off caractères .
Original:
If the multibyte character encoding is state-dependent (codecvt::encoding() returned -1) or variable-length (codecvt::encoding() returned 0) and the offset off is not 0, fails immediately: this function cannot determine the number of bytes that correspond to off characters.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si way n'est pas std::basic_ios::cur ou le off offset n'est pas 0, et le plus renvoyé opération effectuée sur cet objet filebuf était sortie (qui est, soit le tampon mis n'est pas vide, ou la dernière fonction appelée est overflow()), puis appelle std::codecvt::unshift pour déterminer la séquence unshift nécessaire, et écrit cette séquence dans le fichier en appelant overflow() .
Original:
If way is not std::basic_ios::cur or the offset off is not 0, and the most resent operation done on this filebuf object was output (that is, either the put buffer is not empty, or the most recently called function was overflow()), then calls std::codecvt::unshift to determine the unshift sequence necessary, and writes that sequence to the file by calling overflow().
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
convertit ensuite le way argument d'une valeur de whence int type comme suit:..
Original:
Then converts the argument way to a value whence of type int as follows:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
valeur de way
Original:
value of way
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
value of whence
std::basic_ios::beg SEEK_SET
std::basic_ios::end SEEK_END
std::basic_ios::cur SEEK_CUR
Ensuite, si le caractère encodage est fixé de largeur (codecvt::encoding() retourne une width nombre positif déplace le pointeur de fichier comme par std::fseek(file, width*off, whence) .
Original:
Then, if the character encoding is fixed-width (codecvt::encoding() returns some positive number width, moves the file pointer as if by std::fseek(file, width*off, whence).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Sinon, déplace le pointeur de fichier comme par std::fseek(file, 0, whence) .
Original:
Otherwise, moves the file pointer as if by std::fseek(file, 0, whence).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
L'argument openmode, requis par la signature de la fonction de base de classe , est généralement ignoré, parce que std::basic_filebuf ne conserve qu'une seule position dans le fichier .
Original:
The openmode argument, required by the base class function signature, is usually ignored, because std::basic_filebuf maintains only one file position.
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

off -
position relative de définir l'indicateur de position .
Original:
relative position to set the 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.
which -
qui définit de l'entrée et / ou de séquences de sortie à affecter. Il peut y avoir un ou une combinaison 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
in
affecter la séquence d'entrée
Original:
affect the input sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
out
affecter la séquence de sortie
Original:
affect the output sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Original:
defines which of the input and/or output sequences to affect. It can be one or a combination 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
in
affecter la séquence d'entrée
Original:
affect the input sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
out
affecter la séquence de sortie
Original:
affect the output sequence
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

Un objet nouvellement construit de pos_type type qui stocke la position du fichier qui en résulte, ou en cas d'échec .. pos_type(off_type(-1))
Original:
A newly constructed object of type pos_type which stores the resulting file position, or pos_type(off_type(-1)) on failure.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Notes

seekoff() est appelé par std::basic_streambuf::pubseekoff, qui est appelé par std::basic_istream::seekg, std::basic_ostream::seekp, std::basic_istream::tellg et std::basic_ostream::tellp
Original:
seekoff() is called by std::basic_streambuf::pubseekoff, which is called by std::basic_istream::seekg, std::basic_ostream::seekp, std::basic_istream::tellg, and std::basic_ostream::tellp
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 <iostream>
#include <fstream>
#include <locale>
int main()
{
    // prepare a 10-byte file holding 4 characters in UTF8
    std::ofstream("text.txt") << u8"z\u00df\u6c34\U0001d10b"; // or u8"zß水𝄋"
                                           // or "\x7a\xc3\x9f\xe6\xb0\xb4\xf0\x9d\x84\x8b";
 
    // open using a non-converting encoding
    std::ifstream f1("text.txt");
    std::cout << "f1's locale's encoding() returns "
              << std::use_facet<std::codecvt<char, char, std::mbstate_t>>(f1.getloc()).encoding() << '\n'
              << "pubseekoff(3, beg) returns " << f1.rdbuf()->pubseekoff(3, std::ios_base::beg) << '\n'
              << "pubseekoff(0, end) returns " << f1.rdbuf()->pubseekoff(0, std::ios_base::end) << '\n';;
 
    // open using UTF-8
    std::wifstream f2("text.txt");
    f2.imbue(std::locale("en_US.UTF-8"));
    std::cout << "f2's locale's encoding() returns "
              << std::use_facet<std::codecvt<wchar_t, char, std::mbstate_t>>(f2.getloc()).encoding() << '\n'
              << "pubseekoff(3, beg) returns " << f2.rdbuf()->pubseekoff(3, std::ios_base::beg) << '\n'
              << "pubseekoff(0, end) returns " << f2.rdbuf()->pubseekoff(0, std::ios_base::end) << '\n';
 
}

Résultat :

f1's locale's encoding() returns 1
pubseekoff(3, beg) returns 3
pubseekoff(0, end) returns 10
f2's locale's encoding() returns 0
pubseekoff(3, beg) returns -1
pubseekoff(0, end) returns 10

[modifier] Voir aussi

Invoque seekoff()
Original:
invokes seekoff()
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_streambuf) [edit]
[
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.
]
repositionne la position du fichier, à l'aide d'adressage absolu
Original:
repositions the file position, using absolute addressing
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) [edit]
déplace l'indicateur de position de fichier à un emplacement spécifique dans un fichier
Original:
moves the file position indicator to a specific location in a file
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction) [edit]