STD::IOSTREAM(3cxx)

๐Ÿ’– std::basic_iostream< _CharT, _Traits > from 3cxx ๐Ÿ’–

okay bestie, welcome to the 3cxx manual page for std::basic_iostream< _CharT, _Traits > โ€” yep, that whole template-y name is the manual name, and we're folding it in right here at the top instead of making you read a copied header line. ๐Ÿ’…


โœจ NAME โœจ

std::basic_iostream< _CharT, _Traits > โ€” Template class basic_iostream.


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

#include <istream>

Inherits std::basic_istream< _CharT, _Traits >, and std::basic_ostream< _CharT, _Traits >.

Inherited by std::basic_fstream< _CharT, _Traits >, and std::basic_stringstream< _CharT, _Traits, _Alloc >.


๐ŸŽ€ Public Types ๐ŸŽ€

  • typedef ctype< _CharT > __ctype_type โ€” the page lists this one twice, so I'm listing it twice too. no cap.
  • typedef ctype< _CharT > __ctype_type โ€” yep, again ๐Ÿ’€
  • typedef basic_ios< _CharT, _Traits > __ios_type โ€” here's the first one.
  • typedef basic_ios< _CharT, _Traits > __ios_type โ€” and here's the second one.
  • 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 โ€” first appearance.
  • typedef basic_streambuf< _CharT, _Traits > __streambuf_type โ€” second appearance, because the page said so.
  • 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::int_type int_type
  • typedef _Ios_Iostate iostate โ€” this is a bitmask type.
  • typedef _Traits::off_type off_type
  • typedef _Ios_Openmode openmode โ€” this is a bitmask type.
  • typedef _Traits::pos_type pos_type
  • typedef _Ios_Seekdir seekdir โ€” this is an enumerated type.
  • typedef _Traits traits_type
  • typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type โ€” and yes, the page repeats this one right after traits_type; not me being extra, that's literally what's there ๐Ÿซถ

๐ŸŒธ Public Member Functions ๐ŸŒธ

  • basic_iostream (basic_streambuf< _CharT, _Traits > *__sb) โ€” constructor does nothing.
  • virtual ~basic_iostream () โ€” destructor does nothing.
  • 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.
  • 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.
  • long & iword (int __ix) โ€” access to integer array.
  • char narrow (char_type __c, char __dfault) const โ€” squeezes characters.
  • __ostream_type & operator<< (__streambuf_type *__sb) โ€” extracting from another streambuf.
  • __ostream_type & operator<< (const void *__p) โ€” pointer arithmetic inserters.
  • __ostream_type & operator<< (nullptr_t)
  • __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.
  • basic_streambuf< _CharT, _Traits > * 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.
  • 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.
  • __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 โญ

all the operator>> functions (aka formatted input functions) have some common behavior, bestie. 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.

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.

  • __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. each 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().

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 () โ€” simple extraction.
  • __istream_type & get (char_type &__c) โ€” simple extraction.
  • __istream_type & get (char_type *__s, streamsize __n, char_type __delim) โ€” simple multiple-character extraction.
  • __istream_type & get (char_type *__s, streamsize __n) โ€” simple multiple-character extraction.
  • __istream_type & get (__streambuf_type &__sb, char_type __delim) โ€” extraction into another streambuf.
  • __istream_type & get (__streambuf_type &__sb) โ€” extraction into another streambuf.
  • __istream_type & getline (char_type *__s, streamsize __n, char_type __delim) โ€” string extraction.
  • __istream_type & getline (char_type *__s, streamsize __n) โ€” string extraction.
  • __istream_type & ignore (streamsize __n, int_type __delim) โ€” discarding characters.
  • __istream_type & ignore (streamsize __n) โ€” simple extraction.
  • __istream_type & ignore () โ€” simple extraction.
  • int_type peek () โ€” looking ahead in the stream.
  • __istream_type & read (char_type *__s, streamsize __n) โ€” extraction without delimiters.
  • streamsize readsome (char_type *__s, streamsize __n) โ€” extraction until the buffer is exhausted, but no more.
  • __istream_type & putback (char_type __c) โ€” unextracting a single character.
  • __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) โ€” changing the current read position.
  • operator bool () const โ€” the quick-and-easy status check.
  • bool operator! () const โ€” the quick-and-easy status check.
  • __ostream_type & operator<< (__ostream_type &(*__pf)(__ostream_type &)) โ€” the manipulator hook, bestie ๐Ÿ’… this is how stuff like <kbd>-style stream manipulators get applied to a basic_ostream.
  • __ostream_type & operator<< (__ios_type &(*__pf)(__ios_type &)) โ€” same deal, manipulator interface but for the __ios_type flavour.
  • __ostream_type & operator<< (ios_base &(*__pf)(ios_base &)) โ€” and the third one, manipulator interface taking ios_base &. Three flavours, all iconic, all slaying โœจ

๐ŸŽ€ Inserters ๐ŸŽ€

Okay so literally all the operator<< functions (aka the formatted output functions, iykyk) share some common behavior, and the way that works is:

Every single one starts by constructing a temporary object of type std::basic_ostream::sentry. No cap. This temp object can do several things, and it wraps up with setting a status flag โ€” go read the sentry documentation for the full tea on that one ๐Ÿซ–

If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument. Simple as that.

Okay important warning though ๐Ÿ˜ญ if an exception gets 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. Then the original exception gets rethrown. So like, no sneaky extra exception, just the og one coming back for round two ๐Ÿ’€
  • __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 ๐Ÿฆ‹

