STD::WISTRINGSTREAM(3cxx)

πŸ’– NAME πŸ’–

std::basic_istringstream< _CharT, _Traits, _Alloc > β€” literally just controlling input for std::string, bestie. That's the whole vibe. It's the <sstream> girlie that lets you read out of a string like it's a stream. Iconic behavior, no cap. (And yes, we're in the 3cxx section, section 3, C++ library, iykyk πŸŽ€)


✨ SYNOPSIS ✨

#include <sstream>

So first things first, she inherits std::basic_istream< _CharT, _Traits >. Like, that's her mother. That's where all the stream energy comes from. πŸ’…

🌸 Public Types 🌸

Okay so she has a LOT of typedefs and honestly they're all serving a purpose, so let's go through every single one because we don't skip:

  • typedef ctype< _CharT > __ctype_type β€” the ctype vibe
  • typedef basic_ios< _CharT, _Traits > __ios_type β€” the ios vibe
  • typedef basic_istream< char_type, traits_type > __istream_type β€” the istream vibe
  • typedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_type β€” the num_get vibe
  • typedef basic_streambuf< _CharT, _Traits > __streambuf_type β€” the streambuf vibe
  • typedef basic_string< _CharT, _Traits, _Alloc > __string_type β€” the string vibe (main character tbh)
  • typedef basic_stringbuf< _CharT, _Traits, _Alloc > __stringbuf_type β€” the stringbuf vibe
  • typedef _Alloc allocator_type β€” the allocator, she allocates πŸ’…
  • typedef _CharT char_type β€” the char type
  • enum event { erase_event, imbue_event, copyfmt_event } β€” ngl this one's important: 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, fr fr
  • typedef _Ios_Fmtflags fmtflags β€” this is a bitmask type, okay bestie write that down
  • typedef traits_type::int_type int_type β€” the int type
  • typedef _Ios_Iostate iostate β€” this is a bitmask type too
  • typedef traits_type::off_type off_type β€” the off type
  • typedef _Ios_Openmode openmode β€” yup, also a bitmask type
  • typedef traits_type::pos_type pos_type β€” the pos type
  • typedef _Ios_Seekdir seekdir β€” and this one is an enumerated type (different!!)
  • typedef _Traits traits_type β€” the traits, she has traits
  • typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type β€” the num_put vibe

πŸŽ€ Public Member Functions πŸŽ€

This is the big one. Buckle up. There are so many and every single one is getting her moment:

  • basic_istringstream () β€” Default constructor starts with an empty string buffer 🫢
  • basic_istringstream (basic_istringstream &&__rhs) β€” the move constructor, she moves
  • basic_istringstream (const __string_type &__str, ios_base::openmode __mode=ios_base::in) β€” starts with an existing string buffer, so you're not starting from scratch, love that for you
  • basic_istringstream (const basic_istringstream &)=delete β€” copying is deleted, she said no ❌
  • basic_istringstream (ios_base::openmode __mode) β€” starts with an empty string buffer, but with a mode this time
  • ~basic_istringstream () β€” the destructor does nothing. That's it. That's the whole job. 😭
  • template<typename _ValueT > basic_istream< _CharT, _Traits > & _M_extract (_ValueT &__v) β€” internal extract helper
  • const locale & _M_getloc () const β€” locale access πŸ”₯
  • void _M_setstate (iostate __state) β€” internal state setter
  • 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 (yes, the setter version)
  • 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, she's efficient
  • 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) β€” the wchar_t twin of the above
  • locale getloc () const β€” locale access
  • bool good () const β€” fast error checking
  • basic_istream< char > & ignore (streamsize __n) β€” the char specialization
  • basic_istream< wchar_t > & ignore (streamsize __n) β€” the wchar_t specialization
  • basic_istream< char > & ignore (streamsize __n, int_type __delim) β€” char version with a delimiter
  • basic_istream< wchar_t > & ignore (streamsize __n, int_type __delim) β€” wchar_t version with a delimiter
  • 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 πŸ‹
  • basic_istringstream & operator= (basic_istringstream &&__rhs) β€” move assignment, she assigns
  • basic_istringstream & operator= (const basic_istringstream &)=delete β€” copy assignment deleted, again, no πŸ’€
  • __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
  • __stringbuf_type * rdbuf () const β€” accessing the underlying buffer
  • basic_streambuf< _CharT, _Traits > * rdbuf (basic_streambuf< _CharT, _Traits > *__sb) β€” changing the underlying buffer
  • iostate rdstate () const β€” returns the error state of the stream buffer
  • void register_callback (event_callback __fn, int __index) β€” add the callback __fn with parameter __index
  • fmtflags setf (fmtflags __fmtfl) β€” setting new format flags
  • fmtflags setf (fmtflags __fmtfl, fmtflags __mask) β€” setting new format flags, now with a mask
  • void setstate (iostate __state) β€” sets additional flags in the error state
  • __string_type str () const β€” copying out the string buffer
  • void str (const __string_type &__s) β€” setting a new buffer
  • void swap (basic_istringstream &__rhs) β€” swap her
  • 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
  • basic_string_view< char_type, traits_type > view () const noexcept β€” she gives you a view, no cap
  • char_type widen (char __c) const β€” widens characters
  • streamsize width () const β€” flags access
  • streamsize width (streamsize __wide) β€” changing flags

