Archivo de encabezado de la biblioteca estándar <istream>
De cppreference.com
Este archivo de encabezado es parte de la biblioteca de Entrada/Salida.
Clases | ||
Envuelve un dispositivo abstracto dado (std::basic_streambuf) y proporciona una interfaz de entrada de alto nivel. (plantilla de clase) | ||
std::istream | std::basic_istream<char> (typedef) | |
std::wistream | std::basic_istream<wchar_t> (typedef) | |
Envuelve un dispositivo abstracto dado (std::basic_streambuf) y proporciona una interfaz de entrada/salida de alto nivel. (plantilla de clase) | ||
std::iostream | std::basic_iostream<char> (typedef) | |
std::wiostream | std::basic_iostream<wchar_t> (typedef) | |
Funciones | ||
extrae caracteres y matrices de caracteres (plantilla de función) | ||
Manipuladores | ||
consume espacio en blanco Original: consumes whitespace The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (plantilla de función) |
[editar] Sinopsis
namespace std { template<class CharT, class Traits = char_traits<CharT>> class basic_istream; using istream = basic_istream<char>; using wistream = basic_istream<wchar_t>; template<class CharT, class Traits = char_traits<CharT>> class basic_iostream; using iostream = basic_iostream<char>; using wiostream = basic_iostream<wchar_t>; template<class CharT, class Traits> basic_istream<CharT, Traits>& ws(basic_istream<CharT, Traits>& is); template<class Istream, class T> Istream&& operator>>(Istream&& is, T&& x); }
[editar] Plantilla de clase std::basic_istream
namespace std { template<class CharT, class Traits = char_traits<CharT>> class basic_istream : virtual public basic_ios<CharT, Traits> { public: // tipos (heredados de basic_ios) using char_type = CharT; using int_type = typename Traits::int_type; using pos_type = typename Traits::pos_type; using off_type = typename Traits::off_type; using traits_type = Traits; // constructor/destructor explicit basic_istream(basic_streambuf<CharT, Traits>* sb); virtual ~basic_istream(); // prefijo/sufijo class sentry; // entrada formateada basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& (*pf)(basic_istream<CharT, Traits>&)); basic_istream<CharT, Traits>& operator>>(basic_ios<CharT, Traits>& (*pf)(basic_ios<CharT, Traits>&)); basic_istream<CharT, Traits>& operator>>(ios_base& (*pf)(ios_base&)); basic_istream<CharT, Traits>& operator>>(bool& n); basic_istream<CharT, Traits>& operator>>(short& n); basic_istream<CharT, Traits>& operator>>(unsigned short& n); basic_istream<CharT, Traits>& operator>>(int& n); basic_istream<CharT, Traits>& operator>>(unsigned int& n); basic_istream<CharT, Traits>& operator>>(long& n); basic_istream<CharT, Traits>& operator>>(unsigned long& n); basic_istream<CharT, Traits>& operator>>(long long& n); basic_istream<CharT, Traits>& operator>>(unsigned long long& n); basic_istream<CharT, Traits>& operator>>(float& f); basic_istream<CharT, Traits>& operator>>(double& f); basic_istream<CharT, Traits>& operator>>(long double& f); basic_istream<CharT, Traits>& operator>>(void*& p); basic_istream<CharT, Traits>& operator>>(basic_streambuf<char_type, Traits>* sb); // entrada no formateada streamsize gcount() const; int_type get(); basic_istream<CharT, Traits>& get(char_type& c); basic_istream<CharT, Traits>& get(char_type* s, streamsize n); basic_istream<CharT, Traits>& get(char_type* s, streamsize n, char_type delim); basic_istream<CharT, Traits>& get(basic_streambuf<char_type, Traits>& sb); basic_istream<CharT, Traits>& get(basic_streambuf<char_type, Traits>& sb, char_type delim); basic_istream<CharT, Traits>& getline(char_type* s, streamsize n); basic_istream<CharT, Traits>& getline(char_type* s, streamsize n, char_type delim); basic_istream<CharT, Traits>& ignore(streamsize n = 1, int_type delim = Traits::eof()); int_type peek(); basic_istream<CharT, Traits>& read (char_type* s, streamsize n); streamsize readsome(char_type* s, streamsize n); basic_istream<CharT, Traits>& putback(char_type c); basic_istream<CharT, Traits>& unget(); int sync(); pos_type tellg(); basic_istream<CharT, Traits>& seekg(pos_type); basic_istream<CharT, Traits>& seekg(off_type, ios_base::seekdir); protected: // constructor de copia/movimiento basic_istream(const basic_istream&) = delete; basic_istream(basic_istream&& rhs); // asignación e intercambio basic_istream& operator=(const basic_istream&) = delete; basic_istream& operator=(basic_istream&& rhs); void swap(basic_istream& rhs); }; // plantillas de extracción de caracteres template<class CharT, class Traits> basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>&, CharT&); template<class Traits> basic_istream<char, Traits>& operator>>(basic_istream<char, Traits>&, unsigned char&); template<class Traits> basic_istream<char, Traits>& operator>>(basic_istream<char, Traits>&, signed char&); template<class CharT, class Traits, size_t N> basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>&, CharT(&)[N]); template<class Traits, size_t N> basic_istream<char, Traits>& operator>>(basic_istream<char, Traits>&, unsigned char(&)[N]); template<class Traits, size_t N> basic_istream<char, Traits>& operator>>(basic_istream<char, Traits>&, signed char(&)[N]); }
[editar] Clase std::basic_istream::sentry
namespace std { template<class CharT, class Traits = char_traits<CharT>> class basic_istream<CharT, Traits>::sentry { bool ok_; // exposition only public: explicit sentry(basic_istream<CharT, Traits>& is, bool noskipws = false); ~sentry(); explicit operator bool() const { return ok_; } sentry(const sentry&) = delete; sentry& operator=(const sentry&) = delete; }; }
[editar] Plantilla de clase std::basic_iostream
namespace std { template<class CharT, class Traits = char_traits<CharT>> class basic_iostream : public basic_istream<CharT, Traits>, public basic_ostream<CharT, Traits> { public: using char_type = CharT; using int_type = typename Traits::int_type; using pos_type = typename Traits::pos_type; using off_type = typename Traits::off_type; using traits_type = Traits; // constructor explicit basic_iostream(basic_streambuf<CharT, Traits>* sb); // destructor virtual ~basic_iostream(); protected: // constructor basic_iostream(const basic_iostream&) = delete; basic_iostream(basic_iostream&& rhs); // asignación e intercambio basic_iostream& operator=(const basic_iostream&) = delete; basic_iostream& operator=(basic_iostream&& rhs); void swap(basic_iostream& rhs); }; }