So the unformatted output functions also have common behavior, and the way that works: each one starts by constructing a temporary object of type std::basic_ostream::sentry. This has several effects, finishing up with the setting of a status flag โ€” again, sentry documentation, go read it ๐Ÿ’–

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

But here's where it differs, bestie, pay attention ๐Ÿ˜ญ If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state. And if badbit is on in the stream's exceptions mask, the exception will be rethrown without completing its actions. Very much not the same as the formatted ones up there โญ
  • __ostream_type & put (char_type __c) โ€” simple insertion โœจ just yeet one character in.
  • __ostream_type & write (const char_type *__s, streamsize __n) โ€” character string insertion ๐ŸŽ€ you're writing __n characters from __s.

๐Ÿ‘‘ Static Public Member Functions ๐Ÿ‘‘

  • static bool sync_with_stdio (bool __sync=true) โ€” the whole interaction-with-the-standard-C-I/O-objects situation ๐ŸŒˆ default is true, so it's synced unless you say otherwise.
  • static int xalloc () throw () โ€” access to unique indices ๐Ÿ’… that's the whole vibe.

๐ŸŒธ Static Public Attributes ๐ŸŒธ

  • static const openmode __noreplace โ€” that's the one.
  • 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. Every. Single. 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 (like 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). And here's the thing: this is probably not what you think it is ๐Ÿ˜ญ see https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary for the real explanation before you go assuming stuff.
  • static const fmtflags boolalpha โ€” insert/extract bool in alphabetic rather than numeric format โœจ (true/false instead of 1/0, iconic).
  • 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 ๐Ÿ˜ฌ rough out here.
  • 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 ๐ŸŒˆโœจ literally the good vibes flag.
  • 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. Unconditionally. That's the whole point (pun intended) ๐Ÿ“
  • 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. Yes it will eat your file, be normal about it ๐Ÿ’€
  • 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 } โ€” yep, that's the enum. Protected, so hands off unless you're a subclass bestie.

๐ŸŽ€ Protected Member Functions ๐ŸŽ€

  • basic_iostream (basic_iostream &&__rhs) โ€” move-y constructor situation.
  • basic_iostream (const basic_iostream &)=delete โ€” copy constructor? Deleted. No copying, not today, not ever ๐Ÿ™ˆ
  • void _M_cache_locale (const locale &__loc) โ€” caches the locale.
  • void _M_call_callbacks (event __ev) throw () โ€” call the callbacks for that event.
  • void _M_dispose_callbacks (void) throw () โ€” dispose of the callbacks.
  • template<typename _ValueT > __istream_type & _M_extract (_ValueT &__v) โ€” the internal extract machinery.
  • _Words & _M_grow_words (int __index, bool __iword) โ€” grows the words array.
  • void _M_init () throw () โ€” internal init.
  • template<typename _ValueT > __ostream_type & _M_insert (_ValueT __v) โ€” the internal insert machinery.
  • void _M_move (ios_base &) noexcept โ€” internal move.
  • void _M_swap (ios_base &__rhs) noexcept โ€” internal swap.
  • void init (basic_streambuf< _CharT, _Traits > *__sb) โ€” all setup is performed here โœจ literally everything, this is the main character of the setup functions.
  • void move (basic_ios &&__rhs) โ€” move from an rvalue basic_ios.
  • void move (basic_ios &__rhs) โ€” move from an lvalue basic_ios.
  • basic_iostream & operator= (basic_iostream &&__rhs) โ€” move assignment, slay.
  • basic_iostream & operator= (const basic_iostream &)=delete โ€” copy assignment? Also deleted ๐Ÿ’€ no copying periodt.
  • void set_rdbuf (basic_streambuf< _CharT, _Traits > *__sb) โ€” sets the rdbuf.
  • void swap (basic_ios &__rhs) noexcept โ€” swap with a basic_ios.
  • void swap (basic_iostream &__rhs) โ€” swap with another basic_iostream.
  • void swap (basic_istream &__rhs) โ€” swap with a basic_istream.
  • void swap (basic_ostream &__rhs) โ€” swap with a basic_ostream.

๐Ÿ’œ Protected Attributes ๐Ÿ’œ

  • _Callback_list * _M_callbacks โ€” the callback list pointer.
  • const __ctype_type * _M_ctype โ€” the ctype facet pointer.
  • iostate _M_exception โ€” the exception state.
  • char_type _M_fill โ€” the fill character.
  • bool _M_fill_init โ€” whether the fill got initialized.
  • fmtflags _M_flags โ€” the format flags.
  • streamsize _M_gcount โ€” the gcount.
  • locale _M_ios_locale โ€” the locale, of course.
  • _Words _M_local_word [_S_local_word_size] โ€” the local word array, sized _S_local_word_size ๐ŸŽ€
  • const __num_get_type * _M_num_get โ€” the num_get facet pointer.
  • const __num_put_type * _M_num_put โ€” the num_put facet pointer.
  • streamsize _M_precision โ€” the precision.
  • basic_streambuf< _CharT, _Traits > * _M_streambuf โ€” the streambuf pointer, the actual engine under the hood ๐Ÿ”ฅ
  • iostate _M_streambuf_state โ€” the streambuf state.
  • basic_ostream< _CharT, _Traits > * _M_tie โ€” the tie pointer.
  • streamsize _M_width โ€” the width.
  • _Words * _M_word โ€” pointer to the words.
  • int _M_word_size โ€” how big the words situation is.
  • _Words _M_word_zero โ€” the zeroth word, just vibing.

