STD::BASIC_FSTREAM(3cxx)

๐Ÿ’… std::basic_fstream< _CharT, _Traits > โ€” the 3cxx manual page ๐Ÿ’…

okay so bestie, welcome to the group chat for std::basic_fstream< _CharT, _Traits >, the cxx manual page. This is your file-stream bestie: controlling input and output for files, periodt. ๐Ÿ’–


๐ŸŒธ NAME ๐ŸŒธ

std::basic_fstream< _CharT, _Traits > โ€” literally controlling input and output for files. That's the whole assignment. ๐ŸŽ€

โœจ SYNOPSIS โœจ

#include <fstream>

It inherits std::basic_iostream< _CharT, _Traits >. Yes ma'am, that's the family tree. ๐Ÿฆ‹

๐Ÿฆ‹ Public Types ๐Ÿฆ‹

okay so these are the public typedefs and enum vibes, all listed with their exact signatures because we do not skip the boring parts in this house. ๐Ÿ’…

  • typedef ctype< _CharT > __ctype_type
  • typedef ctype< _CharT > __ctype_type โ€” yes bestie, it appears twice in the manual, and we're keeping both. No erasure. ๐Ÿ’–
  • typedef basic_filebuf< char_type, traits_type > __filebuf_type
  • typedef basic_ios< char_type, traits_type > __ios_type
  • typedef basic_iostream< char_type, traits_type > __iostream_type
  • typedef basic_istream< _CharT, _Traits > __istream_type
  • typedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_type
  • typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type
  • typedef basic_ostream< _CharT, _Traits > __ostream_type
  • typedef basic_streambuf< _CharT, _Traits > __streambuf_type
  • typedef basic_streambuf< _CharT, _Traits > __streambuf_type โ€” another repeat, another crumb kept. ๐Ÿซถ
  • typedef _CharT char_type
  • enum event { erase_event, imbue_event, copyfmt_event } โ€” the set of events that may be passed to an event callback.
  • typedef void(* event_callback) (event __e, ios_base &__b, int __i) โ€” the type of an event callback function.
  • typedef _Ios_Fmtflags fmtflags โ€” this is a bitmask type.
  • typedef traits_type::int_type int_type
  • typedef _Ios_Iostate iostate โ€” this is a bitmask type.
  • typedef traits_type::off_type off_type
  • typedef _Ios_Openmode openmode โ€” this is a bitmask type.
  • typedef traits_type::pos_type pos_type
  • typedef _Ios_Seekdir seekdir โ€” this is an enumerated type.
  • typedef _Traits traits_type

and then there's this lil repeat hanging out at the bottom:

  • typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type

๐Ÿ”ฅ Public Member Functions ๐Ÿ”ฅ

deep breath bestie, because this is the big list. Every single one is here, no skips, no "oops I forgot one." ๐Ÿ’…

  • basic_fstream () โ€” default constructor.
  • basic_fstream (basic_fstream &&__rhs)
  • template<typename _Path , typename _Require = _If_fs_path<_Path>> basic_fstream (const _Path &__s, ios_base::openmode __mode=ios_base::in|ios_base::out) โ€” create an input/output file stream.
  • basic_fstream (const basic_fstream &)=delete
  • basic_fstream (const char *__s, ios_base::openmode __mode=ios_base::in|ios_base::out) โ€” create an input/output file stream.
  • basic_fstream (const std::string &__s, ios_base::openmode __mode=ios_base::in|ios_base::out) โ€” create an input/output file stream.
  • ~basic_fstream () โ€” the destructor does nothing. she's literally just vibing. ๐Ÿ’€
  • template<typename _ValueT > basic_istream< _CharT, _Traits > & _M_extract (_ValueT &__v)
  • const locale & _M_getloc () const โ€” locale access.
  • template<typename _ValueT > basic_ostream< _CharT, _Traits > & _M_insert (_ValueT __v)
  • void _M_setstate (iostate __state)
  • bool bad () const โ€” fast error checking.
  • void clear (iostate __state=goodbit) โ€” [Re]sets the error state.
  • void close () โ€” close the file.
  • basic_ios & copyfmt (const basic_ios &__rhs) โ€” copies fields of __rhs into this.
  • bool eof () const โ€” fast error checking.
  • iostate exceptions () const โ€” throwing exceptions on errors.
  • void exceptions (iostate __except) โ€” throwing exceptions on errors.
  • bool fail () const โ€” fast error checking.
  • char_type fill () const โ€” retrieves the empty character.
  • char_type fill (char_type __ch) โ€” sets a new empty character.
  • fmtflags flags () const โ€” access to format flags.
  • fmtflags flags (fmtflags __fmtfl) โ€” setting new format flags all at once.
  • __ostream_type & flush () โ€” synchronizing the stream buffer.
  • streamsize gcount () const โ€” character counting.
  • basic_istream< char > & getline (char_type *__s, streamsize __n, char_type __delim) โ€” explicit specialization declarations, defined in src/istream.cc.
  • basic_istream< wchar_t > & getline (char_type *__s, streamsize __n, char_type __delim)
  • locale getloc () const โ€” locale access.
  • bool good () const โ€” fast error checking.
  • basic_istream< char > & ignore (streamsize __n)
  • basic_istream< wchar_t > & ignore (streamsize __n)
  • basic_istream< char > & ignore (streamsize __n, int_type __delim)
  • basic_istream< wchar_t > & ignore (streamsize __n, int_type __delim)
  • locale imbue (const locale &__loc) โ€” moves to a new locale.
  • bool is_open () โ€” wrapper to test for an open file.
  • bool is_open () const
  • long & iword (int __ix) โ€” access to integer array.
  • char narrow (char_type __c, char __dfault) const โ€” squeezes characters.
  • template<typename _Path > _If_fs_path< _Path, void > open (const _Path &__s, ios_base::openmode __mode=ios_base::in|ios_base::out) โ€” opens an external file.
  • void open (const char *__s, ios_base::openmode __mode=ios_base::in|ios_base::out) โ€” opens an external file.
  • void open (const std::string &__s, ios_base::openmode __mode=ios_base::in|ios_base::out) โ€” opens an external file.
  • __ostream_type & operator<< (__streambuf_type *__sb) โ€” extracting from another streambuf.
  • __ostream_type & operator<< (const void *__p) โ€” pointer arithmetic inserters.
  • __ostream_type & operator<< (nullptr_t)
  • basic_fstream & operator= (basic_fstream &&__rhs)
  • basic_fstream & operator= (const basic_fstream &)=delete
  • __istream_type & operator>> (__streambuf_type *__sb) โ€” extracting into another streambuf.
  • __istream_type & operator>> (void *&__p) โ€” basic arithmetic extractors.
  • streamsize precision () const โ€” flags access.
  • streamsize precision (streamsize __prec) โ€” changing flags.
  • void *& pword (int __ix) โ€” access to void pointer array.
  • __filebuf_type * rdbuf () const โ€” accessing the underlying buffer.
  • basic_streambuf< _CharT, _Traits > * rdbuf (basic_streambuf< _CharT, _Traits > *__sb) โ€” changing the underlying buffer.
  • iostate rdstate () const โ€” returns the error state of the stream buffer.
  • void register_callback (event_callback __fn, int __index) โ€” add the callback __fn with parameter __index.
  • __ostream_type & seekp (off_type, ios_base::seekdir) โ€” changing the current write position.
  • __ostream_type & seekp (pos_type) โ€” changing the current write position.
  • fmtflags setf (fmtflags __fmtfl) โ€” setting new format flags.
  • fmtflags setf (fmtflags __fmtfl, fmtflags __mask) โ€” setting new format flags.
  • void setstate (iostate __state) โ€” sets additional flags in the error state.
  • void swap (basic_fstream &__rhs)
  • pos_type tellp () โ€” getting the current write position.
  • basic_ostream< _CharT, _Traits > * tie () const โ€” fetches the current tied stream.
  • basic_ostream< _CharT, _Traits > * tie (basic_ostream< _CharT, _Traits > *__tiestr) โ€” ties this stream to an output stream.
  • void unsetf (fmtflags __mask) โ€” clearing format flags.
  • char_type widen (char __c) const โ€” widens characters.
  • streamsize width () const โ€” flags access.
  • streamsize width (streamsize __wide) โ€” changing flags.

and there's also these manipulator-interface girlies:

  • __istream_type & operator>> (__istream_type &(*__pf)(__istream_type &)) โ€” interface for manipulators.
  • __istream_type & operator>> (__ios_type &(*__pf)(__ios_type &)) โ€” interface for manipulators.
  • __istream_type & operator>> (ios_base &(*__pf)(ios_base &)) โ€” interface for manipulators.

๐ŸŒˆ Extractors ๐ŸŒˆ

okay so all the operator>> functions โ€” aka formatted input functions โ€” have some common behavior. Each one starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to false. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more. ๐Ÿงš

If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument. simple as that, bestie. โœจ

no cap: if an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state โ€” without causing an ios_base::failure to be thrown โ€” and the original exception will be rethrown if badbit is set in the exceptions mask. keep that in your notes. ๐Ÿ˜ญ
  • __istream_type & operator>> (bool &__n) โ€” integer arithmetic extractors.
  • __istream_type & operator>> (short &__n) โ€” integer arithmetic extractors.
  • __istream_type & operator>> (unsigned short &__n) โ€” integer arithmetic extractors.
  • __istream_type & operator>> (int &__n) โ€” integer arithmetic extractors.
  • __istream_type & operator>> (unsigned int &__n) โ€” integer arithmetic extractors.
  • __istream_type & operator>> (long &__n) โ€” integer arithmetic extractors.
  • __istream_type & operator>> (unsigned long &__n) โ€” integer arithmetic extractors.
  • __istream_type & operator>> (long long &__n) โ€” integer arithmetic extractors.
  • __istream_type & operator>> (unsigned long long &__n) โ€” integer arithmetic extractors.
  • __istream_type & operator>> (float &__f) โ€” floating point arithmetic extractors.
  • __istream_type & operator>> (double &__f) โ€” floating point arithmetic extractors.
  • __istream_type & operator>> (long double &__f) โ€” floating point arithmetic extractors.

๐ŸŽ€ Unformatted Input Functions ๐ŸŽ€

all the unformatted input functions have some common behavior too, bestie. each one starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to true. this has several effects, concluding with the setting of a status flag; see the sentry documentation for more. ๐Ÿ’–

