Espacios de nombres
Variantes
Acciones

std::basic_istream::seekg

De cppreference.com
< cpp‎ | io‎ | basic istream
 
 
Entrada / salida de la biblioteca
I / O manipuladores
C-estilo 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.
(obsoleto)
Arroyos
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstracciones
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
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.
Cadena de 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.
Matriz 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.
(obsoleto)
(obsoleto)
(obsoleto)
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.
Error interfaz categoría
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.
(C++11)
 
std::basic_istream
Los objetos globales
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.
Las funciones miembro
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.
Entrada con formato
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.
Entrada sin formato
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.
Posicionamiento
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_istream::seekg
Varios
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Clases de miembros
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.
Terceros funciones
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.
 
basic_istream& seekg( pos_type pos );
basic_istream& seekg( off_type off, std::ios_base::seekdir dir);
Establece el indicador de entrada de posición del objeto streambuf corriente asociada. En caso de falla, llama setstate(std::ios_base::failbit) .
Original:
Sets input position indicator of the current associated streambuf object. In case of failure, calls setstate(std::ios_base::failbit).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
En primer lugar, despeja eofbit(desde C++11), entonces se comporta como UnformattedInputFunction, excepto que gcount() no se ve afectada. Después de la construcción y comprobación del objeto centinela
Original:
First, clears eofbit(desde C++11), then behaves as UnformattedInputFunction, except that gcount() is not affected. After constructing and checking the sentry object,
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
establece el indicador de posición de entrada a pos valor absoluto (en relación con el principio del archivo). En concreto, se ejecuta rdbuf()->pubseekpos(pos, std::ios_base::in) .
Original:
sets the input position indicator to absolute (relative to the beginning of the file) value pos. Specifically, executes rdbuf()->pubseekpos(pos, std::ios_base::in).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
establece el indicador de posición de entrada a off posición, relativa a la posición, definida por dir. En concreto, se ejecuta rdbuf()->pubseekoff(off, dir, std::ios_base::in) .
Original:
sets the input position indicator to position off, relative to position, defined by dir. Specifically, executes rdbuf()->pubseekoff(off, dir, std::ios_base::in).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Contenido

[editar] Parámetros

pos -
posición absoluta para establecer el indicador de posición de entrada a .
Original:
absolute position to set the input 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 entrada a .
Original:
relative position to set the input 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:
Constant
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
el inicio de una corriente
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
el final de una secuencia
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 posición actual del indicador de posición corriente
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:
Constant
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
el inicio de una corriente
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
el final de una secuencia
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 posición actual del indicador de posición corriente
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] Ejemplo

#include <iostream>
#include <string>
#include <sstream>
int main()
{
    std::string str = "Hello, world";
    std::istringstream in(str);
    std::string word1, word2;
    in >> word1;
    in.seekg(0); // rewind
    in >> word2;
    std::cout << "word1 = " << word1 << '\n'
              << "word2 = " << word2 << '\n';
}

Salida:

word1 = Hello,
word2 = Hello,

[editar] Ver también

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úblico) [editar]
devuelve el indicador de posición de salida
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.

(función miembro público de std::basic_ostream) [editar]
establece el indicador de posición de salida
Original:
sets 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.

(función miembro público de std::basic_ostream) [editar]