โญ Detailed Description โญ

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

Okay so this is Template class basic_iostream ๐Ÿ’–

Template Parameters โ€” because you gotta know your types, bestie:

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

And the whole thing? This class multiply inherits from the input and output stream classes simply to provide a single interface. That's it, that's the reason โ€” one interface, two parents, main character energy ๐Ÿ‘‘

๐ŸŽ€ Member Typedef Documentation ๐ŸŽ€

Ok bestie, these are the little name-aliases the class hands you so you don't have to type out the whole ungodly template soup every time. Slay.

  • typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > std::basic_ios< _CharT, _Traits >::__num_put_type [inherited] โ€” heads up: these are non-standard types, so don't go assuming they're portable across the whole universe, mkay? ๐Ÿ’…
  • typedef void(* std::ios_base::event_callback) (event __e, ios_base &__b, int __i) [inherited] โ€” it's the type of an event callback function. ๐Ÿฆ‹

Parameters, in order:

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

Event callbacks are user-defined functions that get called during several ios_base and basic_ios functions โ€” specifically imbue(), copyfmt(), and ~ios(). So like, your callback is literally on the invite list for those three moments. ๐ŸŽ€

  • typedef _Ios_Fmtflags std::ios_base::fmtflags [inherited] โ€” this is a bitmask type. _Ios_Fmtflags is implementation-defined, but โ€” and this is the important part โ€” it is valid to perform bitwise operations on these values and expect the Right Thing to happen. โœจ Defined objects of type fmtflags are:
    • boolalpha
    • dec
    • fixed
    • hex
    • internal
    • left
    • oct
    • right
    • scientific
    • showbase
    • showpoint
    • showpos
    • skipws
    • unitbuf
    • uppercase
    • adjustfield
    • basefield
    • floatfield
  • typedef _Ios_Iostate std::ios_base::iostate [inherited] โ€” also a bitmask type. _Ios_Iostate is implementation-defined, but again: bitwise operations on these values, Right Thing, guaranteed. ๐Ÿ’– Defined objects of type iostate are:
    • badbit
    • eofbit
    • failbit
    • goodbit
  • typedef _Ios_Openmode std::ios_base::openmode [inherited] โ€” yeah you guessed it, bitmask type number three. _Ios_Openmode is implementation-defined, and bitwise ops on these values do the Right Thing. ๐Ÿ”ฅ Defined objects of type openmode are:
    • app
    • ate
    • binary
    • in
    • out
    • trunc
  • 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]

The set of events that may be passed to an event callback. Let me spell out the whole drama for you:

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

That's the entire cast. Three characters, no filler. ๐Ÿ‘‘


โœจ Constructor & Destructor Documentation โœจ

๐Ÿซถ template<typename _CharT , typename _Traits > std::basic_iostream< _CharT, _Traits >::basic_iostream (basic_streambuf< _CharT, _Traits > * __sb) [inline], [explicit]

Constructor does nothing. Literally nothing. ๐Ÿ˜ญ Both of the parent classes are initialized with the same streambuf pointer that was passed to this constructor, and then it's like... that's it, we're done here.

๐Ÿซถ template<typename _CharT , typename _Traits > virtual std::basic_iostream< _CharT, _Traits >::~basic_iostream () [inline], [virtual]

Destructor does nothing. Matching energy. Balance restored. ๐Ÿฆ‹


โญ Member Function Documentation โญ

๐ŸŒˆ const locale & std::ios_base::_M_getloc () const [inline], [inherited]

Locale access. โœจ

Returns: a reference to the current locale.

It's like getloc above, but it returns a reference instead of generating a copy โ€” so no unnecessary copying, we love efficiency.

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(), and std::time_put< _CharT, _OutIter >::put().

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

Fast error checking. โšก

Returns: True if the badbit is set.

Note that other iostate flags may also be set โ€” so like, don't read this as "only badbit, nothing else going on." ๐Ÿ™ˆ

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

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

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

[Re]sets the error state. ๐ŸŽ€

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 โ€” the default is goodbit, so calling it bare just wipes the slate clean. ๐Ÿ’…

Referenced by: 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(), and std::basic_istream< _CharT, _Traits >::unget().