if the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument. ๐Ÿฆ‹

the number of characters extracted is stored for later retrieval by gcount(). she's counting, okay? ๐Ÿ’…

and again, for real: if an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state โ€” without causing an ios_base::failure to be thrown โ€” and the original exception will be rethrown if badbit is set in the exceptions mask. ๐ŸŒธ
  • int_type get () โ€” the simplest little grab there is: one character, straight out of the stream โœจ
  • __istream_type & get (char_type &__c) โ€” also simple extraction, except this one drops the character into __c for you ๐ŸŽ€
  • __istream_type & get (char_type *__s, streamsize __n, char_type __delim) โ€” simple multiple-character extraction, with a delimiter in the mix ๐Ÿ’…
  • __istream_type & get (char_type *__s, streamsize __n) โ€” same multiple-character extraction energy, no delimiter argument ๐Ÿฆ‹
  • __istream_type & get (__streambuf_type &__sb, char_type __delim) โ€” extraction into another streambuf, delimiter included ๐Ÿ‘€
  • __istream_type & get (__streambuf_type &__sb) โ€” extraction into another streambuf, plain and simple ๐Ÿ’œ
  • __istream_type & getline (char_type *__s, streamsize __n, char_type __delim) โ€” string extraction, bestie ๐ŸŒธ
  • __istream_type & getline (char_type *__s, streamsize __n) โ€” string extraction, the two-arg version ๐Ÿซถ
  • __istream_type & ignore (streamsize __n, int_type __delim) โ€” literally just discarding characters ๐Ÿ’€
  • __istream_type & ignore (streamsize __n) โ€” simple extraction (yep, that's what the page calls it) ๐Ÿ™ˆ
  • __istream_type & ignore () โ€” simple extraction again, no args at all โœจ
  • int_type peek () โ€” looking ahead in the stream, no committing, just vibes ๐Ÿ‘‘
  • __istream_type & read (char_type *__s, streamsize __n) โ€” extraction without delimiters, raw and unfiltered ๐Ÿ”ฅ
  • streamsize readsome (char_type *__s, streamsize __n) โ€” extraction until the buffer is exhausted, but no more โ€” lowkey the most honest function here ๐Ÿ˜ญ
  • __istream_type & putback (char_type __c) โ€” unextracting a single character, putting it right back where it came from ๐Ÿงš
  • __istream_type & unget () โ€” unextracting the previous character ๐ŸŒˆ
  • int sync () โ€” synchronizing the stream buffer โญ
  • pos_type tellg () โ€” getting the current read position ๐Ÿ“
  • __istream_type & seekg (pos_type) โ€” changing the current read position ๐Ÿ’ซ
  • __istream_type & seekg (off_type, ios_base::seekdir) โ€” also changing the current read position, just with the offset + seekdir flavour ๐ŸŽ€
  • operator bool () const โ€” the quick-and-easy status check, our fave ๐Ÿซถ
  • bool operator! () const โ€” the quick-and-easy status check, but negated ๐Ÿ’…
  • __ostream_type & operator<< (__ostream_type &(*__pf)(__ostream_type &)) โ€” interface for manipulators โœจ
  • __ostream_type & operator<< (__ios_type &(*__pf)(__ios_type &)) โ€” interface for manipulators, __ios_type edition ๐Ÿฆ‹
  • __ostream_type & operator<< (ios_base &(*__pf)(ios_base &)) โ€” interface for manipulators, ios_base edition ๐ŸŒธ

๐Ÿ”ฅ Inserters ๐Ÿ”ฅ

okay so all the operator<< functions (aka the formatted output functions, iykyk) share some common behavior, and you need to know this part ๐Ÿ‘‘

Each one starts by constructing a temporary object of type std::basic_ostream::sentry. This can have several effects, and it concludes with the setting of a status flag โ€” see the sentry documentation for more, bestie.

If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument ๐Ÿ’–

If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state without causing an ios_base::failure to be thrown. The original exception will then be rethrown. Not me warning you twice ๐Ÿ˜ญ

that rethrow behaviour is not a drill โ€” the badbit gets set and your original exception comes right back at you ๐Ÿ™ˆ
  • __ostream_type & operator<< (long __n) โ€” integer arithmetic inserter ๐Ÿ”ข
  • __ostream_type & operator<< (unsigned long __n) โ€” integer arithmetic inserter ๐Ÿ”ข
  • __ostream_type & operator<< (bool __n) โ€” integer arithmetic inserter ๐Ÿ”ข
  • __ostream_type & operator<< (short __n) โ€” integer arithmetic inserter ๐Ÿ”ข
  • __ostream_type & operator<< (unsigned short __n) โ€” integer arithmetic inserter ๐Ÿ”ข
  • __ostream_type & operator<< (int __n) โ€” integer arithmetic inserter ๐Ÿ”ข
  • __ostream_type & operator<< (unsigned int __n) โ€” integer arithmetic inserter ๐Ÿ”ข
  • __ostream_type & operator<< (long long __n) โ€” integer arithmetic inserter ๐Ÿ”ข
  • __ostream_type & operator<< (unsigned long long __n) โ€” integer arithmetic inserter ๐Ÿ”ข
  • __ostream_type & operator<< (double __f) โ€” floating point arithmetic inserter ๐ŸŒŠ
  • __ostream_type & operator<< (float __f) โ€” floating point arithmetic inserter ๐ŸŒŠ
  • __ostream_type & operator<< (long double __f) โ€” floating point arithmetic inserter ๐ŸŒŠ

๐ŸŒˆ Unformatted Output Functions ๐ŸŒˆ

same deal as the inserters, but unformatted this time โ€” and the details lowkey differ, so pay attention ๐Ÿ’€

All the unformatted output functions have some common behavior. Each starts by constructing a temporary object of type std::basic_ostream::sentry. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more.

If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument โœจ

If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state. If badbit is on in the stream's exceptions mask, the exception will be rethrown without completing its actions. ๐Ÿšจ

like bestie, if badbit is sitting in the exceptions mask, your operation does not get to finish. It rethrows mid-action. That's the whole rule ๐Ÿ™ˆ
  • __ostream_type & put (char_type __c) โ€” simple insertion ๐ŸŽ€
  • __ostream_type & write (const char_type *__s, streamsize __n) โ€” character string insertion ๐Ÿ“

๐Ÿ’– Static Public Member Functions ๐Ÿ’–

  • static bool sync_with_stdio (bool __sync=true) โ€” interaction with the standard C I/O objects ๐Ÿซถ
  • static int xalloc () throw () โ€” access to unique indices โญ

๐Ÿ‘‘ Static Public Attributes ๐Ÿ‘‘

  • static const openmode __noreplace โ€” the page just lists it with zero explanation, so I'm not gonna invent one, bestie ๐Ÿ’€
  • static const fmtflags adjustfield โ€” a mask of left|right|internal. Useful for the 2-arg form of setf ๐ŸŽ€
  • static const openmode app โ€” seek to end before each write ๐Ÿฆ‹
  • static const openmode ate โ€” open and seek to end immediately after opening โœจ
  • static const iostate badbit โ€” indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file) ๐Ÿ’€
  • static const fmtflags basefield โ€” a mask of dec|oct|hex. Useful for the 2-arg form of setf ๐ŸŽ€
  • static const seekdir beg โ€” request a seek relative to the beginning of the stream ๐Ÿ“
  • static const openmode binary โ€” perform input and output in binary mode (as opposed to text mode). This is probably not what you think it is; see https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary ๐Ÿ‘€
  • static const fmtflags boolalpha โ€” insert/extract bool in alphabetic rather than numeric format ๐Ÿ”ค
  • static const seekdir cur โ€” request a seek relative to the current position within the sequence ๐Ÿ“Œ
  • static const fmtflags dec โ€” converts integer input or generates integer output in decimal base ๐Ÿ”ข
  • static const seekdir end โ€” request a seek relative to the current end of the sequence ๐Ÿ
  • static const iostate eofbit โ€” indicates that an input operation reached the end of an input sequence ๐ŸŒ™
  • static const iostate failbit โ€” indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters ๐Ÿ˜ญ
  • static const fmtflags fixed โ€” generate floating-point output in fixed-point notation ๐Ÿ“
  • static const fmtflags floatfield โ€” a mask of scientific|fixed. Useful for the 2-arg form of setf ๐ŸŽ€
  • static const iostate goodbit โ€” indicates all is well ๐ŸŒธ
  • static const fmtflags hex โ€” converts integer input or generates integer output in hexadecimal base ๐Ÿ”ข
  • static const openmode in โ€” open for input. Default for ifstream and fstream ๐Ÿ“ฅ
  • static const fmtflags internal โ€” adds fill characters at a designated internal point in certain generated output, or identical to right if no such point is designated ๐ŸŽฏ
  • static const fmtflags left โ€” adds fill characters on the right (final positions) of certain generated output. (I.e., the thing you print is flush left.) โฌ…๏ธ
  • static const fmtflags oct โ€” converts integer input or generates integer output in octal base ๐Ÿ”ข
  • static const openmode out โ€” open for output. Default for ofstream and fstream ๐Ÿ“ค
  • static const fmtflags right โ€” adds fill characters on the left (initial positions) of certain generated output. (I.e., the thing you print is flush right.) โžก๏ธ
  • static const fmtflags scientific โ€” generates floating-point output in scientific notation ๐Ÿงช
  • static const fmtflags showbase โ€” generates a prefix indicating the numeric base of generated integer output ๐Ÿท๏ธ
  • static const fmtflags showpoint โ€” generates a decimal-point character unconditionally in generated floating-point output ๐Ÿ’ง
  • static const fmtflags showpos โ€” generates a + sign in non-negative generated numeric output โž•
  • static const fmtflags skipws โ€” skips leading white space before certain input operations ๐Ÿซง
  • static const openmode trunc โ€” truncate an existing stream when opening. Default for ofstream โœ‚๏ธ
  • static const fmtflags unitbuf โ€” flushes output after each output operation ๐Ÿšฟ
  • static const fmtflags uppercase โ€” replaces certain lowercase letters with their uppercase equivalents in generated output ๐Ÿ” 

๐Ÿงš Protected Types ๐Ÿงš

  • enum { _S_local_word_size } โ€” that's the whole entry, no notes attached ๐Ÿ’…