And then the manipulator interfaces, which are nested right under there:

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

πŸ”₯ Extractors πŸ”₯

Okay so all the operator>> functions (aka the formatted input functions, slay) have some common behavior and you NEED to know it:

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. Like, pay attention to that one bestie, it's giving "read the fine print." 😭

Then, the actual extractors, all of them:

  • __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 πŸ¦‹

Same deal, all the unformatted input functions share some common behavior:

Each one starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to true (!! note it's true here, not false, that's the whole difference, don't get it twisted). 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().

⚠️ And again: 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.

The lineup, every last one:

  • 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, the seekdir way
  • operator bool () const β€” the quick-and-easy status check
  • bool operator! () const β€” the quick-and-easy status check, but negated

πŸ‘‘ Static Public Member Functions πŸ‘‘

  • static bool sync_with_stdio (bool __sync=true) β€” interaction with the standard C I/O objects
  • static int xalloc () throw () β€” access to unique indices

✨ Static Public Attributes ✨

okay bestie, this is the big pile of constants β€” flags, masks, and states you'll be slinging around. all of them live on the class, none of them are yours to change πŸ’…

  • static const openmode __noreplace β€” no description given, it's just there being mysterious 🫢
  • static const fmtflags adjustfield β€” a mask of left|right|internal. Useful for the 2-arg form of setf.
  • static const openmode app β€” seek to end before each write.
  • static const openmode ate β€” open and seek to end immediately after opening.
  • static const iostate badbit β€” indicates a loss of integrity in an input or output sequence (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). This is probably not what you think it is; see https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary. 🚨 like, actually read that, bestie, it's giving trap.
  • static const fmtflags boolalpha β€” insert/extract bool in alphabetic rather than numeric format. so true/false instead of 1/0 ✨
  • static const seekdir cur β€” request a seek relative to the current position within the sequence.
  • static const fmtflags dec β€” converts integer input or generates integer output in decimal base.
  • static const seekdir end β€” request a seek relative to the current end of the sequence.
  • static const iostate eofbit β€” indicates that an input operation reached the end of an input sequence.
  • static const iostate failbit β€” indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters. πŸ’€
  • static const fmtflags fixed β€” generate floating-point output in fixed-point notation.
  • static const fmtflags floatfield β€” a mask of scientific|fixed. Useful for the 2-arg form of setf.
  • static const iostate goodbit β€” indicates all is well. πŸŽ€ the dream, honestly.
  • static const fmtflags hex β€” converts integer input or generates integer output in hexadecimal base.
  • static const openmode in β€” open for input. Default for ifstream and fstream.
  • static const fmtflags internal β€” adds fill characters at a designated internal point in certain generated output, or identical to right if no such point is designated.
  • static const fmtflags left β€” adds fill characters on the right (final positions) of certain generated output. (I.e., the thing you print is flush left.)
  • static const fmtflags oct β€” converts integer input or generates integer output in octal base.
  • static const openmode out β€” open for output. Default for ofstream and fstream.
  • static const fmtflags right β€” adds fill characters on the left (initial positions) of certain generated output. (I.e., the thing you print is flush right.)
  • static const fmtflags scientific β€” generates floating-point output in scientific notation.
  • static const fmtflags showbase β€” generates a prefix indicating the numeric base of generated integer output.
  • static const fmtflags showpoint β€” generates a decimal-point character unconditionally in generated floating-point output.
  • static const fmtflags showpos β€” generates a + sign in non-negative generated numeric output.
  • static const fmtflags skipws β€” skips leading white space before certain input operations.
  • static const openmode trunc β€” truncate an existing stream when opening. Default for ofstream.
  • static const fmtflags unitbuf β€” flushes output after each output operation. highkey clingy and we respect it.
  • static const fmtflags uppercase β€” replaces certain lowercase letters with their uppercase equivalents in generated output.

πŸ›‘οΈ Protected Types πŸ›‘οΈ

  • enum { _S_local_word_size } β€” a little anonymous enum, minding its own business.

🧚 Protected Member Functions 🧚

these are the internals, the backstage crew. you don't touch them, they don't touch you. 🫢

  • void _M_cache_locale (const locale &__loc)
  • void _M_call_callbacks (event __ev) throw ()
  • void _M_dispose_callbacks (void) throw ()
  • template<typename _ValueT > __istream_type & _M_extract (_ValueT &__v)
  • _Words & _M_grow_words (int __index, bool __iword)
  • void _M_init () throw ()
  • void _M_move (ios_base &) noexcept
  • void _M_swap (ios_base &__rhs) noexcept
  • void init (basic_streambuf< _CharT, _Traits > *__sb) β€” all setup is performed here. literally all of it, bestie.
  • void move (basic_ios &&__rhs)
  • void move (basic_ios &__rhs)
  • void set_rdbuf (basic_streambuf< _CharT, _Traits > *__sb)
  • void swap (basic_ios &__rhs) noexcept
  • void swap (basic_istream &__rhs)

🌸 Protected Attributes 🌸

just... a whole lotta state, ngl. every one of these is a little vibe the stream is holding onto.

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

πŸ’– Detailed Description πŸ’–

template<typename _CharT, typename _Traits, typename _Alloc>
    class std::basic_istringstream< _CharT, _Traits, _Alloc >

Controlling input for std::string. πŸŽ€ that's the whole gig!

Template Parameters

  • _CharT β€” type of character stream.
  • _Traits β€” traits for character type, defaults to char_traits<_CharT>.
  • _Alloc β€” allocator type, defaults to allocator<_CharT>.

This class supports reading from objects of type std::basic_string, using the inherited functions from std::basic_istream. To control the associated sequence, an instance of std::basic_stringbuf is used, which this page refers to as sb. ✨ lowkey everything runs through sb.


πŸ” Member Typedef Documentation πŸ”

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

These are non-standard types. πŸ™ˆ consider yourself warned.

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

The type of an event callback function.

Parameters

  • __e β€” one of the members of the event enum.
  • __b β€” reference to the ios_base object.
  • __i β€” the integer 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(). πŸ‘‘

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

This is a bitmask type. _Ios_Fmtflags is implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. 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]