(Yes, open() and seekg() really do show up twice in that list. We don't make the rules, we just report them faithfully. ๐Ÿ’€)

๐ŸŒˆ 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. It's giving "becoming your friend's whole personality" but in a sanctioned, documented way. ๐Ÿ’–

Parameters:

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

Returns: a reference to this object.

Now the important fine print: 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. ๐Ÿฆ‹

The order of operations, because it matters, bestie:

  1. Before copying, each callback is invoked with erase_event.
  2. After copying, each (new) callback is invoked with copyfmt_event.
  3. The final step is to 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().

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

Fast error checking. โšก

Returns: True if the eofbit is set.

Same disclaimer as bad(): other iostate flags may also be set. Don't let the single-purpose name fool you. ๐Ÿ™ˆ

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

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

Throwing exceptions on errors โ€” this is the getter half of the duo. ๐ŸŽ€

Returns: the current exceptions mask.

This changes nothing in the stream โ€” it's read-only vibes. See the one-argument version of exceptions(iostate) for the meaning of the return value.

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

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

Throwing exceptions on errors โ€” now the setter. ๐Ÿ‘‘

Parameters:

  • __except โ€” the new exceptions mask.

By default, error flags are set silently. 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 spicy part: if the error flag is already set when the exceptions mask is added, the exception is immediately thrown. Like, no waiting, no grace period, instant.

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().

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

Fast error checking. โšก

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

Checking the badbit in fail() is historical practice โ€” that's just how it's always been done, we're not here to question history. Also, note that other iostate flags may be set too. ๐Ÿ’…

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(), and std::regex_traits< _Ch_type >::value().

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

Retrieves the empty character. ๐ŸŽ€

Returns: the current fill character.

It defaults to a space (' ') in the current locale. So when nothing fancy is set, you're padding with spaces like a normal person. โœจ

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. ๐Ÿ’–

Parameters:

  • __ch โ€” the new character.

Returns: the previous fill character. (Yes, it hands you back the old one โ€” trade offer style. ๐Ÿซถ)

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. ๐Ÿ‘‘

Returns: the format control flags for both input and output โ€” one shared little flag bucket for everything.

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>>().

(That is a lot of operator>>()s and we are reporting every single one of them, because accuracy is the whole assignment. ๐Ÿ“)

๐ŸŒˆ fmtflags std::ios_base::flags (fmtflags __fmtfl) [inline], [inherited]

Setting new format flags all at once โ€” the "replace everything, no notes" option. ๐Ÿ”ฅ

Parameters:

  • __fmtfl โ€” the new flags to set.

Returns: the previous format control flags.

This function overwrites all the format flags with __fmtfl. Not merges. Not ORs. Overwrites. So if you had other flags set and you wanted to keep them, uh, you should've thought about that first. ๐Ÿ’€

References: 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>>().

template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::flush () โ€” inherited ๐Ÿ’…

Okay so this one is literally just syncing the stream buffer. That's the whole vibe.

Returns: *this

So like, if rdbuf() is a null pointer, bestie, nothing happens. Not a single thing. It just vibes.

Otherwise? It calls rdbuf()->pubsync(), and if that returns -1, it sets badbit. That's it, that's the whole function ๐Ÿซถ

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, icon behavior honestly.

Returns: the number of characters extracted by the previous unformatted input function dispatched for this stream. Like, the last one. Not a running total, just the last one, no cap.

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. Very demure, very mindful.

Returns: a character, or eof().

It tries to extract a character. If none are available? Sets failbit and returns traits::eof(). Rip ๐Ÿ˜ญ

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. Passing the aux, basically.

Parameters:

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

Returns: *this

It literally just returns get(__sb,widen('\n')). That's the whole thing, she's a one-liner ๐Ÿ’€

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 now with a stop character. Main character energy.

Parameters:

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

Returns: *this

So characters get extracted and inserted into __sb until one of these things happens:

  • the input sequence reaches EOF
  • insertion into the output buffer fails โ€” and in this case, the character that would have been inserted is not extracted, okurrr
  • the next character equals __delim โ€” in this case the character is not extracted
  • an exception occurs (and in this case it is caught, we're being safe)

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

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, take two.

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. Just so you know ๐Ÿ’…

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. We're scaling up, besties.

Parameters:

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

Returns: *this

Returns get(__s,__n,widen('\n')). Again, one line, she's efficient.

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, full version.

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 these 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. Periodt โœจ

Note: again, this function is not overloaded on signed char and unsigned char.

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! The classic.

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')). Yes bestie, the '\n' is just a widened default.

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, the real one. Pay attention because the ordering here is not a vibe, it's a requirement.

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 these happens. And note โ€” these criteria are required to be tested in the order listed here, so that an input line can exactly fill the __s array without setting failbit. Like, the order is the whole point, don't touch it ๐Ÿ”ฅ

  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 โ€” important!! ๐Ÿ™ˆ)

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. That's it, that's the whole note, she's just chillin' there ๐Ÿ’…


locale std::ios_base::getloc () const โ€” inline, inherited ๐Ÿฆ‹

Locale access, iykyk.

Returns: a copy of the current locale.

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

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 vibe check function, truly.

Returns: True if no error flags are set.

It's a wrapper around rdstate. That's literally all she does and she does it flawlessly.

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. Someone get this girl a consistent description, she's got three overloads and two of them say the exact same thing ๐Ÿ˜ญ

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, part two, electric boogaloo.

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::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().


template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n, int_type __delim) โ€” inherited ๐Ÿ”ฅ

Discarding characters. The "no thoughts, head empty, throw it away" function, we love her.

Parameters:

  • __n โ€” number of characters to discard.
  • __delim โ€” a 'stop' character.

Returns: *this

Extracts characters and throws them away until one of these happens:

  • if __n != std::numeric_limits<int>::max(), __n characters are extracted
  • the input sequence reaches end-of-file
  • the next character equals __delim (in this case the character is extracted); note that 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. She's doing the most and somehow still following the rules, iconic ๐Ÿ’…

template<typename _CharT , typename _Traits > locale std::basic_ios< _CharT, _Traits >::imbue (const locale & __loc) โ€” inherited ๐ŸŒ

Moves to a new locale. Glow-up arc.

Parameters:

  • __loc โ€” the new locale.

Returns: the previous locale. (She remembers where you came from ๐Ÿฅบ)

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 โ€” go read them, bestie, they're good for you โœจ

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. Like, all of it. This is called from the public constructor.

It is not virtual and cannot be redefined. She's final. Periodt ๐Ÿ‘‘