๐Ÿ’œ Protected Member Functions ๐Ÿ’œ

  • void _M_cache_locale (const locale &__loc)
  • void _M_call_callbacks (event __ev) throw ()
  • void _M_dispose_callbacks (void) throw ()
  • template<typename _ValueT > __istream_type & _M_extract (_ValueT &__v)
  • _Words & _M_grow_words (int __index, bool __iword)
  • void _M_init () throw ()
  • template<typename _ValueT > __ostream_type & _M_insert (_ValueT __v)
  • void _M_move (ios_base &) noexcept
  • void _M_swap (ios_base &__rhs) noexcept
  • void init (basic_streambuf< _CharT, _Traits > *__sb) โ€” all setup is performed here ๐Ÿ› ๏ธ
  • void move (basic_ios &&__rhs)
  • void move (basic_ios &__rhs)
  • void set_rdbuf (basic_streambuf< _CharT, _Traits > *__sb)
  • void swap (basic_ios &__rhs) noexcept
  • void swap (basic_iostream &__rhs)
  • void swap (basic_istream &__rhs)
  • void swap (basic_ostream &__rhs)

๐Ÿ“ Protected Attributes ๐Ÿ“

  • _Callback_list * _M_callbacks
  • const __ctype_type * _M_ctype
  • iostate _M_exception
  • char_type _M_fill
  • bool _M_fill_init
  • fmtflags _M_flags
  • streamsize _M_gcount
  • locale _M_ios_locale
  • _Words _M_local_word [_S_local_word_size]
  • const __num_get_type * _M_num_get
  • const __num_put_type * _M_num_put
  • streamsize _M_precision
  • basic_streambuf< _CharT, _Traits > * _M_streambuf
  • iostate _M_streambuf_state
  • basic_ostream< _CharT, _Traits > * _M_tie
  • streamsize _M_width
  • _Words * _M_word
  • int _M_word_size
  • _Words _M_word_zero

๐ŸŒŸ Detailed Description ๐ŸŒŸ

template<typename _CharT, typename _Traits>
    class std::basic_fstream< _CharT, _Traits >

Controlling input and output for files. periodt ๐Ÿ’…

๐ŸŽ€ Template Parameters ๐ŸŽ€

  • _CharT โ€” type of character stream ๐Ÿ”ค
  • _Traits โ€” traits for character type, defaults to char_traits<_CharT> ๐Ÿงฌ

This class supports reading from and writing to named files, using the inherited functions from std::basic_iostream. To control the associated sequence, an instance of std::basic_filebuf is used โ€” and this page refers to that instance as sb ๐Ÿซถ

๐Ÿงฌ Member Typedef Documentation

โœจ __num_put_type โ€” inherited, and very much a "non-standard" girlie

template<typename _CharT , typename _Traits > typedef num_put<_CharT,
    ostreambuf_iterator<_CharT, _Traits> > std::basic_ios< _CharT, _Traits
    >::__num_put_type [inherited]

These are non-standard types. That's it, that's the whole note โ€” they're not part of the standard, so don't go assuming anything extra about them ๐Ÿ’…

๐ŸŽ€ event_callback โ€” inherited

typedef void(* std::ios_base::event_callback) (event __e, ios_base &__b, int
    __i) [inherited]

It's the type of an event callback function. Iconic little function pointer, lowkey.

Parameters

  • __e โ€” one of the members of the event enum.
  • __b โ€” a reference to the ios_base object.
  • __i โ€” the integer that was provided when the callback got registered.

So here's the vibe check: event callbacks are user-defined functions that get called during several ios_base and basic_ios functions โ€” specifically imbue(), copyfmt(), and ~ios().

๐Ÿฆ‹ fmtflags โ€” inherited, bitmask royalty

typedef _Ios_Fmtflags std::ios_base::fmtflags [inherited]

This is a bitmask type. _Ios_Fmtflags is implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen, fr fr.

Defined objects of type fmtflags are:

  • boolalpha
  • dec
  • fixed
  • hex
  • internal
  • left
  • oct
  • right
  • scientific
  • showbase
  • showpoint
  • showpos
  • skipws
  • unitbuf
  • uppercase
  • adjustfield
  • basefield
  • floatfield

๐ŸŒธ iostate โ€” inherited

typedef _Ios_Iostate std::ios_base::iostate [inherited]

Also a bitmask type. _Ios_Iostate is implementation-defined, but yeah โ€” bitwise ops on these values, Right Thing, you know the drill โœจ

Defined objects of type iostate are:

  • badbit
  • eofbit
  • failbit
  • goodbit

๐ŸŽ€ openmode โ€” inherited

typedef _Ios_Openmode std::ios_base::openmode [inherited]

Bitmask type again, bestie. _Ios_Openmode is implementation-defined, and it is valid to perform bitwise operations on these values and expect the Right Thing to happen.

Defined objects of type openmode are:

  • app
  • ate
  • binary
  • in
  • out
  • trunc

๐Ÿงš seekdir โ€” inherited

typedef _Ios_Seekdir std::ios_base::seekdir [inherited]

This one's an enumerated type. _Ios_Seekdir is implementation-defined. Defined values of type seekdir are:

  • beg
  • cur, equivalent to SEEK_CUR in the C standard library.
  • end, equivalent to SEEK_END in the C standard library.

๐Ÿ”ฎ Member Enumeration Documentation

enum std::ios_base::event โ€” inherited

It's the set of events that may be passed to an event callback. Let's break it down:

  • erase_event is used during ~ios() and copyfmt().
  • imbue_event is used during imbue().
  • copyfmt_event is used during copyfmt().

Periodt. Three events, three places they show up ๐Ÿ’€


๐Ÿ› ๏ธ Constructor & Destructor Documentation

basic_fstream() โ€” the default one

template<typename _CharT , typename _Traits > std::basic_fstream< _CharT,
    _Traits >::basic_fstream () [inline]

Default constructor, bestie. It initializes sb using its own default constructor, and then passes &sb to the base class initializer. Does it open any files? Nope โ€” you haven't given it a filename to open, so there's literally nothing to open ๐Ÿ™ˆ

References: std::basic_ios< _CharT, _Traits >::init().

basic_fstream(const char* __s, ...) โ€” the C-string one

template<typename _CharT , typename _Traits > std::basic_fstream< _CharT,
    _Traits >::basic_fstream (const char * __s, ios_base::openmode __mode =
    ios_base::in | ios_base::out) [inline],  [explicit]

Create an input/output file stream. Two-for-one, we love to see it ๐Ÿซถ

Parameters

  • __s โ€” null terminated string specifying the filename.
  • __mode โ€” open file in specified mode (see std::ios_base).

References: std::basic_ios< _CharT, _Traits >::init(), and std::basic_fstream< _CharT, _Traits >::open().

basic_fstream(const std::string& __s, ...) โ€” the std::string one

template<typename _CharT , typename _Traits > std::basic_fstream< _CharT,
    _Traits >::basic_fstream (const std::string & __s, ios_base::openmode
    __mode = ios_base::in | ios_base::out) [inline],  [explicit]

Create an input/output file stream. Same energy, but now with a std::string filename, which is honestly so much nicer than raw C strings, no cap.

Parameters

  • __s โ€” null terminated string specifying the filename.
  • __mode โ€” open file in specified mode (see std::ios_base).

References: std::basic_ios< _CharT, _Traits >::init(), and std::basic_fstream< _CharT, _Traits >::open().

basic_fstream(const _Path& __s, ...) โ€” the filesystem::path one

template<typename _CharT , typename _Traits > template<typename _Path ,
    typename _Require  = _If_fs_path<_Path>> std::basic_fstream< _CharT,
    _Traits >::basic_fstream (const _Path & __s, ios_base::openmode __mode =
    ios_base::in | ios_base::out) [inline]

Create an input/output file stream. Yes, there's a template-on-template situation happening here, and yes, it's fine โœจ

Parameters

  • __s โ€” filesystem::path specifying the filename.
  • __mode โ€” open file in specified mode (see std::ios_base).

~basic_fstream() โ€” the destructor

template<typename _CharT , typename _Traits > std::basic_fstream< _CharT,
    _Traits >::~basic_fstream () [inline]

Plot twist: the destructor does nothing ๐Ÿ’€ The file is closed by the filebuf object, not the formatting stream. So don't be out here crediting the wrong object, iykyk.


๐Ÿ’œ Member Function Documentation

_M_getloc() โ€” inherited, the locale access one

const locale & std::ios_base::_M_getloc () const [inline],  [inherited]

Locale access, in all its underscored glory.

Returns: a reference to the current locale.

Like getloc above, but returns a reference instead of generating a copy. Efficient icon behavior ๐ŸŽ€

Referenced by:

  • std::money_get< _CharT, _InIter >::do_get()
  • std::time_get< _CharT, _InIter >::do_get()
  • std::num_get< _CharT, _InIter >::do_get()
  • std::time_get< _CharT, _InIter >::do_get_date()
  • std::time_get< _CharT, _InIter >::do_get_monthname()
  • std::time_get< _CharT, _InIter >::do_get_time()
  • std::time_get< _CharT, _InIter >::do_get_weekday()
  • std::time_get< _CharT, _InIter >::do_get_year()
  • std::num_put< _CharT, _OutIter >::do_put()
  • std::time_put< _CharT, _OutIter >::do_put()
  • std::time_get< _CharT, _InIter >::get()
  • std::time_put< _CharT, _OutIter >::put()

bad() โ€” inherited, fast error checking

template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
    _Traits >::bad () const [inline],  [inherited]

Fast error checking. Snappy little bool, we stan.

Returns: true if the badbit is set.

Small caveat though โ€” note that other iostate flags may also be set. So don't read this as "everything is fine," okay? ๐Ÿ™ˆ

References: std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::rdstate().

Referenced by: std::basic_ostream< _CharT, _Traits >::sentry::sentry().

clear() โ€” inherited, the [re]setter

template<typename _CharT , typename _Traits > void std::basic_ios< _CharT,
    _Traits >::clear (iostate __state = goodbit) [inherited]

[Re]sets the error state. The brackets are doing so much work there and honestly? Slay.

Parameters

  • __state โ€” the new state flag(s) to set.