This is a bitmask type. _Ios_Iostate is implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of type iostate are:

  • badbit
  • eofbit
  • failbit
  • goodbit

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

This is a bitmask type. _Ios_Openmode is implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of type openmode are:

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

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

This is 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. erase_event is used during ~ios() and copyfmt(). imbue_event is used during imbue(). copyfmt_event is used during copyfmt(). πŸ¦‹


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

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

Default constructor starts with an empty string buffer. Initializes sb using in, and passes &sb to the base class initializer. Does not allocate any buffer.

That's a lie. We initialize the base class with NULL, because the string class does its own memory management. 😭 not the docs gaslighting us, but okay, we love transparency.

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

template<typename _CharT , typename _Traits , typename _Alloc > std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream (ios_base::openmode __mode) [inline], [explicit]

Starts with an empty string buffer.

Parameters

  • __mode β€” whether the buffer can read, or write, or both.

ios_base::in is automatically included in __mode.

Initializes sb using __mode|in, and passes &sb to the base class initializer. Does not allocate any buffer.

That's a lie. We initialize the base class with NULL, because the string class does its own memory management. πŸ’€ again!! iconic honesty though.

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

template<typename _CharT , typename _Traits , typename _Alloc > std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream (const __string_type & __str, ios_base::openmode __mode = ios_base::in) [inline], [explicit]

Starts with an existing string buffer. 🫢 this is the one where you hand it your actual string.

Parameters

  • __str β€” a string to copy as a starting buffer.
  • __mode β€” whether the buffer can read, or write, or both.

ios_base::in is automatically included in mode.

Initializes sb using str and mode|in, and passes &sb to the base class initializer.

That's a lie. We initialize the base class with NULL, because the string class does its own memory management. ✨ third time's the charm.

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

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

The destructor does nothing. The buffer is deallocated by the stringbuf object, not the formatting stream. 🧚 so chill. it literally does nothing and honestly? mood.


πŸ’… Member Function Documentation πŸ’…

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

Locale access. 🌍

Returns

A reference to the current locale.

Like getloc above, but returns a reference instead of generating a copy. no cap, saves you a copy. πŸ”₯

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() β€” like, the whole friend group is tagging this one, iykyk πŸ’….


🩹 bad() const

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

Bestie, this is the fast error check β€” speedrun version.

