std::basic_ostream::seekp
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody> basic_ostream& seekp( pos_type pos ); |
(1) | |
basic_ostream& seekp( off_type off, std::ios_base::seekdir dir); |
(2) | |
Consente di impostare l'indicatore di posizione di uscita della corrente dell'oggetto
streambuf associato. 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.
You can help to correct and verify the translation. Click here for instructions.
In primo luogo, costruisce un oggetto sentry che controlla il flusso di errori e colori la cravatta () 'd flussi di output. (dal C++11) Successivamente,
Original:
First, constructs a sentry object which checks the stream for errors and flushes the tie()'d output streams. (dal 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.
You can help to correct and verify the translation. Click here for instructions.
1)
imposta l'indicatore di posizione di uscita
pos valore assoluto (relativo all'inizio del file) chiamando rdbuf()->pubseekoff(pos, std::ios_base::out). Se la (pos_type)-1 chiamata restituisce, esegue 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.
You can help to correct and verify the translation. Click here for instructions.
2)
imposta l'indicatore di posizione di uscita per compensare
off rispetto al dir chiamando rdbuf()->pubseekoff(off, dir, std::ios_base::out). Non segnalare errori.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.
You can help to correct and verify the translation. Click here for instructions.
Parametri
| pos | - | posizione assoluta per impostare l'indicatore di posizione di uscita .
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 | - | posizione relativa per impostare l'indicatore di posizione di uscita .
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 | - | definisce la posizione di base per applicare l'offset rispetto. Essa può essere una delle seguenti costanti:
Original: defines base position to apply the relative offset to. It can be one of the following constants:
The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Valore di ritorno
*this
Eccezioni
1)
Può gettare std::ios_base::failure in caso di guasto, se
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.
You can help to correct and verify the translation. Click here for instructions.
2)
Non buttare a meno
rdbuf()->pubseekoff() gettaOriginal:
Does not throw unless
rdbuf()->pubseekoff() throwsThe 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.
Esempio
#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';
}
Output:
Hello, World!
Vedi anche
restituisce l'indicatore di posizione di uscita 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. (metodo pubblico) | |
restituisce l'indicatore di posizione di ingresso 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. (metodo pubblico) | |
| sets the input position indicator (metodo pubblico) |