See std::ios_base::iostate for the possible bit values. Most users will not need to pass an argument. (Like, most of y'all can just call it and move on ๐Ÿ’…)

Referenced by: okay bestie, buckle up, and yes โ€” several of these are literally listed twice in the docs, that's just how it is ๐Ÿ’€

  • std::basic_ios< _CharT, _Traits >::exceptions()
  • std::basic_ifstream< _CharT, _Traits >::open()
  • std::basic_fstream< _CharT, _Traits >::open()
  • std::basic_ofstream< _CharT, _Traits >::open()
  • std::basic_ifstream< _CharT, _Traits >::open()
  • std::basic_fstream< _CharT, _Traits >::open()
  • std::basic_ofstream< _CharT, _Traits >::open()
  • std::__detail::operator>>()
  • std::basic_istream< _CharT, _Traits >::putback()
  • std::basic_istream< _CharT, _Traits >::seekg()
  • std::basic_istream< _CharT, _Traits >::seekg()
  • std::basic_ios< _CharT, _Traits >::setstate()
  • std::basic_istream< _CharT, _Traits >::unget()

close() โ€” shut it down ๐Ÿšช

template<typename _CharT , typename _Traits > void std::basic_fstream<
    _CharT, _Traits >::close () [inline]

Close the file. It calls std::basic_filebuf::close(). And if that function fails? failbit gets set in the stream's error state. So like, always check, bestie.

References: std::basic_filebuf< _CharT, _Traits >::close(), std::ios_base::failbit, and std::basic_ios< _CharT, _Traits >::setstate().

copyfmt() โ€” inherited, the copy-everything one

template<typename _CharT , typename _Traits > basic_ios< _CharT, _Traits > &
    std::basic_ios< _CharT, _Traits >::copyfmt (const basic_ios< _CharT,
    _Traits > & __rhs) [inherited]

Copies fields of __rhs into this object. The way this one has rules, though ๐Ÿ‘‘

Parameters

  • __rhs โ€” the source values for the copies.

Returns: a reference to this object.

So here's what actually happens: all fields of __rhs are copied into this object except that rdbuf() and rdstate() remain unchanged. All values in the pword and iword arrays are copied too. Before copying, each callback is invoked with erase_event. After copying, each (new) callback is invoked with copyfmt_event. And the final step? Copy exceptions().

References: std::__addressof(), std::basic_ios< _CharT, _Traits >::exceptions(), std::basic_ios< _CharT, _Traits >::fill(), std::ios_base::flags(), std::ios_base::getloc(), std::ios_base::precision(), std::basic_ios< _CharT, _Traits >::tie(), std::tie(), and std::ios_base::width().

eof() โ€” inherited, fast error checking

template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
    _Traits >::eof () const [inline],  [inherited]

Fast error checking, part two.

Returns: true if the eofbit is set.

And again โ€” note that other iostate flags may also be set. One flag being set does not mean the others aren't lurking ๐Ÿ‘€

References: std::ios_base::eofbit, and std::basic_ios< _CharT, _Traits >::rdstate().

exceptions() โ€” inherited, the read-only one

template<typename _CharT , typename _Traits > iostate std::basic_ios<
    _CharT, _Traits >::exceptions () const [inline],  [inherited]

Throwing exceptions on errors โ€” well, reading about them right now.

Returns: the current exceptions mask.

This changes nothing in the stream. It's purely a read, bestie. See the one-argument version of exceptions(iostate) for the meaning of the return value.

Referenced by: std::basic_ios< _CharT, _Traits >::copyfmt().

exceptions(iostate) โ€” inherited, the one that actually throws ๐Ÿ˜ญ

template<typename _CharT , typename _Traits > void std::basic_ios< _CharT,
    _Traits >::exceptions (iostate __except) [inline],  [inherited]

Throwing exceptions on errors. This is the spicy one.

Parameters

  • __except โ€” the new exceptions mask.

By default, error flags are set silently. Very demure, very mindful. But you can set an exceptions mask for each stream: if a bit in the mask becomes set in the error flags, then an exception of type std::ios_base::failure is thrown.

And here's the part that gets people: if the error flag is already set when the exceptions mask is added, the exception is immediately thrown. Try running the following under GCC 3.1 or later:

#include <iostream>
#include <fstream>
#include <exception>

int main()
{
    std::set_terminate (__gnu_cxx::__verbose_terminate_handler);

    std::ifstream f ("/etc/motd");

    std::cerr << "Setting badbit\n";
    f.setstate (std::ios_base::badbit);

    std::cerr << "Setting exception mask\n";
    f.exceptions (std::ios_base::badbit);
}

References: std::basic_ios< _CharT, _Traits >::clear().

fail() โ€” inherited, fast error checking (the third one)

template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
    _Traits >::fail () const [inline],  [inherited]

Fast error checking, back again.

Returns: true if either the badbit or the failbit is set.

Checking the badbit in fail() is historical practice โ€” that's just the lore, don't question it. And note that other iostate flags may also be set.

References: std::ios_base::badbit, std::ios_base::failbit, and std::basic_ios< _CharT, _Traits >::rdstate().

Referenced by:

  • std::basic_ios< _CharT, _Traits >::operator bool()
  • std::basic_ios< _CharT, _Traits >::operator!()
  • std::basic_istream< _CharT, _Traits >::seekg()
  • std::basic_istream< _CharT, _Traits >::seekg()
  • std::basic_ostream< _CharT, _Traits >::seekp()
  • std::basic_ostream< _CharT, _Traits >::seekp()
  • std::basic_istream< _CharT, _Traits >::tellg()
  • std::basic_ostream< _CharT, _Traits >::tellp()
  • std::regex_traits< _Ch_type >::value()

fill() โ€” inherited, the empty-character girlie

template<typename _CharT , typename _Traits > char_type std::basic_ios<
    _CharT, _Traits >::fill () const [inline],  [inherited]

Retrieves the empty character. Cute little getter, does exactly what it says ๐ŸŽ€

Returns: the current fill character.

It defaults to a space (' ') in the current locale, periodt. That's just the vibe.

References std::basic_ios< _CharT, _Traits >::widen().

Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), and std::basic_ios< _CharT, _Traits >::fill().


๐ŸŽ€ template<typename _CharT , typename _Traits > char_type std::basic_ios< _CharT, _Traits >::fill (char_type __ch) [inline], [inherited]

Sets a new empty character. Bestie, you're literally choosing what fills the gaps. <sparkle>โœจ</sparkle>

Parameters

  • __ch โ€” the new character. That's the one, mwah.

Returns

  • The previous fill character. The one it was before โ€” like, the ex-fill-character ๐Ÿ’…

The fill character is used to fill out space when P+ characters have been requested (e.g., via setw), Q characters are actually used, and Q<P. It defaults to a space (' ') in the current locale.

References std::basic_ios< _CharT, _Traits >::fill().


๐ŸŒธ fmtflags std::ios_base::flags () const [inline], [inherited]

Access to format flags. Reading the whole format-control fit check ๐Ÿ‘‘

Returns

  • The format control flags for both input and output.

Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), std::num_put< _CharT, _OutIter >::do_put(), std::normal_distribution< double >::operator()(), std::operator<<(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), std::__detail::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), and std::operator>>(). No cap, that's the whole list, not me editing it down fr fr.


๐Ÿฆ‹ fmtflags std::ios_base::flags (fmtflags __fmtfl) [inline], [inherited]

Setting new format flags all at once. Glow-up for the whole flag set, one call โœ…

Parameters

  • __fmtfl โ€” the new flags to set.

Returns

  • The previous format control flags.

This function overwrites all the format flags with __fmtfl. Like, every single one. It's not a merge, it's a takeover.


๐Ÿ’œ template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::flush () [inherited]

Synchronizing the stream buffer. Making sure everything's actually made it out the door ๐Ÿƒโ€โ™€๏ธ

Returns

  • *this

If rdbuf() is a null pointer, changes nothing. Nothing happened, and that's fine.

Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit.

References std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

Referenced by std::flush().


๐Ÿ“ template<typename _CharT , typename _Traits > streamsize std::basic_istream< _CharT, _Traits >::gcount () const [inline], [inherited]

Character counting. Keeping score of how many chars actually got extracted ๐Ÿ”ข

Returns

  • The number of characters extracted by the previous unformatted input function dispatched for this stream.

References std::basic_istream< _CharT, _Traits >::_M_gcount.


๐ŸŒˆ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits >::int_type std::basic_istream< _CharT, _Traits >::get (void) [inherited]

Simple extraction. One char, no thoughts, just vibes โœจ

Returns

  • A character, or eof().

Tries to extract a character. If none are available, sets failbit and returns traits::eof().

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

Referenced by std::basic_istream< _CharT, _Traits >::get(), and std::basic_istream< _CharT, _Traits >::get().


๐Ÿงš template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb) [inline], [inherited]

Extraction into another streambuf. Handing your chars off to a different buffer, cute ๐ŸŽ€

Parameters

  • __sb โ€” a streambuf in which to store data.

Returns

  • *this

Returns get(__sb,widen('\n')).

References std::basic_istream< _CharT, _Traits >::get(), and std::basic_ios< _CharT, _Traits >::widen().


๐Ÿ’ซ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb, char_type __delim) [inherited]

Extraction into another streambuf โ€” but with a stop character this time, iykyk ๐Ÿ›‘

Parameters

  • __sb โ€” a streambuf in which to store data.
  • __delim โ€” a 'stop' character.

Returns

  • *this

Characters are extracted and inserted into __sb until one of the following happens:

  • the input sequence reaches EOF
  • insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted)
  • the next character equals __delim (in this case, the character is not extracted)
  • an exception occurs (and in this case is caught)

If no characters are stored, failbit is set in the stream's error state.

References std::basic_istream< _CharT, _Traits >::_M_gcount, and std::ios_base::goodbit.


๐ŸŒธ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (char_type & __c) [inherited]

Simple extraction, but storing into a reference this time ๐Ÿ’–

Parameters

  • __c โ€” the character in which to store data.

Returns

  • *this

Tries to extract a character and store it in __c. If none are available, sets failbit and returns traits::eof().

Note: this function is not overloaded on signed char and unsigned char. So don't come at it with those, it will not hear you.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().


๐ŸŽ€ template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::get (char_type * __s, streamsize __n) [inline], [inherited]

Simple multiple-character extraction. Array time bestie ๐Ÿ“š

Parameters

  • __s โ€” pointer to an array.
  • __n โ€” maximum number of characters to store in s.