Returns: true if the badbit is set. Heads up: other iostate flags may also be set, so don’t read this as β€œonly badbit is on.”

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

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


🧼 clear(iostate __state = goodbit)

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

This one [re]sets the error state β€” like clearing the group chat after a dramatic read.

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.

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


πŸ“‹ copyfmt(const basic_ios< _CharT, _Traits > & __rhs)

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

Copies fields of __rhs into this object. It’s giving β€œbestie, let me borrow your whole aesthetic” ✨.

Parameters: __rhs β€” the source values for the copies.

Returns: reference to this object.

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. Before copying, each callback is invoked with erase_event. After copying, each (new) callback is invoked with copyfmt_event. 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().


πŸŒ™ eof() const

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

Another fast error check β€” no cap.

Returns: true if the eofbit is set.

Remember: other iostate flags may also be set, bestie.

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


🚨 exceptions() const

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

Throwing exceptions on errors β€” the dramatic option, honestly.

Returns: the current exceptions mask.

This changes nothing in the stream. See the one-argument version of exceptions(iostate) for the meaning of the return value.

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


πŸ’₯ exceptions(iostate __except)

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

Throwing exceptions on errors β€” now with actual settings πŸ‘‘

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.

If the error flag is already set when the exceptions mask is added, the exception is immediately thrown. No waiting, no suspense.

Try running the following under GCC 3.1 or later:

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

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

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

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

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

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


πŸ’€ fail() const

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

Fast error checking, but make it either-or 😭.

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

Checking the badbit in fail() is historical practice. Note that other iostate flags may also be set.

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

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


πŸŽ€ fill() const

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

Retrieves the empty character β€” the filler bestie of the stream world 🫢.

Returns: the current fill character.

It defaults to a space (' ') in the current locale.

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

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


πŸ–οΈ fill(char_type __ch)

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

Sets a new empty character. New filler, same iconic role πŸ’….

Parameters: __ch β€” the new character.

Returns: the previous fill character.

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

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


🚩 flags() const

fmtflags std::ios_base::flags () const [inline],  [inherited]

Access to format flags β€” the stream’s whole personality board 🌈.

Returns: the format control flags for both input and output.

Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), std::num_put< _CharT, _OutIter >::do_put(), std::normal_distribution< double >::operator()(), std::operator<<(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), std::__detail::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), and std::operator>>().


πŸ› οΈ flags(fmtflags __fmtfl)

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

Setting new format flags all at once β€” full makeover, no patchwork πŸ’–.

Parameters: __fmtfl β€” the new flags to set.

Returns: the previous format control flags.

This function overwrites all the format flags with __fmtfl.


πŸ”’ gcount() const

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

Character counting β€” the receipts for your last unformatted input moment 🧾.

Returns: the number of characters extracted by the previous unformatted input function dispatched for this stream.

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


πŸ“ get(void)

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

Simple extraction β€” just one little character, bestie πŸ₯Ί.

Returns: a character, or eof().

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

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

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


πŸ«™ get(__streambuf_type & __sb)

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

Extraction into another streambuf β€” passing the snack to a different container 🍱.

Parameters: __sb β€” a streambuf in which to store data.

Returns: *this

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

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


🧺 get(__streambuf_type & __sb, char_type __delim)

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

Extraction into another streambuf, but with a stop sign πŸ›‘.

Parameters: __sb β€” a streambuf in which to store data. __delim β€” a 'stop' character.

Returns: *this

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

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

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

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


πŸ¦‹ get(char_type & __c)

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

Simple extraction β€” one character, but this time it lands in __c 🎯.

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.

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


🧚 get(char_type * __s, streamsize __n)

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

Simple multiple-character extraction.

