Espaços nominais
Variantes
Acções

std::basic_ostream::seekp

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

 
 
De entrada / saída da biblioteca
I / O manipuladores
C estilo de I / O
Buffers
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(obsoleta)
Streams
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstrações
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
File I / 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
Cordas 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
Matriz de 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(obsoleta)
ostrstream(obsoleta)
strstream(obsoleta)
Tipos
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 de categoria de erro
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
Objetos globais
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.
Funções de membro
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)
Entrada formatada
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<<
Entrada não formatado
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
Posicionamento
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
Diversos
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)
Aulas-Membros
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
Não-membros funções
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)
Define o indicador de posição de saída do objeto atual streambuf associado.
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.
Primeiro, constrói um objeto sentry que verifica o fluxo de erros e libera o empate () 'fluxos de saída d. (a partir do C++ 11) Posteriormente,
Original:
First, constructs a sentry object which checks the stream for errors and flushes the tie()'d output streams. (a partir do 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)
define o indicador de posição de saída para pos valor absoluto (em relação ao início do ficheiro) chamando rdbuf()->pubseekoff(pos, std::ios_base::out). Se a chamada (pos_type)-1 retornos, executa 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)
define o indicador de posição de saída para compensar off relação ao dir chamando rdbuf()->pubseekoff(off, dir, std::ios_base::out). Não reportar erros.
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.

Índice

[editar] Parâmetros

pos -
posição absoluta para definir o indicador de posição de saída 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 -
posição relativa para definir o indicador de posição de saída 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 a posição de base para aplicar a diferença relativa a. Ela pode ser uma das seguintes constantes:
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
o início de um fluxo
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
o fim de um córrego
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
a posição atual do indicador de posição de fluxo
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
o início de um fluxo
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
o fim de um córrego
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
a posição atual do indicador de posição de fluxo
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.

[editar] Valor de retorno

*this

[editar] Exceções

1)
Pode lançar std::ios_base::failure em caso de falha, 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.
2)
Não jogue a menos rdbuf()->pubseekoff() joga
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.

[editar] Exemplo

#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!

[editar] Veja também

retorna o indicador de posição de saída
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.

(função pública membro) [edit]
retorna o indicador de posição 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.

(of std::basic_istream função pública membro) [edit]
sets the input position indicator
(of std::basic_istream função pública membro) [edit]