Returns

  • *this

Returns get(__s,__n,widen('\n')).

References std::basic_istream< _CharT, _Traits >::get(), and std::basic_ios< _CharT, _Traits >::widen().


๐Ÿ‘‘ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (char_type * __s, streamsize __n, char_type __delim) [inherited]

Simple multiple-character extraction, now with a delim. The full package deal ๐Ÿ’…

Parameters

  • __s โ€” pointer to an array.
  • __n โ€” maximum number of characters to store in __s.
  • __delim โ€” a 'stop' character.

Returns

  • *this

Characters are extracted and stored into __s until one of the following happens:

  • __n-1 characters are stored
  • the input sequence reaches EOF
  • the next character equals __delim, in which case the character is not extracted

If no characters are stored, failbit is set in the stream's error state.

In any case, a null character is stored into the next location in the array.

Note: this function is not overloaded on signed char and unsigned char. Same energy as before โ€” it simply does not do that.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().


๐Ÿฆ‹ template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::getline (char_type * __s, streamsize __n) [inline], [inherited]

String extraction. Reading a whole line like the main character you are ๐ŸŒŸ

Parameters

  • __s โ€” a character array in which to store the data.
  • __n โ€” maximum number of characters to extract.

Returns

  • *this

Returns getline(__s,__n,widen('\n')).

References std::basic_istream< _CharT, _Traits >::getline(), and std::basic_ios< _CharT, _Traits >::widen().


๐Ÿ’œ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::getline (char_type * __s, streamsize __n, char_type __delim) [inherited]

String extraction with a stop character. This is the one with the actual rules, so listen up ๐Ÿ“‹

Parameters

  • __s โ€” a character array in which to store the data.
  • __n โ€” maximum number of characters to extract.
  • __delim โ€” a 'stop' character.

Returns

  • *this

Extracts and stores characters into __s until one of the following happens. Note that these criteria are required to be tested in the order listed here, to allow an input line to exactly fill the __s array without setting failbit. Order matters, bestie, don't rearrange them.

  1. the input sequence reaches end-of-file, in which case eofbit is set in the stream error state
  2. the next character equals __delim, in which case the character is extracted (and therefore counted in gcount()) but not stored
  3. __n-1 characters are stored, in which case failbit is set in the stream error state

If no characters are extracted, failbit is set. (An empty line of input should therefore not cause failbit to be set.) Empty line? Valid. Iconic even.

In any case, a null character is stored in the next location in the array.

Referenced by std::basic_istream< _CharT, _Traits >::getline().


๐ŸŒˆ basic_istream< char > & std::basic_istream< char >::getline (char_type * __s, streamsize __n, char_type __delim) [inherited]

Explicit specialization declarations, defined in src/istream.cc. Special-cased for char, bestie โ€” that's the whole note.


๐ŸŽ€ locale std::ios_base::getloc () const [inline], [inherited]

Locale access. Peeking at which locale is currently loaded ๐ŸŒ

Returns

  • A copy of the current locale.

If imbue(loc) has previously been called, then this function returns loc. Otherwise, it returns a copy of std::locale(), the global C++ locale.

Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), std::money_put< _CharT, _OutIter >::do_put(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), and std::ws().


โญ template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT, _Traits >::good () const [inline], [inherited]

Fast error checking. The quick vibe check of the stream world โœ…

Returns

  • True if no error flags are set.

A wrapper around rdstate.

References std::basic_ios< _CharT, _Traits >::rdstate().

Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and std::__detail::operator>>().


๐Ÿ’€ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (void) [inherited]

Simple extraction. Yeah the doc says "extraction" here, we're just rolling with it, don't @ me ๐Ÿ™ˆ

Returns

  • A character, or eof().

Tries to extract a character. If none are available, sets failbit and returns traits::eof().

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sbumpc().


๐Ÿ”ฅ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n) [inherited]

Simple extraction, with a count. Yes, same description as above โ€” the docs said what they said ๐Ÿ’…

Returns

  • A character, or eof().

Tries to extract a character. If none are available, sets failbit and returns traits::eof().

  • template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n, int_type __delim) [inherited] โ€” bestie this one is literally the "trash it" button, aka Discarding characters.

Parameters

  • __n โ€” Number of characters to discard.
  • __delim โ€” A 'stop' character.

Returns *this