…okay so bestie, picking right back up with the parameter rundown for that overload πŸ’…

  • __s β€” pointer to an array. literally just a pointer, she's pointing at your char array 🫢
  • __n β€” maximum number of characters to store in s. (yes, the original says s, we don't question it ✨)

Returns β€” *this, as always, so you can chain. iconic behavior πŸ‘‘

And what does it actually return? Glad you asked:

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

That's it. That's the whole vibe check. 🌸

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. like, multiple characters, all at once, no cap πŸ’€

Parameters

  • __s β€” pointer to an array.
  • __n β€” maximum number of characters to store in __s.
  • __delim β€” a 'stop' character. she's the one who says when to stop πŸ›‘

Returns β€” *this

So here's the tea β˜• characters get 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 (she stays in the stream, main character energy, refuses to leave πŸŽ€)

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 β€” This function is not overloaded on signed char and unsigned char. not me checking twice, she simply does not do that πŸ’…

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


✨ template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::getline (char_type * __s, streamsize __n) β€” [inline], [inherited]

String extraction! we love a string extraction moment 🌈

Parameters

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

Returns β€” *this

Returns:

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

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


πŸ’– template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::getline (char_type * __s, streamsize __n, char_type __delim) β€” [inherited]

String extraction, now with a delimiter and everything πŸ¦‹

Parameters

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

Returns β€” *this

She extracts and stores characters into __s until one of the following happens. And listen β€” 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. it's giving precision, it's giving choreography πŸ’…

  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 β€” she's handling it, bestie πŸ™ˆ)

In any case, a null character is stored in the next location in the array. always. every time. πŸŽ€

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 the whole thing. she's special (literally) ⭐


🌸 locale std::ios_base::getloc () const β€” [inline], [inherited]

Locale access πŸ”₯

Returns β€” a copy of the current locale.

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

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 ⚑

Returns β€” True if no error flags are set.

A wrapper around rdstate. that's literally all she is and she's thriving 🫢

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.

Returns β€” a character, or eof().

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

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. again. but with __n this time πŸ’…

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. bye bestie πŸ‘‹πŸ—‘οΈ

Parameters

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

Returns β€” *this

She extracts characters and throws them away until one of the following 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() β€” like, ever. don't come for her πŸ’€
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 fast and legal, we stan πŸ’–

🧚 template<typename _CharT , typename _Traits > locale std::basic_ios< _CharT, _Traits >::imbue (const locale & __loc) β€” [inherited]

Moves to a new locale 🌍✨

Parameters

  • __loc β€” the new locale.

Returns β€” the previous locale.

Calls ios_base::imbue(loc), and if a stream buffer is associated with this stream, calls that buffer's pubimbue(loc). teamwork makes the dream work 🫢

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

References: std::ios_base::imbue().

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


πŸ’œ template<typename _CharT , typename _Traits > void std::basic_ios< _CharT, _Traits >::init (basic_streambuf< _CharT, _Traits > * __sb) β€” [protected], [inherited]

All setup is performed here. This is called from the public constructor. It is not virtual and cannot be redefined. no takebacks, no overrides, we're locked in πŸ”’

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…everybody calls her. she's the moment. 🌟


🌈 long & std::ios_base::iword (int __ix) β€” [inline], [inherited]

Access to integer array πŸ”’

Parameters

  • __ix β€” index into the array.

Returns β€” a reference to an integer associated with the index.

The iword function provides access to an array of integers that can be used for any purpose. The array grows as required to hold the supplied index. All integers in the array are initialized to 0. free real estate, do whatever πŸ’…

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. like, she will move on you, no cap 😭


⭐ template<typename _CharT , typename _Traits > char std::basic_ios< _CharT, _Traits >::narrow (char_type __c, char __dfault) const β€” [inline], [inherited]

Squeezes characters πŸ—œοΈβœ¨

Parameters

  • __c β€” the character to narrow.
  • __dfault β€” the character to narrow.

Returns β€” the narrowed character.

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

Returns the result of:

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

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


πŸ‘‘ template<typename _CharT , typename _Traits > std::basic_ios< _CharT, _Traits >::operator bool () const β€” [inline], [explicit], [inherited]

The quick-and-easy status check. This allows you to write constructs such as if (!a_stream) ... and while (a_stream) ... β€” yes bestie, streams in your if, it's giving convenience πŸŽ€

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


πŸ’… template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT, _Traits >::operator! () const β€” [inline], [inherited]

The quick-and-easy status check. This allows you to write constructs such as if (!a_stream) ... and while (a_stream) ... β€” the ! version, because sometimes you just gotta negate ✨

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


πŸ¦‹ template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (__ios_type &(*)(__ios_type &) __pf) β€” [inline], [inherited]

Interface for manipulators πŸ”§ Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header. she's the glue that makes >> do the cute stuff, obsessed 🫢


πŸ’œ operator>> β€” the manipulator one (__istream_type &(*)(__istream_type &))

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

Okay so this is the interface for manipulators ✨ Manipulators like std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more info, see the iomanip header. iykyk πŸ’…


πŸ¦‹ operator>> β€” extracting into another streambuf (__streambuf_type *__sb)

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

Extracting into another streambuf, bestie πŸ’–

  • __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. Not it. 😭

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

  • the input stream reaches end-of-file,
  • insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted), or
  • an exception occurs (and in this case is caught)

If the function inserts no characters, failbit is set.

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


πŸŽ€ operator>> β€” bool &__n

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

Integer arithmetic extractors, bestie 🫢

  • __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. periodt ✨


🌸 operator>> β€” double &__f

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