Okay so before we get to the next function, here's everybody who's out here referencing this constructor โ€” it's a whole friend group, no cap ๐Ÿ’…

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().

Like, literally the entire stream family showed up. Iconic behavior honestly ๐Ÿซถ


long & std::ios_base::iword (int __ix)</p> [inline], [inherited]

Access to integer array.

Yep, your very own integer closet โœจ

Parameters

  • __ix โ€” Index into the array.

Returns

A reference to an integer associated with the index.

So bestie, iword hands you an array of integers that you can use for literally any purpose you want. The array grows as required to hold whatever index you throw at it โ€” it's giving elastic waistband energy ๐ŸŒธ And every single integer in the array starts out initialized to 0.

โš ๏ธ Two things, and I need you to hear me: the implementation reserves several indices for itself, so you should use xalloc to grab an index that's actually safe for you to touch. And because the array can grow dynamically, it is not safe to hold onto that reference โ€” it can go poof ๐Ÿซ 

char std::basic_ios< _CharT, _Traits >::narrow (char_type __c, char __dfault) const</p> [inline], [inherited]

Squeezes characters.

Not me making a character smaller ๐Ÿ˜ญ it's a whole glow-down for chars.

Parameters

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

Returns

The narrowed character.

What it does: maps a character of char_type down to a character of char, if that's even possible ๐Ÿ’ซ

It returns the result of this, exactly:

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

And if you wanna get into the l10n lore, additional notes live at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html ๐Ÿงš


std::basic_ios< _CharT, _Traits >::operator bool () const</p> [inline], [explicit], [inherited]

The quick-and-easy status check.

This is the vibe check for your stream, periodt โœจ It's what lets you write little baddies like if (!a_stream) ... and while (a_stream) ... โ€” chef's kiss, so clean ๐ŸŽ€

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


bool std::basic_ios< _CharT, _Traits >::operator! () const</p> [inline], [inherited]

The quick-and-easy status check.

Same energy, opposite sign ๐Ÿ˜Œ You get constructs such as if (!a_stream) ... and while (a_stream) ... โ€” yes, both of these functions exist to make exactly those two things cute.

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


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (__ios_type &(*)(__ios_type &) __pf)</p> [inline], [inherited]

Interface for manipulators.

Okay so manipulators like std::endl and std::hex use these functions in constructs like 'std::cout << std::endl' โ€” you've literally been using them this whole time without knowing, iykyk ๐Ÿ’… For more info, go peek at the iomanip header ๐Ÿฆ‹


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (__ostream_type &(*)(__ostream_type &) __pf)</p> [inline], [inherited]

Interface for manipulators.

Round two, same slay ๐ŸŽ€ 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 โœจ


basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (__streambuf_type * __sb)</p> [inherited]

Extracting from another streambuf.

Sharing is caring bestie ๐ŸŒˆ

Parameters

  • __sb โ€” A pointer to a streambuf

This one 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. Dead. Gone. ๐Ÿ’€

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

And if the function inserts no characters at all? failbit gets set. Empty-handed = flagged ๐Ÿ™ˆ


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (bool __n)</p> [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 do the numeric formatting ๐Ÿ’ซ


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (const void * __p)</p> [inline], [inherited]

Pointer arithmetic inserters.

Parameters

  • __p โ€” A variable of pointer type.

Returns

*this if successful

Again: these functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting ๐ŸŒธ


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (double __f)</p> [inline], [inherited]

Floating point arithmetic inserters.

Parameters

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

Returns

*this if successful

Current locale, num_get facet, numeric formatting โ€” the holy trinity, no cap โœจ


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (float __f)</p> [inline], [inherited]

Floating point arithmetic inserters.

Parameters

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

Returns

*this if successful

Yes, same locale / num_get facet / numeric formatting situation as its sibling ๐Ÿซถ


basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (int __n)</p> [inherited]

Integer arithmetic inserters.

Parameters

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

Returns

*this if successful

Locale. num_get facet. Numeric formatting. You know the drill by now bestie ๐Ÿ’…


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (ios_base &(*)(ios_base &) __pf)</p> [inline], [inherited]

Interface for manipulators.

Third time's the charm ๐ŸŽ€ 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.


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long __n)</p> [inline], [inherited]

Integer arithmetic inserters.

Parameters

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

Returns

*this if successful

Uses the stream's current locale (specifically, the num_get facet) to perform numeric formatting ๐ŸŒŸ


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long double __f)</p> [inline], [inherited]

Floating point arithmetic inserters.

Parameters

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

Returns

*this if successful

The long double one!! Very main character energy ๐Ÿ‘‘ Uses the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long long __n)</p> [inline], [inherited]

Integer arithmetic inserters.

Parameters

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

Returns

*this if successful

Once more, with feeling: stream's current locale, num_get facet, numeric formatting ๐Ÿฆ‹


basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (short __n)</p> [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().


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned int __n)</p> [inline], [inherited]

Integer arithmetic inserters.

Parameters

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

Returns

*this if successful

Locale + num_get facet + numeric formatting, the usual โœจ


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned long __n)</p> [inline], [inherited]

Integer arithmetic inserters.

Parameters

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

Returns

*this if successful

Yes, still the stream's current locale (specifically, the num_get facet) doing the numeric formatting ๐ŸŽ€


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned long long __n)</p> [inline], [inherited]

Integer arithmetic inserters.

Parameters

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

Returns

*this if successful

The biggest unsigned baddie of them all ๐Ÿ˜ค Uses the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned short __n)</p> [inline], [inherited]

