std::basic_ostream<CharT,Traits>::seekp
De cppreference.com
|
|
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
basic_ostream& seekp( pos_type pos ); |
(1) | |
basic_ostream& seekp( off_type off, std::ios_base::seekdir dir); |
(2) | |
Establece el indicador de posición de salida del objeto
streambuf corriente asociada . 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.
En primer lugar, construye un objeto sentry que controla el flujo de los errores y los colores de la corbata () 'd flujos de salida. (desde C++11) Después,
Original:
First, constructs a sentry object which checks the stream for errors and flushes the tie()'d output streams. (desde 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)
establece el indicador de posición de salida a
pos valor absoluto (en relación con el principio del archivo) llamando rdbuf()->pubseekoff(pos, std::ios_base::out). Si la llamada devuelve (pos_type)-1, ejecuta 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)
establece el indicador de posición de salida para compensar
off relativo a dir llamando rdbuf()->pubseekoff(off, dir, std::ios_base::out). No reportar errores .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.
Parámetros
| pos | - | posición absoluta para establecer el indicador de posición de salida para .
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 | - | posición relativa para establecer el indicador de posición de salida para .
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 | - | define la posición de la base para aplicar el ajuste relativo a. Puede ser uno de las siguientes constantes:
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. |
Valor de retorno
*this
Excepciones
1)
Puede lanzar std::ios_base::failure en caso de fallo, 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.
You can help to correct and verify the translation. Click here for instructions.
2)
No tirar a menos que
rdbuf()->pubseekoff() lanzaOriginal:
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.
Ejemplo
Ejecuta este código
#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';
}
Salida:
Hello, World!
Ver también
| Devuelve el indicador de la posición de salida. (función miembro pública) | |
devuelve el indicador de posición de entrada 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. (función miembro pública de std::basic_istream)
| |
| Establece el indicador de la posición de entrada. (función miembro pública de std::basic_istream)
|