So it extracts characters and just throws them away (no cap, we don't want them) until ONE of these things happens:

  • if __n != std::numeric_limits<int>::max(), __n characters are extracted
  • the input sequence reaches end-of-file
  • the next character equals __delim (and in this case, the character is extracted) โ€” but heads up, this condition will never occur if __delim equals traits::eof() ๐Ÿ’€
NB: Provide three overloads, instead of the single function (with defaults) mandated by the Standard: this leads to a better performing implementation, while still conforming to the Standard. Slay, honestly. โœจ

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().

  • template<typename _CharT , typename _Traits > locale std::basic_ios< _CharT, _Traits >::imbue (const locale & __loc) [inherited] โ€” Moves to a new locale. it's giving โœจglow-upโœจ but for language settings.

Parameters

  • __loc โ€” The new locale.

Returns The previous locale. (yes, it remembers the old one, iconic behaviour)

Calls ios_base::imbue(loc), and if a stream buffer is associated with this stream, calls that buffer's pubimbue(loc).

Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html

References std::ios_base::imbue().

Referenced by std::chrono::operator<<().

  • template<typename _CharT , typename _Traits > void std::basic_ios< _CharT, _Traits >::init (basic_streambuf< _CharT, _Traits > * __sb) [protected], [inherited] โ€” All setup is performed here. literally the backstage crew of the stream ๐ŸŽ€ This is called from the public constructor. It is not virtual and cannot be redefined. no take-backs, no overrides, periodt.

Referenced by std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ios< _CharT, _Traits >::basic_ios(), std::basic_istream< _CharT, _Traits >::basic_istream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ostream< _CharT, _Traits >::basic_ostream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream(), std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream(), and std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream(). (that's a lot of names, we love a supportive cast ๐Ÿ’–)

  • template<typename _CharT , typename _Traits > bool std::basic_fstream< _CharT, _Traits >::is_open () [inline] โ€” Wrapper to test for an open file. tiny little vibe check: is the file open or not ๐Ÿฆ‹

Returns rdbuf()->is_open()

References std::basic_filebuf< _CharT, _Traits >::is_open().

  • long & std::ios_base::iword (int __ix) [inline], [inherited] โ€” Access to integer array. your personal little integer storage cubby ๐Ÿ”ฅ

Parameters

  • __ix โ€” Index into the array.

Returns A reference to an integer associated with the index.

The iword function provides access to an array of integers that can be used for any purpose. The array grows as required to hold the supplied index. All integers in the array are initialized to 0.

The implementation reserves several indices. You should use xalloc to obtain an index that is safe to use. Also note that since the array can grow dynamically, it is not safe to hold onto the reference. bestie please do not cling, the array is a main character who changes ๐Ÿ’…
  • template<typename _CharT , typename _Traits > char std::basic_ios< _CharT, _Traits >::narrow (char_type __c, char __dfault) const [inline], [inherited] โ€” Squeezes characters. not me making your wide chars fit into a regular char ๐Ÿ˜ญ

Parameters

  • __c โ€” The character to narrow.
  • __dfault โ€” The character to narrow.

Returns The narrowed character.

Maps a character of char_type to a character of char, if possible.

Returns the result of

std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)

Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html

  • template<typename _CharT , typename _Traits > template<typename _Path > _If_fs_path< _Path, void > std::basic_fstream< _CharT, _Traits >::open (const _Path & __s, ios_base::openmode __mode = ios_base::in | ios_base::out) [inline] โ€” Opens an external file. the filesystem::path flavour, fancy โœจ

Parameters

  • __s โ€” The name of the file, as a filesystem::path.
  • __mode โ€” The open mode flags.

Calls std::basic_filebuf::open(__s,__mode). If that function fails, failbit is set in the stream's error state.

References std::basic_fstream< _CharT, _Traits >::open().

  • template<typename _CharT , typename _Traits > void std::basic_fstream< _CharT, _Traits >::open (const char * __s, ios_base::openmode __mode = ios_base::in | ios_base::out) [inline] โ€” Opens an external file. the classic C-string version, old money ๐ŸŽ€

Parameters

  • __s โ€” The name of the file.
  • __mode โ€” The open mode flags.

Calls std::basic_filebuf::open(__s,__mode). If that function fails, failbit is set in the stream's error state.

References std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::failbit, std::basic_filebuf< _CharT, _Traits >::open(), and std::basic_ios< _CharT, _Traits >::setstate().

Referenced by std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_fstream< _CharT, _Traits >::basic_fstream(), and std::basic_fstream< _CharT, _Traits >::open().

  • template<typename _CharT , typename _Traits > void std::basic_fstream< _CharT, _Traits >::open (const std::string & __s, ios_base::openmode __mode = ios_base::in | ios_base::out) [inline] โ€” Opens an external file. and this one takes a std::string because we're not always out here with raw pointers bestie ๐Ÿ’œ

Parameters

  • __s โ€” The name of the file.
  • __mode โ€” The open mode flags.

Calls std::basic_filebuf::open(__s,__mode). If that function fails, failbit is set in the stream's error state.

References std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::failbit, std::basic_filebuf< _CharT, _Traits >::open(), and std::basic_ios< _CharT, _Traits >::setstate().

  • template<typename _CharT , typename _Traits > std::basic_ios< _CharT, _Traits >::operator bool () const [inline], [explicit], [inherited] โ€” The quick-and-easy status check. This allows you to write constructs such as if (!a_stream) ... and while (a_stream) ... โ€” the [explicit] is doing so much work here, no accidental conversions, we stan a careful icon ๐Ÿ‘‘

References std::basic_ios< _CharT, _Traits >::fail().

  • template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT, _Traits >::operator! () const [inline], [inherited] โ€” The quick-and-easy status check. This allows you to write constructs such as if (!a_stream) ... and while (a_stream) ... โ€” same energy, just with the little bang operator ๐Ÿซถ

References std::basic_ios< _CharT, _Traits >::fail().

  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (__ios_type &(*)(__ios_type &) __pf) [inline], [inherited] โ€” Interface for manipulators. Manipulators such as std::endl and std::hex use these functions in constructs like 'std::cout << std::endl'. For more information, see the iomanip header. function-pointer-to-function-pointer, we love a glow-up pipeline โœจ
  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (__ostream_type &(*)(__ostream_type &) __pf) [inline], [inherited] โ€” Interface for manipulators. Manipulators such as std::endl and std::hex use these functions in constructs like 'std::cout << std::endl'. For more information, see the iomanip header. this overload takes the __ostream_type flavour, same vibe, different signature ๐ŸŒธ
  • template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (__streambuf_type * __sb) [inherited] โ€” Extracting from another streambuf. wait no, it's << so we're inserting โ€” the title says extracting because that's what's happening to __sb's contents, keep up bestie ๐Ÿ˜ญ

Parameters

  • __sb โ€” A pointer to a streambuf

This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.

If __sb is NULL, the stream will set failbit in its error state. (so like, don't do that ๐Ÿ™ˆ)

Characters are extracted from __sb and inserted into *this until one of the following occurs:

  • the input stream reaches end-of-file,
  • insertion into the output sequence fails (in this case, the character that would have been inserted is not extracted), or
  • an exception occurs while getting a character from __sb, which sets failbit in the error state

If the function inserts no characters, failbit is set. brutal but fair ๐Ÿ’€

  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (bool __n) [inline], [inherited] โ€” Integer arithmetic inserters.

Parameters

  • __n โ€” A variable of builtin integral type.

Returns *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting. yes the bool one lives in the integer squad, don't question the grouping bestie ๐ŸŽ€

  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (const void * __p) [inline], [inherited] โ€” Pointer arithmetic inserters.

Parameters

  • __p โ€” A variable of pointer type.

Returns *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.

  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (double __f) [inline], [inherited] โ€” Floating point arithmetic inserters.

Parameters

  • __f โ€” A variable of builtin floating point type.

Returns *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting. double precision excellence ๐Ÿ”ฅ

  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (float __f) [inline], [inherited] โ€” Floating point arithmetic inserters.

Parameters

  • __f โ€” A variable of builtin floating point type.

Returns *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting. the float twin, equally valid, equally iconic ๐Ÿ’…

  • template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (int __n) [inherited] โ€” Integer arithmetic inserters.

Parameters

  • __n โ€” A variable of builtin integral type.

Returns *this if successful

(and yeah, it also uses the stream's current locale โ€” specifically the num_get facet โ€” to perform numeric formatting, same as the rest of the squad ๐Ÿงš)

okay so these functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting. locale-aware number slay โœจ

  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (ios_base &(*)(ios_base &) __pf) โ€” [inline], [inherited]. Interface for manipulators ๐ŸŽ€. Manipulators such as std::endl and std::hex use these functions in constructs like std::cout << std::endl. For more information, see the iomanip header.
  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long __n) โ€” [inline], [inherited]. Integer arithmetic inserters ๐Ÿ”ฅ.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long double __f) โ€” [inline], [inherited]. Floating point arithmetic inserters ๐ŸŒธ.
    • Parameters: __f โ€” a variable of builtin floating point type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long long __n) โ€” [inline], [inherited]. Integer arithmetic inserters ๐Ÿ’….
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
  • template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (short __n) โ€” [inherited]. Integer arithmetic inserters ๐Ÿ‘‘.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
    • References: std::ios_base::badbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned int __n) โ€” [inline], [inherited]. Integer arithmetic inserters ๐Ÿฆ‹.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned long __n) โ€” [inline], [inherited]. Integer arithmetic inserters ๐ŸŽ€.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned long long __n) โ€” [inline], [inherited]. Integer arithmetic inserters โœจ.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
  • template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned short __n) โ€” [inline], [inherited]. Integer arithmetic inserters ๐Ÿ’–.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
  • template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (__ios_type &(*)(__ios_type &) __pf) โ€” [inline], [inherited]. Interface for manipulators ๐Ÿ’€. Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header.
  • template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (__istream_type &(*)(__istream_type &) __pf) โ€” [inline], [inherited]. Interface for manipulators ๐Ÿ”ฅ. Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header.
  • template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> (__streambuf_type * __sb) โ€” [inherited]. Extracting into another streambuf ๐Ÿซถ.
    • Parameters: __sb โ€” a pointer to a streambuf.
    • This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.
    • If __sb is NULL, the stream will set failbit in its error state.
    • Characters are extracted from this stream and inserted into the __sb streambuf until one of the following occurs:
      • the input stream reaches end-of-file,
      • insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted), or
      • an exception occurs (and in this case is caught)
    • If the function inserts no characters, failbit is set.
    • References: std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
  • template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (bool & __n) โ€” [inline], [inherited]. Integer arithmetic extractors ๐ŸŽ€.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
  • template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (double & __f) โ€” [inline], [inherited]. Floating point arithmetic extractors ๐ŸŒธ.
    • Parameters: __f โ€” a variable of builtin floating point type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
  • template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (float & __f) โ€” [inline], [inherited]. Floating point arithmetic extractors ๐Ÿฆ‹.
    • Parameters: __f โ€” a variable of builtin floating point type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
  • template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> (int & __n) โ€” [inherited]. Integer arithmetic extractors ๐Ÿ’….
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
  • template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (ios_base &(*)(ios_base &) __pf) โ€” [inline], [inherited]. Interface for manipulators โœจ. Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header.
  • template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (long & __n) โ€” [inline], [inherited]. Integer arithmetic extractors ๐Ÿ‘‘.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
  • template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (long double & __f) โ€” [inline], [inherited]. Floating point arithmetic extractors ๐Ÿ’–.
    • Parameters: __f โ€” a variable of builtin floating point type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
  • template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (long long & __n) โ€” [inline], [inherited]. Integer arithmetic extractors ๐Ÿ”ฅ.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
  • template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> (short & __n) โ€” [inherited]. Integer arithmetic extractors ๐ŸŽ€.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
    • References: std::ios_base::badbit, std::ios_base::failbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
  • template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (unsigned int & __n) โ€” [inline], [inherited]. Integer arithmetic extractors ๐ŸŒˆ.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
  • template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (unsigned long & __n) โ€” [inline], [inherited]. Integer arithmetic extractors ๐Ÿ“.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
  • template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (unsigned long long & __n) โ€” [inline], [inherited]. Integer arithmetic extractors ๐Ÿงš.
    • Parameters: __n โ€” a variable of builtin integral type.
    • Returns: *this if successful.
    • These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.

operator>> for unsigned short & ๐Ÿ“

template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned short & __n)

[inline], [inherited]

Integer arithmetic extractors. Periodt.

Parameters

  • __n โ€” a variable of builtin integral type.

Returns โ€” *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


operator>> for void *& ๐Ÿงš

template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (void *& __p)

[inline], [inherited]

Basic arithmetic extractors. iykyk.

Parameters

  • __p โ€” a variable of pointer type.

Returns โ€” *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


peek โ€” looking ahead, no touching ๐Ÿ‘€

template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
>::int_type std::basic_istream< _CharT, _Traits >::peek (void)

[inherited]

Looking ahead in the stream. Main character energy, but make it non-destructive.

Returns โ€” the next character, or eof().

If, after constructing the sentry object, good() is false, returns traits::eof(). Otherwise reads but does not extract the next input character.

References: std::basic_istream< _CharT, _Traits >::_M_gcount.


precision() โ€” flags access, const flavor ๐ŸŽ€

streamsize std::ios_base::precision () const

[inline], [inherited]

Flags access.

Returns โ€” the precision to generate on certain output operations.

Be careful if you try to give a definition of precision here; see DR 189.

Referenced by: std::basic_ios< _CharT, _Traits >::copyfmt(), and std::chrono::operator<<().


precision(streamsize) โ€” changing flags ๐Ÿ’…

streamsize std::ios_base::precision (streamsize __prec)

[inline], [inherited]

Changing flags.

Parameters

  • __prec โ€” the new precision value.

Returns โ€” the previous value of precision().


put โ€” simple insertion โœจ

template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> & std::basic_ostream< _CharT, _Traits >::put (char_type __c)

[inherited]

Simple insertion. Just one little character, bestie.

Parameters

  • __c โ€” the character to insert.

Returns โ€” *this

Tries to insert __c.

Note: This function is not overloaded on signed char and unsigned char.

References: std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

Referenced by: std::endl(), and std::ends().


putback โ€” unextracting a single character ๐Ÿซถ

template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::putback (char_type __c)

[inherited]

Unextracting a single character. Put it back, it's not ready to leave yet.

Parameters

  • __c โ€” the character to push back into the input stream.

Returns โ€” *this

If rdbuf() is not null, calls rdbuf()->sputbackc(c).

If rdbuf() is null or if sputbackc() fails, sets badbit in the error state.

Note: This function first clears eofbit. Since no characters are extracted, the next call to gcount() will return 0, as required by DR 60.

References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_streambuf< _CharT, _Traits >::sputbackc().

Referenced by: std::operator<<().


pword โ€” access to the void pointer array ๐ŸŒˆ

void *& std::ios_base::pword (int __ix)

[inline], [inherited]

Access to void pointer array.

Parameters

  • __ix โ€” index into the array.

Returns โ€” a reference to a void* associated with the index.

The pword function provides access to an array of pointers that can be used for any purpose. The array grows as required to hold the supplied index. All pointers in the array are initialized to 0.

The implementation reserves several indices. You should use xalloc to obtain an index that is safe to use. Also note that since the array can grow dynamically, it is not safe to hold onto the reference.


basic_fstream::rdbuf() โ€” underlying buffer, const edition ๐Ÿฆ‹

template<typename _CharT , typename _Traits > __filebuf_type *
std::basic_fstream< _CharT, _Traits >::rdbuf () const

[inline]

Accessing the underlying buffer.

Returns โ€” the current basic_filebuf buffer.

This hides both signatures of std::basic_ios::rdbuf().


basic_ios::rdbuf(__sb) โ€” changing the underlying buffer ๐Ÿ’€

template<typename _CharT , typename _Traits > basic_streambuf< _CharT,
_Traits > * std::basic_ios< _CharT, _Traits >::rdbuf (basic_streambuf<
_CharT, _Traits > * __sb)

[inherited]

Changing the underlying buffer.

Parameters

  • __sb โ€” the new stream buffer.

Returns โ€” the previous stream buffer.

Associates a new buffer with the current stream, and clears the error state.