Integer arithmetic inserters.

Parameters

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

Returns

*this if successful

And the last one, our cute little unsigned short ๐Ÿ“ These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


The way that's literally every arithmetic inserter accounted for ๐Ÿ’… all present, all correct, all accounted for.

๐Ÿ’… operator>> โ€” the manipulator ones (the __ios_type flavour)

template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (__ios_type &(*)(__ios_type &) __pf) [inline],  [inherited]

Okay so this is the interface for manipulators, bestie โœจ Manipulators like std::ws and std::dec literally use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header โ€” that's where the whole manipulator party lives ๐ŸŽ€


๐ŸŒธ operator>> โ€” the other manipulator flavour (the __istream_type one)

template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (__istream_type &(*)(__istream_type &) __pf) [inline],  [inherited]

Same deal, different function-pointer shape ๐Ÿซถ Again: interface for manipulators, manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws, and for more information, see the iomanip header. Two flavours, one vibe, no cap.


๐Ÿฆ‹ operator>> โ€” extracting into another streambuf

template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::operator>> (__streambuf_type
* __sb) [inherited]

Extracting into another streambuf โ€” it's giving relay race ๐Ÿƒโ€โ™€๏ธ

Parameters

  • __sb โ€” a pointer to a streambuf.

So here's the tea: 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. Iconic consistency ๐Ÿ’…

If __sb is NULL, the stream will set failbit in its error state. Not great, not terrible, just a fact ๐Ÿซ 

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. That's the rules, periodt.

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().


๐Ÿ”ฅ operator>> โ€” bool

template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (bool & __n) [inline],
[inherited]

Integer arithmetic extractors ๐Ÿงฎ (yes, bool counts as an integer type here, don't come for me)

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. Locale-aware parsing is lowkey the main character here ๐Ÿ‘‘


๐Ÿ“ operator>> โ€” double

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.


๐ŸŒˆ operator>> โ€” float

template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (float & __f)
[inline],  [inherited]

Floating point arithmetic extractors, the smaller sibling edition ๐ŸŒธ

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.


โญ operator>> โ€” int

template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::operator>> (int & __n)
[inherited]

Integer arithmetic extractors, the blueprint ๐Ÿ’–

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>> โ€” the ios_base manipulator flavour

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.


๐Ÿงš operator>> โ€” long

template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long & __n) [inline],
[inherited]

Integer arithmetic extractors โ€” long boi energy ๐Ÿ

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>> โ€” long double

template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long double & __f)
[inline],  [inherited]

Floating point arithmetic extractors โ€” the extra-precision one, she's dramatic and we love her ๐Ÿ’…

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.


๐ŸŽ€ operator>> โ€” long long

template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long long & __n)
[inline],  [inherited]

Integer arithmetic extractors, but make it long long ๐Ÿ”ฅ

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>> โ€” short (the one with the extra โœจreferencesโœจ)

template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::operator>> (short & __n)
[inherited]

Integer arithmetic extractors โ€” small type, big responsibilities ๐Ÿ˜ญ

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().


๐Ÿซถ operator>> โ€” unsigned int

template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned int & __n)
[inline],  [inherited]

Integer arithmetic extractors, now with no negatives allowed ๐Ÿšซ

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>> โ€” unsigned long

template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned long & __n)
[inline],  [inherited]

Integer arithmetic extractors, unsigned + long, she's got range ๐Ÿ’–

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>> โ€” unsigned long long

template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned long long &
__n) [inline],  [inherited]

Integer arithmetic extractors โ€” maximum unsigned long long energy, she ate ๐Ÿ”ฅ

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>> โ€” unsigned short

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

Integer arithmetic extractors, tiny and unsigned, a whole vibe ๐Ÿงš

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>> โ€” void*&

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

Basic arithmetic extractors โ€” but it's a pointer, okay? ๐Ÿคจ

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, respectfully

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

Looking ahead in the stream ๐Ÿ‘€ โ€” no touching, just vibes.

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. Respectful. Consensual. Leaves the character right where it was ๐Ÿซถ

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


โญ precision() โ€” const flavour

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. (This is a real warning from the original, bestie โ€” don't improvise ๐Ÿ’€)

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


๐Ÿ’œ precision(__prec) โ€” the setter

streamsize std::ios_base::precision (streamsize __prec) [inline],
[inherited]

Changing flags โœจ

Parameters

  • __prec โ€” the new precision value.

Returns: the previous value of precision(). So you get the old one back โ€” it's a trade, not a theft ๐Ÿ’…


๐Ÿ“ put โ€” simple insertion

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

Simple insertion, no thoughts, just one character going out ๐ŸŒธ

Parameters

  • __c โ€” the character to insert.

Returns: *this

Tries to insert __c.

Note: this function is not overloaded on signed char and unsigned char. So don't @ me when your signed char doesn't match ๐Ÿ™ˆ

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 (yes, putting it BACK)

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

Unextracting a single character โ€” it's giving "jk, take it back" ๐Ÿ˜ญ

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. Rude of it, honestly.

Note: this function first clears eofbit. Since no characters are extracted, the next call to gcount() will return 0, as required by DR 60. Very important, don't forget it ๐Ÿ‘‘

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 โ€” the chaotic storage closet of ios_base ๐Ÿ’€

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. Seriously โ€” don't be hoarding that reference, it'll betray you ๐Ÿ˜ญ

โœจ rdbuf() โ€” peeking at the buffer underneath ๐Ÿซถ

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

Okay so this is the accessing the underlying buffer girlie. No arguments, just vibes and a pointer.

Returns โ€” the current stream buffer. That's it. That's the whole thing.

And listen: this does not change the state of the stream. Zero side effects, a total chill pass. ๐Ÿ’…

Referenced by โ€” bestie, this list is long, but I'm not gonna gatekeep a single one: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< _CharT, _Traits >::get(), std::getline(), std::getline(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::operator>>(), std::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< char >::readsome(), 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(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_ostream< _CharT, _Traits >::tellp(), and std::ws(). Yeah ๐Ÿ’€ they're all in there. Every single one ate.


๐Ÿ”„ rdbuf(__sb) โ€” swapping out the 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. Main character behavior honestly.

Parameters

  • __sb โ€” the new stream buffer. The fresh one. The upgrade. โœจ

Returns โ€” the previous stream buffer. She's giving "here's what it looked like before the glow-up."

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

๐Ÿšจ okay bestie, this next bit is lore. 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>

Like... the ios:: part isn't optional, it's the whole personality. Not me defending a design error, but here we are. ๐Ÿ™ˆ


๐Ÿฉบ rdstate() โ€” the vibe check of your stream

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?) ๐Ÿ’… iconic parenthetical, no notes