Floating point arithmetic extractors πŸ’…

  • __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 &__f

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

Floating point arithmetic extractors, again, and yes she ate 🌈

  • __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 &__n

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

Integer arithmetic extractors (note: no [inline] on this one, she's built different πŸ’€).

  • __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 (ios_base &(*)(ios_base &))

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 &__n

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

Integer arithmetic extractors 🫢

  • __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 &__f

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

Floating point arithmetic extractors ✨

  • __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 &__n

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

Integer arithmetic extractors, big-number edition πŸ‘‘

  • __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 &__n

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

Integer arithmetic extractors (also not [inline], ok werk πŸ’…)

  • __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 &__n

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

Integer arithmetic extractors, unsigned girlie era 🌈

  • __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 &__n

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

Integer arithmetic extractors πŸ’–

  • __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 &__n

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

Integer arithmetic extractors, the biggest unsigned one, main character energy πŸ‘‘

  • __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 &__n

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

Integer arithmetic extractors πŸŽ€

  • __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 *&__p

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

Basic arithmetic extractors 🫢

  • __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 in the stream

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 cap ✨

  • 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. Lowkey the politest function here πŸ™ˆ

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


🌸 std::ios_base::precision() const β€” flags access

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

Flags access πŸ’…

  • Returns: the precision to generate on certain output operations.
Careful, bestie ⚠️ Be careful if you try to give a definition of precision here; see DR 189.

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


🧚 std::ios_base::precision(streamsize __prec) β€” changing flags

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

Changing flags ✨

  • __prec β€” the new precision value.
  • Returns: the previous value of precision().

πŸ”₯ putback β€” unextracting a single character

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

Unextracting a single character, iconic behaviour honestly πŸ‘‘

  • __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. Rip. 😭

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

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

Referenced by std::operator<<().


⭐ std::ios_base::pword β€” access to the void pointer array

void *&std::ios_base::pword(int __ix) [inline], [inherited]

Access to void pointer array 🫢

  • __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.

Heads up 🚨 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. Do not keep the reference, bestie, it will betray you. πŸ’€

πŸŽ€ std::basic_istringstream::rdbuf() const β€” accessing the underlying buffer

template<typename _CharT, typename _Traits, typename _Alloc>
__stringbuf_type *std::basic_istringstream<_CharT, _Traits, _Alloc>::rdbuf() const [inline]

Accessing the underlying buffer ✨

  • Returns: the current basic_stringbuf buffer.

Fun fact: this hides both signatures of std::basic_ios::rdbuf(). Sneaky but slay πŸ’…


πŸ¦‹ std::basic_ios::rdbuf(basic_streambuf< _CharT, _Traits > *__sb) β€” changing the underlying buffer

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

Changing the underlying buffer πŸ’–

  • __sb β€” the new stream buffer.
  • Returns: the previous stream buffer.

Associates a new buffer with the current stream, and clears the error state. Fresh start energy 🌈✨

...and this is where it gets messy, bestie 😭 so buckle up.

okay so real talk: 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 vibes are immaculate but the design is not πŸ’€


🌸 rdstate()

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

Returns the error state of the stream buffer. that's it, that's the function ✨

Returns β€” A bit pattern (well, isn't everything?) 🫢

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

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


πŸ¦‹ read()

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

Extraction without delimiters. no vibes-based stopping, no "ooh a space, guess I'll stop", just characters πŸŽ€

Parameters

  • __s β€” A character array.
  • __n β€” Maximum number of characters to store.

Returns β€” *this

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

  • __n characters are stored
  • the input sequence reaches end-of-file, in which case the error state is set to failbit|eofbit.
Note β€” This function is not overloaded on signed char and unsigned char. not me getting caught out by that literally every time πŸ™ˆ

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

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. she's mindful, she doesn't overreach πŸ’…

Parameters

  • __s β€” A character array.
  • __n β€” Maximum number of characters to store.

Returns β€” The number of characters extracted.

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

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

The goal is to empty the current buffer, and to not request any more from the external input sequence controlled by the streambuf. she said "take what's here and don't go asking for more" and honestly? boundaries 🧚

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

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

Add the callback __fn with parameter __index. putting your girl on the list ✨

Parameters

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

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


🌈 seekg() β€” the offset one

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. we're teleporting, bestie πŸ¦‹

Parameters

  • __off β€” A file offset object.
  • __dir β€” The direction in which to seek.

Returns β€” *this

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

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

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


⭐ seekg() β€” the position one

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

Changing the current read position. same energy, different args πŸ’«

Parameters

  • __pos β€” A file position object.

Returns β€” *this

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

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

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


πŸ“ setf() β€” the one-arg version

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. additive, never subtractive β€” she's a "yes and" girlie 🫢

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


πŸ’– setf() β€” the two-arg version

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

Setting new format flags. again, but with intent πŸŽ€

Parameters

  • __fmtfl β€” Additional flags to set.
  • __mask β€” The flags mask for fmtfl.

Returns β€” The previous format control flags.

This function clears mask in the format flags, then sets fmtfl & mask. An example mask is ios_base::adjustfield. clear first, then set β€” order matters, don't @ me πŸ’…


🧚 setstate()

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

Sets additional flags in the error state. adding to the chaos, not replacing it 😭

Parameters

  • __state β€” The additional state flag(s) to set.

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

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

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

she's everywhere, she's booked and busy πŸ‘‘


πŸ“– str() β€” the getter

template<typename _CharT , typename _Traits , typename _Alloc > __string_type std::basic_istringstream< _CharT, _Traits, _Alloc >::str () const [inline]

Copying out the string buffer. getting the receipts 🫢

Returns β€” rdbuf()->str()


✏️ str() β€” the setter

template<typename _CharT , typename _Traits , typename _Alloc > void std::basic_istringstream< _CharT, _Traits, _Alloc >::str (const __string_type & __s) [inline]

Setting a new buffer. fresh content, who dis πŸ’…

Parameters

  • __s β€” The string to use as a new sequence.

Calls rdbuf()->str(s).


πŸ”„ sync()

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

Synchronizing the stream buffer. aligning energies, but for I/O ✨

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

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

Interaction with the standard C I/O objects. C and C++ finally talking to each other 🫢

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

read that again, bestie: only the standard ones. your own custom streams are living their own life, untouched πŸ’€

πŸ“ tellg()

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

Getting the current read position. "where are we rn" but make it a pos_type πŸ¦‹

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. yeah she plays by her own rules on that one 😭
  • 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().

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

Fetches the current tied stream, bestie. Like, it goes and gets it.

Returns: a pointer to the tied stream, or NULL if the stream isn't tied. No tie, no problem πŸ’…

A stream can be tied (aka synchronized) to a second output stream. Whenever this stream does any I/O, the tied stream gets flushed first. Classic example: std::cin is tied to std::cout. They're literally holding hands 🫢

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

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

Ties this stream to an output stream. Setting up the situationship ✨

Parameters

  • __tiestr β€” the output stream.

Returns: the previously tied output stream, or NULL if the stream wasn't tied before.

This sets up a brand new tie; peep tie() for the deets.

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

Unextracting the previous character. Yes that's a real word, we're going backwards πŸ”™

Returns: *this

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

If rdbuf() is null, or if sungetc() fails, it sets badbit in the error state. Rude but okay πŸ’€

Note β€” this function first clears eofbit. And since no characters are extracted, the next call to gcount() returns 0, exactly as DR 60 requires. Rules are rules.

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

πŸ¦‹ void std::ios_base::unsetf (fmtflags __mask) [inline], [inherited]

Clearing format flags β€” the opposite of setting them, iconically.

Parameters

  • __mask β€” the flags to unset.

This function clears __mask in the format flags. Bye flag πŸ‘‹

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

Widens characters. Glow-up for a single char πŸ’…

Parameters

  • __c β€” the character to widen.

Returns: the widened character.

Maps a character of char to a character of char_type.

It 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 β€” go read them, nerd 🧚

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

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

Flags access πŸ“

Returns: the minimum field width to generate on output operations.

Minimum field width refers to the number of characters. Just characters. That's the whole unit, bestie.

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

πŸ“ streamsize std::ios_base::width (streamsize __wide) [inline], [inherited]

Changing flags. Same name, different job, main character energy πŸ‘‘

Parameters

  • __wide β€” the new width value.

Returns: the previous value of width().

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

Access to unique indices β€” the only one of its kind, fr fr.

Returns: an integer different from all previous calls.

This function returns a unique integer every single time it's called. It can be used for literally any purpose, but it's primarily intended to be a unique index for the iword and pword functions. The whole idea is that an application calls xalloc to get an index into the iword and pword arrays that it can use without any fear of conflict. No drama, no collisions πŸ•ŠοΈ

The implementation keeps a static variable that gets incremented and returned on each invocation. xalloc is guaranteed to return an index that's safe to use in the iword and pword arrays. Signed, sealed, delivered πŸ’–


✨ Member Data Documentation ✨

🧚 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(). It's the receipts for how much was actually read πŸ”₯

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

πŸ’œ const fmtflags std::ios_base::adjustfield [static], [inherited]

A mask of left|right|internal. Super useful for the 2-arg form of setf. Three vibes, one mask 🎭

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

πŸŽ€ const openmode std::ios_base::app [static], [inherited]

Seek to end before each write. Every. Single. Write. Appending like it's a group chat πŸ“±

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

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

Open and seek to end immediately after opening. Not before each write β€” just the once, right at the start. Different from app, don't mix them up bestie πŸ™ˆ

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

πŸ’€ const iostate std::ios_base::badbit [static], [inherited]

Indicates a loss of integrity in an input or output sequence β€” think an irrecoverable read error from a file. This is the bad one. Like, actually bad 😭

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

πŸ”₯ const fmtflags std::ios_base::basefield [static], [inherited]

A mask of dec|oct|hex. Useful for the 2-arg form of setf. Pick your base, babe πŸ”’

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]

Request a seek relative to the beginning of the stream. Back to square one, queen πŸ‘‘

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

⚠️ const openmode std::ios_base::binary [static], [inherited]

Perform input and output in binary mode (as opposed to text mode).

Real talk β€” this is probably not what you think it is. The original page links straight to https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary for the explanation. Go read it before you assume, bestie 🫢

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

🌈 const fmtflags std::ios_base::boolalpha [static], [inherited]

Insert/extract bool in alphabetic rather than numeric format. So it's true/false instead of 1/0. Words, not numbers ✨

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]