Due to historical accidents which the LWG refuses to correct, the I/O library suffers from a design error: this function is hidden in derived classes by overrides of the zero-argument rdbuf(), which is non-virtual for hysterical raisins. As a result, you must use explicit qualifications to access this function via any derived class. For example:

std::fstream     foo;         // or some other derived type
std::streambuf*  p = .....;

foo.ios::rdbuf(p);            // ios == basic_ios<char>

rdstate() โ€” error state check-in ๐Ÿฉบ

template<typename _CharT , typename _Traits > iostate std::basic_ios<
_CharT, _Traits >::rdstate () const

[inline], [inherited]

Returns the error state of the stream buffer.

Returns โ€” a bit pattern (well, isn't everything?)

See std::ios_base::iostate for the possible bit values. Most users will call one of the interpreting wrappers, e.g., good().

Referenced by: std::basic_ios< _CharT, _Traits >::bad(), std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::fail(), std::basic_ios< _CharT, _Traits >::good(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_istream< _CharT, _Traits >::unget().


read โ€” extraction without delimiters ๐Ÿ”ฅ

template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::read (char_type * __s,
streamsize __n)

[inherited]

Extraction without delimiters. No separators, no drama.

Parameters

  • __s โ€” a character array.
  • __n โ€” maximum number of characters to store.

Returns โ€” *this

If the stream state is good(), extracts characters and stores them into __s until one of the following happens:

  • __n characters are stored
  • the input sequence reaches end-of-file, in which case the error state is set to failbit|eofbit.
Note: This function is not overloaded on signed char and unsigned char.

References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().


readsome โ€” extraction until the buffer is exhausted, but no more ๐ŸŒธ

template<typename _CharT , typename _Traits > streamsize std::basic_istream<
_CharT, _Traits >::readsome (char_type * __s, streamsize __n)

[inherited]

Extraction until the buffer is exhausted, but no more. Respect the buffer's boundaries, bestie.

Parameters

  • __s โ€” a character array.
  • __n โ€” maximum number of characters to store.

Returns โ€” the number of characters extracted.

Extracts characters and stores them into __s depending on the number of characters remaining in the streambuf's buffer, rdbuf()->in_avail(), called A here:

  • if A == -1, sets eofbit and extracts no characters
  • if A == 0, extracts no characters
  • if A > 0, extracts min(A,n)

The goal is to empty the current buffer, and to not request any more from the external input sequence controlled by the streambuf.

References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::min(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().


register_callback โ€” add the callback __fn with parameter __index ๐ŸŽŸ๏ธ

void std::ios_base::register_callback (event_callback __fn, int __index)

[inherited]

Add the callback __fn with parameter __index.

Parameters

  • __fn โ€” the function to add.
  • __index โ€” the integer to pass to the function when invoked.

Registers a function as an event callback with an integer parameter to be passed to the function when invoked. Multiple copies of the function are allowed. If there are multiple callbacks, they are invoked in the order they were registered.


seekg(off_type, seekdir) โ€” changing the current read position ๐Ÿงญ

template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::seekg (off_type __off,
ios_base::seekdir __dir)

[inherited]

Changing the current read position.

Parameters

  • __off โ€” a file offset object.
  • __dir โ€” the direction in which to seek.

Returns โ€” *this

If fail() is not true, calls rdbuf()->pubseekoff(__off,__dir). If that function fails, sets failbit.

Note: This function first clears eofbit. It does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount().

References: std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), and std::basic_ios< _CharT, _Traits >::setstate().


seekg(pos_type) โ€” changing the current read position, position-object edition ๐Ÿ“

template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::seekg (pos_type __pos)

[inherited]

Changing the current read position.

Parameters

  • __pos โ€” a file position object.

Returns โ€” *this

If fail() is not true, calls rdbuf()->pubseekpos(__pos). If that function fails, sets failbit.

Note: This function first clears eofbit. It does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount().

References: std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), and std::basic_ios< _CharT, _Traits >::setstate().


seekp โ€” changing the current write position โœ๏ธ

template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> & std::basic_ostream< _CharT, _Traits >::seekp (off_type __off,
ios_base::seekdir __dir)

[inherited]

Changing the current write position.

Parameters

  • __off โ€” a file offset object.
  • __dir โ€” the direction in which to seek.

Returns โ€” *this

If fail() is not true, calls rdbuf()->pubseekoff(off,dir). If that function fails, sets failbit.

Okay so the references for that last overload: std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::out, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

seekp โ€” changing the current write position

template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::seekp (pos_type __pos) [inherited]

Parameters

  • __pos โ€” a file position object.

Returns โ€” *this

If fail() is not true, calls rdbuf()->pubseekpos(pos). If that function fails, sets failbit.

References: std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::out, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

setf โ€” setting new format flags, one-flag edition

fmtflags std::ios_base::setf (fmtflags __fmtfl) [inline],  [inherited]

Parameters

  • __fmtfl โ€” additional flags to set.

Returns โ€” the previous format control flags.

This function sets additional flags in format control. Flags that were previously set remain set. Periodt, they stay put.

Referenced by std::__detail::operator>>().

setf โ€” setting new format flags, mask edition

fmtflags std::ios_base::setf (fmtflags __fmtfl, fmtflags __mask) [inline], [inherited]

Parameters

  • __fmtfl โ€” additional flags to set.
  • __mask โ€” the flags mask for fmtfl.

Returns โ€” the previous format control flags.

This function clears mask in the format flags, then sets fmtfl & mask. An example mask is ios_base::adjustfield. Mask on, mask off, set the bits, slay ๐Ÿ’…

setstate โ€” sets additional flags in the error state

template<typename _CharT , typename _Traits > void std::basic_ios< _CharT, _Traits >::setstate (iostate __state) [inline],  [inherited]

Parameters

  • __state โ€” the additional state flag(s) to set.

See std::ios_base::iostate for the possible bit values.

References: std::basic_ios< _CharT, _Traits >::clear(), and std::basic_ios< _CharT, _Traits >::rdstate().

Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ifstream< _CharT, _Traits >::close(), std::basic_ofstream< _CharT, _Traits >::close(), std::basic_fstream< _CharT, _Traits >::close(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::getline(), std::getline(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_fstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_fstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::operator<<(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::tr2::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_istream< _CharT, _Traits >::sync(), and std::ws().

sync โ€” synchronizing the stream buffer

template<typename _CharT , typename _Traits > int std::basic_istream< _CharT, _Traits >::sync (void) [inherited]

Returns โ€” 0 on success, -1 on failure

If rdbuf() is a null pointer, returns -1.

Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit and returns -1.

Otherwise, returns 0.

Note โ€” This function does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount().

References: std::ios_base::badbit, std::ios_base::goodbit, std::basic_streambuf< _CharT, _Traits >::pubsync(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

sync_with_stdio โ€” interaction with the standard C I/O objects

static bool std::ios_base::sync_with_stdio (bool __sync = true) [static], [inherited]

Parameters

  • __sync โ€” whether to synchronize or not.

Returns โ€” True if the standard streams were previously synchronized.

The synchronization referred to is only that between the standard C facilities (e.g., stdout) and the standard C++ objects (e.g., cout). User-declared streams are unaffected. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary.

tellg โ€” getting the current read position

template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits >::pos_type std::basic_istream< _CharT, _Traits >::tellg (void) [inherited]

Returns โ€” a file position object.

If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,in).

Note โ€” This function does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount(). At variance with putback, unget and seekg, eofbit is not cleared first.

References: std::ios_base::badbit, std::ios_base::cur, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::in, and std::basic_ios< _CharT, _Traits >::rdbuf().

tellp โ€” getting the current write position

template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits >::pos_type std::basic_ostream< _CharT, _Traits >::tellp () [inherited]

Returns โ€” a file position object.

If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,out).

References: std::ios_base::cur, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::out, and std::basic_ios< _CharT, _Traits >::rdbuf().

tie โ€” fetches the current tied stream

template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > * std::basic_ios< _CharT, _Traits >::tie () const [inline], [inherited]

Returns โ€” a pointer to the tied stream, or NULL if the stream is not tied.

A stream may be tied (or synchronized) to a second output stream. When this stream performs any I/O, the tied stream is first flushed. For example, std::cin is tied to std::cout.

Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and std::basic_ios< _CharT, _Traits >::copyfmt().

tie โ€” ties this stream to an output stream

template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > * std::basic_ios< _CharT, _Traits >::tie (basic_ostream< _CharT, _Traits > * __tiestr) [inline],  [inherited]

Parameters

  • __tiestr โ€” the output stream.

Returns โ€” the previously tied output stream, or NULL if the stream was not tied.

This sets up a new tie; see tie() for more.

unget โ€” unextracting the previous character

template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::unget (void) [inherited]

Returns โ€” *this

If rdbuf() is not null, calls rdbuf()->sungetc(c).

If rdbuf() is null or if sungetc() fails, sets badbit in the error state.

Note โ€” This function first clears eofbit. Since no characters are extracted, the next call to gcount() will return 0, as required by DR 60.

References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::rdstate().

Referenced by std::__detail::operator>>().

unsetf โ€” clearing format flags

void std::ios_base::unsetf (fmtflags __mask) [inline],  [inherited]

Parameters

  • __mask โ€” the flags to unset.

This function clears __mask in the format flags.

widen โ€” widens characters

template<typename _CharT , typename _Traits > char_type std::basic_ios< _CharT, _Traits >::widen (char __c) const [inline],  [inherited]

Parameters

  • __c โ€” the character to widen.

Returns โ€” the widened character.

Maps a character of char to a character of char_type.

Returns the result of

std::use_facet<ctype<char_type> >(getloc()).widen(c)

Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html.

Referenced by std::endl(), std::basic_ios< _CharT, _Traits >::fill(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::getline(), std::getline(), std::basic_istream< _CharT, _Traits >::getline(), std::operator<<(), std::operator<<(), and std::tr2::operator>>().

width โ€” flags access, reading the width

streamsize std::ios_base::width () const [inline],  [inherited]

Returns โ€” the minimum field width to generate on output operations.

Minimum field width refers to the number of characters. Character count, not vibes count โœจ

Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_put< _CharT, _OutIter >::do_put(), std::operator>>(), and std::operator>>().

width โ€” changing the width

streamsize std::ios_base::width (streamsize __wide) [inline],  [inherited]

Parameters

  • __wide โ€” the new width value.

Returns โ€” the previous value of width().

write โ€” character string insertion

template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::write (const char_type * __s, streamsize __n) [inherited]

Parameters

  • __s โ€” the array to insert.
  • __n โ€” maximum number of characters to insert.

Returns โ€” *this

Characters are copied from __s and inserted into the stream until one of the following happens:

  • __n characters are inserted
  • inserting into the output sequence fails (in this case, badbit will be set in the stream's error state)
Note โ€” This function is not overloaded on signed char and unsigned char.

xalloc โ€” access to unique indices

static int std::ios_base::xalloc () [static],  [inherited]

Returns โ€” an integer different from all previous calls.

This function returns a unique integer every time it is called. It can be used for any purpose, but is primarily intended to be a unique index for the iword and pword functions. The expectation is that an application calls xalloc in order to obtain an index in the iword and pword arrays that can be used without fear of conflict.

The implementation maintains a static variable that is incremented and returned on each invocation. xalloc is guaranteed to return an index that is safe to use in the iword and pword arrays. Unique index unlocked, no collisions, we love to see it ๐Ÿฆ‹

๐Ÿ’… Member Data Documentation ๐Ÿ’…

okay bestie, this is the part where we meet the actual data members โ€” the little state gremlins that live inside your stream objects and make everything work ๐Ÿซถ some are inherited from std::ios_base (the flags and state bits, the absolute icons ๐Ÿ‘‘), some come from std::basic_istream, and each one has a "Referenced by" list showing every function that pokes at it. yes it's long. no we are not skipping any of it. drink some water and let's go ๐Ÿ’–


  • streamsize std::basic_istream< _CharT, _Traits >::_M_gcount [protected], [inherited] โ€” the running tally of characters pulled out by the previous unformatted function; go look at gcount() for the receipts ๐Ÿ‘€

Referenced by: std::basic_istream< _CharT, _Traits >::~basic_istream(), std::basic_istream< _CharT, _Traits >::gcount(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< char >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< char >::operator>>(), std::basic_istream< _CharT, _Traits >::peek(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< char >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< char >::readsome(), std::basic_istream< char >::sync(), and std::basic_istream< _CharT, _Traits >::unget().

  • const fmtflags std::ios_base::adjustfield [static], [inherited] โ€” a mask made of left|right|internal. so useful for the 2-arg form of setf โœจ

Referenced by: std::num_put< _CharT, _OutIter >::do_put(), std::internal(), std::left(), and std::right().

  • const openmode std::ios_base::app [static], [inherited] โ€” seek to the end before every single write, no cap ๐Ÿƒโ€โ™€๏ธ๐Ÿ’จ

Referenced by: std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), std::basic_filebuf< _CharT, _Traits >::overflow(), and std::basic_filebuf< _CharT, _Traits >::xsputn().

  • const openmode std::ios_base::ate [static], [inherited] โ€” open the thing, then immediately seek to the end ๐ŸŽฏ

Referenced by: std::basic_filebuf< _CharT, _Traits >::open().

  • const iostate std::ios_base::badbit [static], [inherited] โ€” flags that integrity is gone, bestie ๐Ÿ˜ญ like an irrecoverable read error from a file. this is the bad place.

Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ios< _CharT, _Traits >::bad(), std::basic_ios< _CharT, _Traits >::fail(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< char >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< char >::tellg(), std::basic_istream< _CharT, _Traits >::tellg(), and std::ws().

  • const fmtflags std::ios_base::basefield [static], [inherited] โ€” a mask made of dec|oct|hex. again: 2-arg setf's bestie ๐Ÿงฎ

Referenced by: std::dec(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), std::hex(), and std::oct().

  • const seekdir std::ios_base::beg [static], [inherited] โ€” please seek relative to the beginning of the stream, thank you ๐Ÿ’ซ

Referenced by: std::basic_filebuf< _CharT, _Traits >::seekpos().

Referenced by: std::basic_filebuf< _CharT, _Traits >::showmanyc().

  • const fmtflags std::ios_base::boolalpha [static], [inherited] โ€” insert/extract bool as words instead of numbers, i.e. alphabetic format not numeric ๐Ÿ…ฐ๏ธ๐Ÿ…ฑ๏ธ

Referenced by: std::boolalpha(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), and std::noboolalpha().

  • const seekdir std::ios_base::cur [static], [inherited] โ€” seek relative to wherever you currently are in the sequence ๐Ÿ“

Referenced by: std::basic_filebuf< _CharT, _Traits >::imbue(), std::basic_filebuf< _CharT, _Traits >::overflow(), std::basic_filebuf< _CharT, _Traits >::pbackfail(), std::basic_filebuf< _CharT, _Traits >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_istream< _CharT, _Traits >::tellg(), and std::basic_ostream< _CharT, _Traits >::tellp().

  • const fmtflags std::ios_base::dec [static], [inherited] โ€” reads integers / writes integers in base 10, the classic ๐Ÿ”Ÿ

Referenced by: std::dec().

  • const seekdir std::ios_base::end [static], [inherited] โ€” seek relative to the current end of the sequence ๐Ÿ

Referenced by: std::basic_filebuf< _CharT, _Traits >::open(), and std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff().

  • const iostate std::ios_base::eofbit [static], [inherited] โ€” an input operation hit the end of an input sequence ๐ŸŒ™ that's all folks

Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::time_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_date(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_time(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::basic_ios< _CharT, _Traits >::eof(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::time_get< _CharT, _InIter >::get(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< char >::sync(), std::basic_istream< _CharT, _Traits >::unget(), and std::ws().

  • const iostate std::ios_base::failbit [static], [inherited] โ€” an input operation didn't read the characters it expected, or an output operation didn't produce the characters you wanted. it's giving "close but no" ๐Ÿ’€

Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), std::basic_ifstream< _CharT, _Traits >::close(), std::basic_ofstream< _CharT, _Traits >::close(), std::basic_fstream< _CharT, _Traits >::close(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::basic_ios< _CharT, _Traits >::fail(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::time_get< _CharT, _InIter >::get(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_fstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_fstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), and std::basic_ostream< _CharT, _Traits >::seekp().

  • const fmtflags std::ios_base::fixed [static], [inherited] โ€” floating-point output in fixed-point notation, locked in ๐Ÿ“Œ

Referenced by: std::fixed(), and std::hexfloat().

  • const fmtflags std::ios_base::floatfield [static], [inherited] โ€” a mask made of scientific|fixed. yep, 2-arg setf again ๐Ÿ”ฌ

Referenced by: std::defaultfloat(), std::fixed(), std::hexfloat(), and std::scientific().

  • const iostate std::ios_base::goodbit [static], [inherited] โ€” everything is fine, all is well, we are thriving ๐ŸŒธโœจ

Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::time_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< _CharT, _Traits >::get(), std::time_get< _CharT, _InIter >::get(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< char >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< _CharT, _Traits >::unget(), and std::ws().

  • const fmtflags std::ios_base::hex [static], [inherited] โ€” reads integers / writes integers in base 16, the cooler base ๐Ÿ’œ

Referenced by: std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), and std::hex().

  • const openmode std::ios_base::in [static], [inherited] โ€” open for input ๐Ÿ”“ and it's the default for ifstream and fstream, iykyk

Referenced by: std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_filebuf< _CharT, _Traits >::pbackfail(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_filebuf< _CharT, _Traits >::showmanyc(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::showmanyc(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_filebuf< _CharT, _Traits >::underflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::underflow(), and std::basic_filebuf< _CharT, _Traits >::xsgetn().

  • const fmtflags std::ios_base::internal [static], [inherited] โ€” adds fill characters at a designated internal point in certain generated output, or itโ€™s identical to right if no such point is designated. Referenced by std::internal().
  • const fmtflags std::ios_base::left [static], [inherited] โ€” adds fill characters on the right (final positions) of certain generated output. (I.e., the thing you print is flush left.) Referenced by std::num_put< _CharT, _OutIter >::do_put(), and std::left().
  • const fmtflags std::ios_base::oct [static], [inherited] โ€” converts integer input or generates integer output in octal base. Referenced by std::oct().
  • const openmode std::ios_base::out [static], [inherited] โ€” open for output. Default for ofstream and fstream. Referenced by std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), std::basic_ofstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::basic_filebuf< _CharT, _Traits >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::pbackfail(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_ostream< _CharT, _Traits >::tellp(), and std::basic_filebuf< _CharT, _Traits >::xsputn().
  • const fmtflags std::ios_base::right [static], [inherited] โ€” adds fill characters on the left (initial positions) of certain generated output. (I.e., the thing you print is flush right.) Referenced by std::right().
  • const fmtflags std::ios_base::scientific [static], [inherited] โ€” generates floating-point output in scientific notation. Referenced by std::hexfloat(), and std::scientific().
  • const fmtflags std::ios_base::showbase [static], [inherited] โ€” generates a prefix indicating the numeric base of generated integer output. Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::noshowbase(), and std::showbase().
  • const fmtflags std::ios_base::showpoint [static], [inherited] โ€” generates a decimal-point character unconditionally in generated floating-point output. Referenced by std::noshowpoint(), and std::showpoint().
  • const fmtflags std::ios_base::showpos [static], [inherited] โ€” generates a + sign in non-negative generated numeric output. Referenced by std::noshowpos(), and std::showpos().
  • const fmtflags std::ios_base::skipws [static], [inherited] โ€” skips leading white space before certain input operations. Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::noskipws(), std::__detail::operator>>(), and std::skipws().
  • const openmode std::ios_base::trunc [static], [inherited] โ€” truncate an existing stream when opening. Default for ofstream.
  • const fmtflags std::ios_base::unitbuf [static], [inherited] โ€” flushes output after each output operation. Referenced by std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::nounitbuf(), and std::unitbuf().
  • const fmtflags std::ios_base::uppercase [static], [inherited] โ€” replaces certain lowercase letters with their uppercase equivalents in generated output. Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::nouppercase(), and std::uppercase().

๐Ÿ‘‘ Author ๐Ÿ‘‘

Generated automatically by Doxygen for libstdc++ from the source code.

Source/version + date shoutout: the footerโ€™s libstdstd::basic_fst...harT, _Traits >(3cxx) and the date that goes with it โ€” auto-generated by Doxygen for libstdc++ from the source code. Bye bestie, stay hydrated! ๐Ÿ’–๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from