See std::ios_base::iostate for the possible bit values. Most users will call one of the interpreting wrappers, e.g., good(). Like yeah, you could rawdog the bits, but the wrappers exist for a reason, bestie.

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(__s, __n) โ€” extraction, no delimiters, no mercy

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

Extraction without delimiters. She does not care about your whitespace. She does not care about your \n. She takes exactly what she wants. ๐Ÿ‘‘

Parameters

  • __s โ€” a character array. The landing zone. ๐Ÿ›ฌ
  • __n โ€” maximum number of characters to store.

Returns โ€” *this

So: if the stream state is good(), it 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. Fr fr, check your types before you come crying to me. ๐Ÿ˜ญ

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(__s, __n) โ€” little scoop, not a whole meal

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. It's giving "eat what's on your plate, don't go grocery shopping." ๐Ÿ“

Parameters

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

Returns โ€” the number of characters extracted.

Here's the tea: it 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. Respect the boundary, periodt. ๐Ÿ’…

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(__fn, __index) โ€” add me to the group chat

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. And if there are multiple callbacks, they are invoked in the order they were registered โ€” first come, first served, no queue-jumping. ๐ŸŽ€


๐Ÿ” seekg(__off, __dir) โ€” repositioning the read era

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. Teleport but for read pointers. ๐ŸŒ€

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(). Remember that, or your gcount() will gaslight you. ๐Ÿ˜ญ

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) โ€” same teleport, absolute coords

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 โ€” again, it first clears eofbit. It does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount(). Same disclaimer, different signature, iykyk. ๐Ÿซถ

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(__off, __dir) โ€” repositioning the write era

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.

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().


โœ๏ธ seekp(__pos) โ€” absolute write coords

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

Changing the current write position.

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(__fmtfl) โ€” adding flags, keeping the old ones

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

Setting new format flags.

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. It's additive, not destructive โ€” she's not clearing anything behind your back. ๐Ÿ’œ

Referenced by โ€” std::__detail::operator>>().


๐ŸŽ›๏ธ setf(__fmtfl, __mask) โ€” the surgical version

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

Setting new format flags.

Parameters

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

Returns โ€” the previous format control flags.

Okay so this one first clears mask in the format flags, then sets fmtfl & mask. An example mask is ios_base::adjustfield. So you're not just adding, you're swapping out a whole little neighborhood of flags. Precision. ๐ŸŽฏ


๐Ÿšฉ setstate(__state) โ€” flagging the error state

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

Sets additional flags in the error state.

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().

That's the little state-setting slay ๐Ÿ’… โ€” and there's still more coming, so don't you dare close the tab. ๐Ÿ”ฅ

okay so the Referenced by squad for that last one is literally a whole group chat, and weโ€™re listing every single member:

  • 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()
  • 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 (const) โ€” whoโ€™s tied to me? ๐Ÿ‘‘

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 (setter) โ€” tie me to your 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 (const) โ€” flags access ๐ŸŒธ

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.

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


width (setter) โ€” changing flags ๐ŸŽ€

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.


๐Ÿซถ Member Data Documentation ๐Ÿซถ

_M_gcount โ€” the number of characters extracted in the previous unformatted function ๐Ÿ’–

template<typename _CharT , typename _Traits > streamsize std::basic_istream<
_CharT, _Traits >::_M_gcount [protected],  [inherited]

The number of characters extracted in the previous unformatted function; see gcount().

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().


adjustfield โ€” a mask of left|right|internal ๐ŸŽ€

const fmtflags std::ios_base::adjustfield [static],  [inherited]

A mask of left|right|internal. Useful for the 2-arg form of setf.

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


app โ€” seek to end before each write ๐ŸŒˆ

const openmode std::ios_base::app [static],  [inherited]

Seek to end before each write.

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


ate โ€” open and seek to end immediately after opening ๐Ÿฆ‹

const openmode std::ios_base::ate [static],  [inherited]

Open and seek to end immediately after opening.

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


badbit โ€” loss of integrity, bestie ๐Ÿ’€

const iostate std::ios_base::badbit [static],  [inherited]

Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file).