Request a seek relative to the current position within the sequence. Here. Right here. πŸ“

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 one, the normal one, the everyone-uses-it one πŸ”Ÿ

Referenced by std::dec().

πŸ“ const seekdir std::ios_base::end [static], [inherited]

Request a seek relative to the current end of the sequence. To the end and beyond πŸš€

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

🧚 const iostate std::ios_base::eofbit [static], [inherited]

Indicates that an input operation reached the end of an input sequence. That's the whole file, bestie, nothing left 🏁

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]

Indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters. Not a total disaster like badbit, just a miss 🫠

(still finishing off that last constant's reference list β€” here's literally everywhere it gets poked at, and yes, a couple of these show up twice, that's just how the original list rolls πŸ’…)

  • 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()
  • std::basic_ostream< _CharT, _Traits >::seekp()

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

Generates floating-point output in fixed-point notation. no more surprise 1e+06 jumpscares bestie πŸ’–

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

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

A mask of scientific|fixed. Lowkey the whole reason the 2-arg form of setf exists β€” it's genuinely useful for that. 🫢

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" of stream states ✨

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 girlies rise πŸ”₯

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. Default for ifstream and fstream. πŸŽ€

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 identical to right if no such point is designated. it's giving "pad in the middle, chaos on purpose" πŸ¦‹

Referenced by std::internal().

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

Adds fill characters on the right (final positions) of certain generated output. (I.e., the thing you print is flush left.) πŸ’–

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

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

Converts integer input or generates integer output in octal base. base 8 stays iconic πŸ™

Referenced by std::oct().

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

Open for output. Default for ofstream and fstream. ✨

Referenced by std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), std::basic_ofstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::basic_filebuf< _CharT, _Traits >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::pbackfail(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_ostream< _CharT, _Traits >::tellp(), and std::basic_filebuf< _CharT, _Traits >::xsputn().

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

Adds fill characters on the left (initial positions) of certain generated output. (I.e., the thing you print is flush right.) πŸ‘‘

Referenced by std::right().

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

Generates floating-point output in scientific notation. 🧚

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

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

Generates a prefix indicating the numeric base of generated integer output. the little 0x that ate, fr fr πŸ’…

Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::noshowbase(), and std::showbase().

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

Generates a decimal-point character unconditionally in generated floating-point output. πŸ“

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

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

Generates a + sign in non-negative generated numeric output. 🌸

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

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

Skips leading white space before certain input operations. the "ignore the vibes, get to the content" flag ⭐

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

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

Truncate an existing stream when opening. Default for ofstream.

⚠️ bestie, clock it: this one nukes what was already in the file when it opens. That's the whole bit. Default behaviour for ofstream, so don't act surprised when your old contents ghost you πŸ’€

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

Flushes output after each output operation. impatient icon behaviour, honestly πŸ™ˆ

Referenced by std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::nounitbuf(), and std::unitbuf().

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

Replaces certain lowercase letters with their uppercase equivalents in generated output. πŸ” 

Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::nouppercase(), and std::uppercase().


πŸ‘‘ Author

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


and that's the whole page babes!! πŸŽ‰πŸ’– this was std::basic_istringstream (stdlib... well, libstdc++, version 3cxx) straight from the Doxygen machine β€” go forth and stream responsibly, mwah πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from