(โ€ฆcontinuing that reference list from the last one, because it is LONG and I refuse to cut a single entry ๐Ÿ’€)

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] โ€” bestie this one is literally just a mask of dec|oct|hex. Super useful for the 2-arg form of setf. That's the whole vibe. โœจ
    • 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] โ€” "take me to the beginning of the stream" energy ๐ŸŽ€. It's a request to seek relative to the start of the sequence.
    • Referenced by std::basic_filebuf< _CharT, _Traits >::seekpos().
  • const openmode std::ios_base::binary [static], [inherited] โ€” does input and output in binary mode instead of text mode. And okay, listen: this is probably not what you think it is ๐Ÿ˜ญ. For real, go read https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary before you start assuming things, iykyk.
    • Referenced by std::basic_filebuf< _CharT, _Traits >::showmanyc().
  • const fmtflags std::ios_base::boolalpha [static], [inherited] โ€” inserts/extracts a bool in alphabetic format instead of numeric. So you get the actual words, not just 1 and 0. Obsessed tbh ๐Ÿ’œ
    • 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. Stay where you're at, basically ๐Ÿฆ‹
    • 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] โ€” converts integer input, or generates integer output, in decimal base. The default default, the main character of bases fr.
    • Referenced by std::dec().
  • const seekdir std::ios_base::end [static], [inherited] โ€” seek relative to the current end of the sequence. End-of-the-line core ๐ŸŒธ
    • Referenced by std::basic_filebuf< _CharT, _Traits >::open(), and std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff().
  • const iostate std::ios_base::eofbit [static], [inherited] โ€” flags that an input operation hit the end of an input sequence. The "no more content bestie, we're done here" bit ๐Ÿ˜ญ. The reference list on this one is genuinely unhinged, buckle up:
    • 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] โ€” flags that an input operation failed to read the characters it expected, or that an output operation failed to generate the characters you wanted. Either way it's giving "something went wrong" ๐Ÿ’€ and you're gonna feel it.
    • 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] โ€” generates floating-point output in fixed-point notation ๐ŸŽ€. Classic, dependable, does not do the exponent thing.
    • Referenced by std::fixed(), and std::hexfloat().
  • const fmtflags std::ios_base::floatfield [static], [inherited] โ€” a mask of scientific|fixed. Again, bestie, it's for the 2-arg form of setf. That's the whole point of these masks โœจ
    • Referenced by std::defaultfloat(), std::fixed(), std::hexfloat(), and std::scientific().
  • const iostate std::ios_base::goodbit [static], [inherited] โ€” indicates all is well ๐Ÿซถ. The "we're so back" bit. No errors, no drama, just vibes. Its reference list is also enormous, so:
    • 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] โ€” converts integer input, or generates integer output, in hexadecimal base. Base 16 slay ๐Ÿ”ฅ
    • 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 ๐Ÿ“ฅ. This is the default for ifstream and fstream, no cap.
    • 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, if no such point got designated, it behaves identically to right. Same thing, different font ๐Ÿ’…
    • Referenced by std::internal().
  • const fmtflags std::ios_base::left [static], [inherited] โ€” adds fill characters on the right (the final positions) of certain generated output. Translation: the thing you print is flush left. Left-aligned girlies rise ๐ŸŒธ
    • 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. Base 8, the quirky one, we love her.
    • Referenced by std::oct().
  • const openmode std::ios_base::out [static], [inherited] โ€” open for output ๐Ÿ“ค. Default for ofstream and fstream. Periodt.
    • 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 (the initial positions) of certain generated output. So the thing you print is flush right. Iconic mirror moment ๐Ÿชž
    • Referenced by std::right().
  • const fmtflags std::ios_base::scientific [static], [inherited] โ€” generates floating-point output in scientific notation ๐Ÿงš. Exponents, but make it fashion.
    • Referenced by std::hexfloat(), and std::scientific().
  • const fmtflags std::ios_base::showbase [static], [inherited] โ€” generates a prefix that indicates the numeric base of generated integer output. Like a little name tag for your number's base ๐ŸŽ€

First up, the tail end of the previous entry: it's referenced by std::num_put< _CharT, _OutIter >::do_put(), std::noshowbase(), and std::showbase(). ๐Ÿซถ

const fmtflags std::ios_base::showpoint [static], [inherited]

This one generates a decimal-point character unconditionally in generated floating-point output. No vibes-based decimal points here โ€” it's always showing up. ๐Ÿ’–

Referenced by std::noshowpoint(), and std::showpoint().

const fmtflags std::ios_base::showpos [static], [inherited]

Generates a + sign in non-negative generated numeric output. Positive numbers get their little plus moment, periodt. โœจ

Referenced by std::noshowpos(), and std::showpos().

const fmtflags std::ios_base::skipws [static], [inherited]

Skips leading white space before certain input operations. It's giving polite little input cleanup before the real reading starts. ๐ŸŽ€

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. It's the default for ofstream. So yeah, opening can absolutely wipe the existing stream โ€” that's the whole point, bestie. ๐Ÿ’…

const fmtflags std::ios_base::unitbuf [static], [inherited]

Flushes output after each output operation. Every single operation gets its own little flush moment. ๐Ÿฆ‹

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. Lowercase letters are not the main character here. ๐Ÿ‘‘

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.


Sign-off time: this page is stamped with the libstdc++ source/version vibe, and the date is right there in the footer, bestie โ€” peep it down there. ๐ŸŽ€๐Ÿ’œ๐ŸŒธ

๐Ÿ“ฆ where this page comes from