STD::WSTRINGSTREAM(3cxx)

okay bestie, welcome to the std::basic_stri...raits, _Alloc >(3cxx) page โ€” part 1 of 10, and we are not skipping a single crumb. The manual name is folded in right here so you can find it without the wonky header line. ๐Ÿ’…

๐Ÿ’– NAME ๐Ÿ’–

std::basic_stringstream< _CharT, _Traits, _Alloc > โ€” controlling input and output for std::string. That's the whole vibe: it's the string-stream bestie.

โœจ SYNOPSIS โœจ

#include <sstream>

Inherits std::basic_iostream< _CharT, _Traits >.

๐ŸŽ€ Public Types ๐ŸŽ€

  • typedef ctype< _CharT > __ctype_type
  • typedef ctype< _CharT > __ctype_type โ€” yes, it's listed twice in the original, don't come for me ๐Ÿ’€
  • typedef basic_ios< _CharT, _Traits > __ios_type
  • typedef basic_ios< _CharT, _Traits > __ios_type โ€” also twice, and we're keeping it
  • typedef basic_iostream< char_type, traits_type > __iostream_type
  • typedef basic_istream< _CharT, _Traits > __istream_type
  • typedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_type
  • typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type
  • typedef basic_ostream< _CharT, _Traits > __ostream_type
  • typedef basic_streambuf< _CharT, _Traits > __streambuf_type
  • typedef basic_streambuf< _CharT, _Traits > __streambuf_type โ€” another twin, iconic
  • typedef basic_string< _CharT, _Traits, _Alloc > __string_type
  • typedef basic_stringbuf< _CharT, _Traits, _Alloc > __stringbuf_type
  • typedef _Alloc allocator_type
  • typedef _CharT char_type
  • enum event { erase_event, imbue_event, copyfmt_event } โ€” the set of events that may be passed to an event callback.
  • typedef void(* event_callback) (event __e, ios_base &__b, int __i) โ€” the type of an event callback function.
  • typedef _Ios_Fmtflags fmtflags โ€” this is a bitmask type.
  • typedef traits_type::int_type int_type
  • typedef _Ios_Iostate iostate โ€” this is a bitmask type.
  • typedef traits_type::off_type off_type
  • typedef _Ios_Openmode openmode โ€” this is a bitmask type.
  • typedef traits_type::pos_type pos_type
  • typedef _Ios_Seekdir seekdir โ€” this is an enumerated type.
  • typedef _Traits traits_type
  • typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type โ€” yep, it shows up again at the end, that's the original's whole thing ๐Ÿซถ

๐ŸŒธ Public Member Functions ๐ŸŒธ

okay, deep breath, bestie โ€” this is the big list. Every signature stays exactly as written; only the commentary is getting the group-chat treatment. ๐Ÿ’–

  • basic_stringstream () โ€” default constructor, starts with an empty string buffer.
  • basic_stringstream (basic_stringstream &&__rhs)
  • basic_stringstream (const __string_type &__str, ios_base::openmode __m=ios_base::out|ios_base::in) โ€” starts with an existing string buffer.
  • basic_stringstream (const basic_stringstream &)=delete
  • basic_stringstream (ios_base::openmode __m) โ€” starts with an empty string buffer.
  • ~basic_stringstream () โ€” the 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)
  • basic_stringstream & operator= (basic_stringstream &&__rhs)
  • basic_stringstream & operator= (const basic_stringstream &)=delete
  • __istream_type & operator>> (__streambuf_type *__sb) โ€” extracting into another streambuf.
  • __istream_type & operator>> (void *&__p) โ€” basic arithmetic extractors.
  • streamsize precision () const โ€” flags access.
  • streamsize precision (streamsize __prec) โ€” changing flags.
  • void *& pword (int __ix) โ€” access to void pointer array.
  • __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.
  • __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.
  • __string_type str () const โ€” copying out the string buffer.
  • void str (const __string_type &__s) โ€” setting a new buffer.
  • void swap (basic_stringstream &__rhs)
  • pos_type tellp () โ€” getting the current write position.
  • basic_ostream< _CharT, _Traits > * tie () const โ€” fetches the current tied stream.
  • basic_ostream< _CharT, _Traits > * tie (basic_ostream< _CharT, _Traits > *__tiestr) โ€” ties this stream to an output stream.
  • void unsetf (fmtflags __mask) โ€” clearing format flags.
  • basic_string_view< char_type, traits_type > view () const noexcept
  • 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 ๐Ÿ”ฅ

okay so every single operator>> (a.k.a. the formatted input functions) shares some common behavior. Each one starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to false. That does several things, and it ends with setting a status flag; peek the sentry documentation for the full lore.

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 one starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to true. That 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 () โ€” the simplest lil extraction, literally just grab one character and go ๐Ÿซถ
  • __istream_type & get (char_type &__c) โ€” same simple extraction, except the character lands in __c
  • __istream_type & get (char_type *__s, streamsize __n, char_type __delim) โ€” simple multiple-character extraction, stopping at __delim ๐Ÿ’…
  • __istream_type & get (char_type *__s, streamsize __n) โ€” simple multiple-character extraction, no delimiter era
  • __istream_type & get (__streambuf_type &__sb, char_type __delim) โ€” extraction straight into another streambuf, stopping at __delim
  • __istream_type & get (__streambuf_type &__sb) โ€” extraction into another streambuf, periodt
  • __istream_type & getline (char_type *__s, streamsize __n, char_type __delim) โ€” string extraction ๐ŸŽ€
  • __istream_type & getline (char_type *__s, streamsize __n) โ€” string extraction, default vibes
  • __istream_type & ignore (streamsize __n, int_type __delim) โ€” discarding characters, we simply do not perceive them โœจ
  • __istream_type & ignore (streamsize __n) โ€” simple extraction (yes bestie, the label really does say that)
  • __istream_type & ignore () โ€” simple extraction again, no args no thoughts
  • int_type peek () โ€” looking ahead in the stream ๐Ÿ‘€ you're nosy but make it legal
  • __istream_type & read (char_type *__s, streamsize __n) โ€” extraction without delimiters, no manners at all
  • streamsize readsome (char_type *__s, streamsize __n) โ€” extraction until the buffer is exhausted, but no more. Respects the limit fr fr
  • __istream_type & putback (char_type __c) โ€” unextracting a single character, gaslighting the stream into thinking it never left
  • __istream_type & unget () โ€” unextracting the previous character, the uno reverse card ๐Ÿฆ‹
  • int sync () โ€” synchronizing the stream buffer
  • pos_type tellg () โ€” getting the current read position, where are we even ๐Ÿ“
  • __istream_type & seekg (pos_type) โ€” changing the current read position
  • __istream_type & seekg (off_type, ios_base::seekdir) โ€” changing the current read position, but with extra instructions
  • operator bool () const โ€” the quick-and-easy status check ๐Ÿ‘‘
  • bool operator! () const โ€” the quick-and-easy status check, but inverted bestie
  • __ostream_type & operator<< (__ostream_type &(*__pf)(__ostream_type &)) โ€” interface for manipulators
  • __ostream_type & operator<< (__ios_type &(*__pf)(__ios_type &)) โ€” interface for manipulators
  • __ostream_type & operator<< (ios_base &(*__pf)(ios_base &)) โ€” interface for manipulators

๐ŸŒˆ Inserters ๐ŸŒˆ

okay so listen, all the operator<< functions (aka the formatted output functions, fancy name i know) have some common behavior, and you will be tested on it ๐Ÿ’€

Each one starts by constructing a temporary object of type std::basic_ostream::sentry. That lil guy can have several effects, and it concludes with the setting of a status flag โ€” see the sentry documentation for more, i'm not doing its whole lore dump here.

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

If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state without causing an ios_base::failure to be thrown. The original exception will then be rethrown. so like, chaos but contained ๐Ÿ™ˆ

  • __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 ๐Ÿงš

bestie, these ones have their own common behavior, don't mix them up ๐ŸŽ€

Each one starts by constructing a temporary object of type std::basic_ostream::sentry. This has several effects, concluding with the setting of a status flag โ€” see the sentry documentation for more, again.

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

If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state. If badbit is on in the stream's exceptions mask, the exception will be rethrown without completing its actions. that's the difference, ok, write it down ๐Ÿ“

  • __ostream_type & put (char_type __c) โ€” simple insertion
  • __ostream_type & write (const char_type *__s, streamsize __n) โ€” character string insertion, the whole squad goes in ๐Ÿ’œ

โญ Static Public Member Functions โญ

  • static bool sync_with_stdio (bool __sync=true) โ€” interaction with the standard C I/O objects. note the default __sync=true, she's opt-out
  • static int xalloc () throw () โ€” access to unique indices ๐Ÿ”ฅ

๐Ÿ’– Static Public Attributes ๐Ÿ’–

  • static const openmode __noreplace
  • static const fmtflags adjustfield โ€” a mask of left|right|internal. useful for the 2-arg form of setf
  • static const openmode app โ€” seek to end before each write
  • static const openmode ate โ€” open and seek to end immediately after opening
  • static const iostate badbit โ€” indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file) ๐Ÿ˜ญ
  • static const fmtflags basefield โ€” a mask of dec|oct|hex. useful for the 2-arg form of setf
  • static const seekdir beg โ€” request a seek relative to the beginning of the stream
  • static const openmode binary โ€” perform input and output in binary mode (as opposed to text mode). This is probably not what you think it is; see https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary. no cap, go read it ๐Ÿ™ˆ
  • static const fmtflags boolalpha โ€” insert/extract bool in alphabetic rather than numeric format
  • static const seekdir cur โ€” request a seek relative to the current position within the sequence
  • static const fmtflags dec โ€” converts integer input or generates integer output in decimal base
  • static const seekdir end โ€” request a seek relative to the current end of the sequence
  • static const iostate eofbit โ€” indicates that an input operation reached the end of an input sequence
  • static const iostate failbit โ€” indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters ๐Ÿ’€
  • static const fmtflags fixed โ€” generate floating-point output in fixed-point notation
  • static const fmtflags floatfield โ€” a mask of scientific|fixed. useful for the 2-arg form of setf
  • static const iostate goodbit โ€” indicates all is well ๐Ÿซถ the good ending
  • static const fmtflags hex โ€” converts integer input or generates integer output in hexadecimal base
  • static const openmode in โ€” open for input. default for ifstream and fstream
  • static const fmtflags internal โ€” adds fill characters at a designated internal point in certain generated output, or identical to right if no such point is designated
  • static const fmtflags left โ€” adds fill characters on the right (final positions) of certain generated output. (I.e., the thing you print is flush left.)
  • static const fmtflags oct โ€” converts integer input or generates integer output in octal base
  • static const openmode out โ€” open for output. default for ofstream and fstream
  • static const fmtflags right โ€” adds fill characters on the left (initial positions) of certain generated output. (I.e., the thing you print is flush right.)
  • static const fmtflags scientific โ€” generates floating-point output in scientific notation
  • static const fmtflags showbase โ€” generates a prefix indicating the numeric base of generated integer output
  • static const fmtflags showpoint โ€” generates a decimal-point character unconditionally in generated floating-point output
  • static const fmtflags showpos โ€” generates a + sign in non-negative generated numeric output
  • static const fmtflags skipws โ€” skips leading white space before certain input operations
  • static const openmode trunc โ€” truncate an existing stream when opening. default for ofstream
  • static const fmtflags unitbuf โ€” flushes output after each output operation
  • static const fmtflags uppercase โ€” replaces certain lowercase letters with their uppercase equivalents in generated output

๐Ÿฆ‹ Protected Types ๐Ÿฆ‹

  • enum { _S_local_word_size }

๐ŸŒธ Protected Member Functions ๐ŸŒธ

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

๐Ÿ’€ Protected Attributes ๐Ÿ’€

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

๐Ÿ‘‘ Detailed Description ๐Ÿ‘‘

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

Controlling input and output for std::string. that's the whole assignment bestie, main character energy ๐Ÿ’…

๐ŸŽ€ 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 and writing to objects of type std::basic_string, using the inherited functions from std::basic_iostream. To control the associated sequence, an instance of std::basic_stringbuf is used, which this page refers to as sb. and that's the tea โ˜• iykyk

๐ŸŒธ Member Typedef Documentation ๐ŸŒธ

๐Ÿ’– std::basic_ios< _CharT, _Traits >::__num_put_type (inherited)

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

Heads up bestie: these are non-standard types. โœจ


๐ŸŽ€ std::ios_base::event_callback (inherited)

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(). ๐Ÿซถ


๐Ÿฆ‹ std::ios_base::fmtflags (inherited)

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

๐ŸŒˆ std::ios_base::iostate (inherited)

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

๐Ÿ”ฅ std::ios_base::openmode (inherited)

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

๐Ÿ‘‘ std::ios_base::seekdir (inherited)

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)

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 ๐ŸŽ€

๐Ÿ’… basic_stringstream() โ€” default constructor

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

Default constructor starts with an empty string buffer. Initializes sb using the mode in|out, 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. ๐Ÿ˜ญ

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


๐Ÿซถ basic_stringstream(ios_base::openmode __m) โ€” explicit

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

Starts with an empty string buffer. ๐ŸŒธ

Parameters:

  • __m โ€” whether the buffer can read, or write, or both.

Initializes sb using the mode from __m, 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. ๐Ÿ˜ญ

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


๐Ÿฆ‹ basic_stringstream(const __string_type & __str, ios_base::openmode __m = ios_base::out | ios_base::in) โ€” explicit

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

Starts with an existing string buffer. ๐Ÿ’œ

Parameters:

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

Initializes sb using __str and __m, 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. ๐Ÿ˜ญ

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


๐ŸŒˆ ~basic_stringstream() โ€” destructor

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

The destructor does nothing. The buffer is deallocated by the stringbuf object, not the formatting stream. ๐Ÿ‘‘


๐Ÿ’– Member Function Documentation ๐Ÿ’–

๐ŸŒŸ std::ios_base::_M_getloc() โ€” inherited

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. ๐ŸŽ€

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


๐Ÿฆ‹ std::basic_ios< _CharT, _Traits >::bad() โ€” inherited

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

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

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


๐Ÿ”ฅ std::basic_ios< _CharT, _Traits >::clear(iostate __state = goodbit) โ€” inherited

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.

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


๐ŸŽ€ std::basic_ios< _CharT, _Traits >::copyfmt(const basic_ios< _CharT, _Traits > & __rhs) โ€” inherited

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. ๐Ÿซถ

Parameters:

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

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


๐ŸŒธ std::basic_ios< _CharT, _Traits >::eof() โ€” inherited

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. Note that other iostate flags may also be set. ๐Ÿ’–

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


๐Ÿฆ‹ std::basic_ios< _CharT, _Traits >::exceptions() โ€” inherited

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

Throwing exceptions on errors. 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().


๐Ÿซถ std::basic_ios< _CharT, _Traits >::exceptions(iostate __except) โ€” inherited

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

Throwing exceptions on errors. ๐Ÿ’…

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


๐ŸŒˆ std::basic_ios< _CharT, _Traits >::fail() โ€” inherited

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


๐Ÿ‘‘ std::basic_ios< _CharT, _Traits >::fill() โ€” inherited

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. ๐ŸŽ€

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

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

๐Ÿ’– <code>char_type std::basic_ios&lt;_CharT, _Traits&gt;::fill (char_type __ch) [inline], [inherited]</code> โ€” setting the fill char

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

Okay so this one sets a brand-new empty character. That's the whole vibe. ๐ŸŽ€

Parameters

  • __ch โ€” the new character, bestie.

Returns โ€” the previous fill character. It's giving "here's what you had before, don't say I never gave you anything". ๐Ÿ’…

So like, the fill character is what gets 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. Iconic default honestly.

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


๐Ÿ”ฅ <code>fmtflags std::ios_base::flags () const [inline], [inherited]</code> โ€” peeking at the flags

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

Access to format flags, no cap. ๐Ÿซถ

Returns โ€” the format control flags for both input and output. Both of them. She's multifaceted.

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

(yes the std::operator>>() really does show up that many times, I'm not doing a bit, the list is just like that ๐Ÿ˜ญ)


โœจ <code>fmtflags std::ios_base::flags (fmtflags __fmtfl) [inline], [inherited]</code> โ€” setting them all at once

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

Setting new format flags, all at once, main character energy. ๐Ÿ‘‘

Parameters

  • __fmtfl โ€” the new flags to set.

Returns โ€” the previous format control flags.

Heads up: this function overwrites all the format flags with __fmtfl. Not a merge, not a little update โ€” a full overwrite. So know what you're doing, bestie. ๐Ÿ’€


๐ŸŒŠ <code>basic_ostream&lt;_CharT, _Traits&gt; &amp; std::basic_ostream&lt;_CharT, _Traits&gt;::flush () [inherited]</code> โ€” syncing the stream buffer

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

Synchronizing the stream buffer. The way that this one just does things. ๐ŸŒธ

Returns โ€” *this

If rdbuf() is a null pointer, changes nothing. Nothing at all. Chill.

Otherwise, it calls rdbuf()->pubsync(), and if that returns -1, sets badbit. So there's a real chance of a bad time here. ๐Ÿ™ˆ

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


๐Ÿงฎ <code>streamsize std::basic_istream&lt;_CharT, _Traits&gt;::gcount () const [inline], [inherited]</code> โ€” character counting

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

Character counting. She's literally just counting. ๐ŸŽ€

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

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


๐Ÿ“ <code>basic_istream&lt;_CharT, _Traits&gt;::int_type std::basic_istream&lt;_CharT, _Traits&gt;::get (void) [inherited]</code> โ€” the simple extraction

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

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

Tries to extract a character. If none are available, sets failbit and returns traits::eof(). That's it, that's the function. ๐Ÿ’œ

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


๐Ÿฆ‹ <code>__istream_type &amp; std::basic_istream&lt;_CharT, _Traits&gt;::get (__streambuf_type &amp; __sb) [inline], [inherited]</code> โ€” extraction into another streambuf

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

Parameters

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

Returns โ€” *this

Literally just returns get(__sb,widen('\n')). A lil one-liner. She's delegating and honestly? Respect. โœจ

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


๐ŸŒˆ <code>basic_istream&lt;_CharT, _Traits&gt; &amp; std::basic_istream&lt;_CharT, _Traits&gt;::get (__streambuf_type &amp; __sb, char_type __delim) [inherited]</code> โ€” extraction with a stop char

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

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.


๐Ÿ’… <code>basic_istream&lt;_CharT, _Traits&gt; &amp; std::basic_istream&lt;_CharT, _Traits&gt;::get (char_type &amp; __c) [inherited]</code> โ€” simple extraction, by reference

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

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(). Same drama as before, just with somewhere to put the result. ๐ŸŽ€

Note โ€” this function is not overloaded on signed char and unsigned char. Read that twice, bestie. ๐Ÿ”ฅ

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


๐ŸŒธ <code>__istream_type &amp; std::basic_istream&lt;_CharT, _Traits&gt;::get (char_type * __s, streamsize __n) [inline], [inherited]</code> โ€” multi-character extraction

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

Parameters

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

Returns โ€” *this

Returns get(__s,__n,widen('\n')). Another lil handoff, we love a delegation queen. ๐Ÿงš

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


๐Ÿ‘‘ <code>basic_istream&lt;_CharT, _Traits&gt; &amp; std::basic_istream&lt;_CharT, _Traits&gt;::get (char_type * __s, streamsize __n, char_type __delim) [inherited]</code> โ€” the full multi-char version

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

Parameters

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

Returns โ€” *this

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

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

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

In any case, a null character is stored into the next location in the array. Always. Non-negotiable. ๐Ÿ’–

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


๐Ÿ“– <code>__istream_type &amp; std::basic_istream&lt;_CharT, _Traits&gt;::getline (char_type * __s, streamsize __n) [inline], [inherited]</code> โ€” string extraction

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

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, another delegate. ๐ŸŒŸ

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


๐ŸŽ€ <code>basic_istream&lt;_CharT, _Traits&gt; &amp; std::basic_istream&lt;_CharT, _Traits&gt;::getline (char_type * __s, streamsize __n, char_type __delim) [inherited]</code> โ€” the real string extraction

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

Parameters

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

Returns โ€” *this

Extracts and stores characters into __s until one of the following happens. Note that these criteria are required to be tested in the order listed here, to allow an input line to exactly fill the __s array without setting failbit. The order is load-bearing, iykyk. ๐Ÿ”ฅ

  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 said what she said. ๐Ÿ’…)

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

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


๐Ÿงš <code>basic_istream&lt;char&gt; &amp; std::basic_istream&lt;char&gt;::getline (char_type * __s, streamsize __n, char_type __delim) [inherited]</code> โ€” the special one

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-cased and shipped off to her own file. Main character. ๐Ÿ‘‘


๐ŸŒ <code>locale std::ios_base::getloc () const [inline], [inherited]</code> โ€” locale access

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

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

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


โญ <code>bool std::basic_ios&lt;_CharT, _Traits&gt;::good () const [inline], [inherited]</code> โ€” fast error checking

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

Returns โ€” true if no error flags are set.

Literally just a wrapper around rdstate. Short, sweet, does the job. ๐Ÿซถ

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


๐Ÿ™ˆ <code>basic_istream&lt;_CharT, _Traits&gt; &amp; std::basic_istream&lt;_CharT, _Traits&gt;::ignore (void) [inherited]</code> โ€” simple extraction

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

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

Tries to extract a character. If none are available, sets failbit and returns traits::eof(). (The docs really said "copy paste? no, copy paste with confidence" ๐Ÿ˜ญ)

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


๐ŸŒŸ <code>basic_istream&lt;_CharT, _Traits&gt; &amp; std::basic_istream&lt;_CharT, _Traits&gt;::ignore (streamsize __n) [inherited]</code> โ€” simple extraction, counting edition

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

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


๐Ÿ’€ <code>basic_istream&lt;_CharT, _Traits&gt; &amp; std::basic_istream&lt;_CharT, _Traits&gt;::ignore (streamsize __n, int_type __delim) [inherited]</code>

template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
    > & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n,
    int_type __delim) [inherited]

Discarding characters.

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

Returns: *this โœจ

So what it does is extract characters and justโ€ฆ throw 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 (and in this case, the character is extracted โ€” it gets eaten too ๐Ÿ“); note that this condition will never occur if __delim equals traits::eof()
NB: it provides three overloads instead of the single function (with defaults) that the Standard mandates โ€” this leads to a better performing implementation, while still conforming to the Standard ๐Ÿ‘‘

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

  • __loc โ€” the new locale.

Returns: the previous locale.

It calls ios_base::imbue(loc), and if a stream buffer is associated with this stream, it calls that buffer's pubimbue(loc). no cap, it's thorough ๐Ÿซถ

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 the setup lives here ๐ŸŽ€

This is called from the public constructor. It is not virtual and cannot be redefined. periodt.

Referenced by std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ios< _CharT, _Traits >::basic_ios(), std::basic_istream< _CharT, _Traits >::basic_istream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ostream< _CharT, _Traits >::basic_ostream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream(), std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream(), and std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream().

(likeโ€ฆ every stream constructor ever, bestie. iconic behaviour honestly ๐Ÿ˜ญ)


long & std::ios_base::iword (int __ix) [inline], [inherited] โ€” access to the integer array ๐Ÿ”ข

  • __ix โ€” index into the array.

Returns: a reference to an integer associated with the index.

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

โš ๏ธ The implementation reserves several indices, so 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, do not clutch that reference, it will betray you.

template<typename _CharT , typename _Traits > char std::basic_ios< _CharT, _Traits >::narrow (char_type __c, char __dfault) const [inline], [inherited] โ€” squeezes characters ๐Ÿงš

  • __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 lets you write constructs such as if (!a_stream) ... and while (a_stream) ...

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, but with a ! ๐Ÿšจ

This lets you write constructs such as if (!a_stream) ... and while (a_stream) ...

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


template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (__ios_type &(*)(__ios_type &) __pf) [inline], [inherited] โ€” interface for manipulators ๐ŸŽ›๏ธ

Manipulators such as std::endl and std::hex use these functions in constructs like 'std::cout << std::endl'. For more information, see the iomanip header.


template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (__ostream_type &(*)(__ostream_type &) __pf) [inline], [inherited] โ€” interface for manipulators, the sequel ๐ŸŽ›๏ธโœจ

Manipulators such as std::endl and std::hex use these functions in constructs like 'std::cout << std::endl'. For more information, see the iomanip header.


template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (__streambuf_type * __sb) [inherited] โ€” extracting from another streambuf ๐Ÿซ—

  • __sb โ€” a pointer to a streambuf.

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

If __sb is NULL, the stream will set failbit in its error state ๐Ÿ’€

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

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

If the function inserts no characters, failbit is set.


template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (bool __n) [inline], [inherited] โ€” integer arithmetic inserter ๐Ÿ‘‘

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

Returns: *this if successful.

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


template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (const void * __p) [inline], [inherited] โ€” pointer arithmetic inserter ๐Ÿ“

  • __p โ€” a variable of pointer type.

Returns: *this if successful.

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


template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (double __f) [inline], [inherited] โ€” floating point arithmetic inserter ๐Ÿฆ‹

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

Returns: *this if successful.

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


template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (float __f) [inline], [inherited] โ€” floating point arithmetic inserter, the float edition ๐ŸŒธ

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

Returns: *this if successful.

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


template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (int __n) [inherited] โ€” integer arithmetic inserter, int flavoured ๐Ÿ”ฅ

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

Returns: *this if successful.

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


template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (ios_base &(*)(ios_base &) __pf) [inline], [inherited] โ€” interface for manipulators, part three ๐ŸŽ›๏ธ๐Ÿ’œ

Manipulators such as std::endl and std::hex use these functions in constructs like 'std::cout << std::endl'. For more information, see the iomanip header.


template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long __n) [inline], [inherited] โ€” integer arithmetic inserter, long 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 perform numeric formatting.


template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long double __f) [inline], [inherited] โ€” floating point arithmetic inserter, long double edition โญ

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

Returns: *this if successful.

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


template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long long __n) [inline], [inherited] โ€” integer arithmetic inserter, long long 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 perform numeric formatting.


template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (short __n) [inherited] โ€” integer arithmetic inserter, short 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 perform numeric formatting.

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


template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned int __n) [inline], [inherited] โ€” integer arithmetic inserter, unsigned int edition ๐Ÿ’–

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

Returns: *this if successful.

๐Ÿ’– operator<< โ€” unsigned long inserter

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

Integer arithmetic inserters, bestie. โœจ

  • Parameters
    • _n โ€” a variable of builtin integral type.
  • Returns โ€” *this if successful.

Lowkey these functions use the stream's current locale (specifically, the num_get facet) to do the numeric formatting. That's the whole vibe. ๐ŸŽ€


๐Ÿ’– operator<< โ€” unsigned long long inserter

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

Another integer arithmetic inserter, same energy, bigger number. ๐Ÿ”ฅ

  • Parameters
    • _n โ€” a variable of builtin integral type.
  • Returns โ€” *this if successful.

And yeah โ€” these use the stream's current locale (specifically the num_get facet) to perform numeric formatting. No cap. ๐Ÿ’…


๐Ÿ’– operator<< โ€” unsigned short inserter

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

Integer arithmetic inserters, the short king edition. ๐Ÿ‘‘

  • 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. Periodt. ๐ŸŒธ


๐Ÿฆ‹ operator>> โ€” manipulator via __ios_type &(*) (__ios_type &)

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

This is the interface for manipulators. Like, manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more info, go look at the iomanip header. โœจ


๐Ÿฆ‹ operator>> โ€” manipulator via __istream_type &(*) (__istream_type &)

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

Same deal, the 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 you should see the iomanip header. ๐ŸŽ€


๐ŸŒˆ 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.

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

If __sb is NULL, the stream will set failbit in its error state. ๐Ÿšจ

Characters are extracted from this stream and inserted into the __sb streambuf until one of these things happens:

  • the input stream reaches end-of-file,
  • insertion into the output buffer fails (and in this case, the character that would have been inserted is not extracted), or
  • an exception occurs (and in this case it 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 & extractor

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

Integer arithmetic extractors, the reading-in version. ๐Ÿ“–

  • 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>> โ€” double & extractor

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


๐Ÿ“ operator>> โ€” float & extractor

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

Floating point arithmetic extractors, float-sized. ๐ŸŒธ

  • 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. Ngl, that facet is carrying the whole team. ๐Ÿ’…


๐Ÿงš operator>> โ€” int & extractor

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

Integer arithmetic extractors. ๐ŸŽ€

  • Parameters
    • _n โ€” a variable of builtin integral type.
  • Returns โ€” *this if successful.

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


๐Ÿงš operator>> โ€” manipulator via 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 โ€” yes, again, iconic behaviour. 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 & extractor

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

Integer arithmetic extractors, long edition. ๐Ÿ“

  • 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 & extractor

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

Floating point arithmetic extractors, extra precision energy. ๐Ÿ”ฅ

  • 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 & extractor

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

Integer arithmetic extractors โ€” long long, so you know it's serious. ๐Ÿ’€

  • 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 & extractor

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

Integer arithmetic extractors, short and sweet. ๐Ÿ“

  • 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 & extractor

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

Integer arithmetic extractors. ๐ŸŽ€

  • Parameters
    • _n โ€” a variable of builtin integral type.
  • Returns โ€” *this if successful.

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


๐ŸŒŸ operator>> โ€” unsigned long & extractor

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

Integer arithmetic extractors. ๐Ÿ’œ

  • Parameters
    • _n โ€” a variable of builtin integral type.
  • Returns โ€” *this if successful.

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


๐ŸŒŸ operator>> โ€” unsigned long long & extractor

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

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

Integer arithmetic extractors. ๐Ÿงš

  • Parameters
    • _n โ€” a variable of builtin integral type.
  • Returns โ€” *this if successful.

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


โญ operator>> โ€” void *& extractor

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

Basic arithmetic extractors โ€” pointer flavour. ๐Ÿซถ

  • 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 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, like subtly checking the group chat before you reply. ๐Ÿ™ˆ

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

If, after constructing the sentry object, good() is false, it returns traits::eof(). Otherwise it reads but does not extract the next input character. Yes โ€” looks but doesn't touch. โœจ

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


๐ŸŽš๏ธ precision() โ€” flags access (read it)

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

Flags access. ๐ŸŽ€

  • Returns โ€” the precision to generate on certain output operations.
Be careful if you try to give a definition of precision here; see DR 189. ๐Ÿ˜ญ

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


๐ŸŽš๏ธ precision() โ€” changing flags (set it)

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 receipts, cute. ๐Ÿ’…

โœ๏ธ put โ€” simple insertion

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

Simple insertion, main character energy. ๐Ÿ‘‘

  • Parameters
    • _c โ€” the character to insert.
  • Returns โ€” *this

It tries to insert __c.

Note: this function is not overloaded on signed char and unsigned char. So don't come for it. ๐Ÿ’€

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

Referenced by std::endl(), and std::ends(). ๐ŸŒˆ


โ†ฉ๏ธ putback โ€” unextracting a single character

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

Unextracting a single character โ€” literally the undo button of streams. ๐Ÿ˜ญ

  • Parameters
    • _c โ€” the character to push back into the input stream.
  • Returns โ€” *this

If rdbuf() is not null, it calls rdbuf()->sputbackc(c). โœจ

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

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

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

Referenced by std::operator<<().


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

Okay so this one is literally your all-access pass to the void pointer array ๐Ÿ‘‘ โ€” access to void pointer array, that's the whole vibe.

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 ๐Ÿ˜ญ โ€” like, bestie, grab the value and let the reference go, fr fr.


๐Ÿฆ‹ template<typename _CharT , typename _Traits , typename _Alloc > __stringbuf_type * std::basic_stringstream< _CharT, _Traits, _Alloc >::rdbuf () const [inline]

Accessing the underlying buffer. The main character returns ๐Ÿ’…

Returns

The current basic_stringbuf buffer.

Heads up ๐Ÿ™ˆ โ€” this hides both signatures of std::basic_ios::rdbuf().

๐ŸŒธ 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 โ€” glow-up edition ๐ŸŽ€

Parameters

  • __sb โ€” The new stream buffer.

Returns

The previous stream buffer.

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

So here's the drama ๐Ÿ’€ โ€” 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, that's not a suggestion, that's the whole requirement ๐Ÿ˜ค


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

Returns the error state of the stream buffer. The vibe check of the whole stream, honestly ๐ŸŒˆ

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


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

Extraction without delimiters. No separators, no chill, just raw 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.

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 > 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 "take what's on the plate, don't ask the kitchen for extra" ๐Ÿ“

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. Very "clean up your own room" energy ๐Ÿ’…

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


๐Ÿ’– void std::ios_base::register_callback (event_callback __fn, int __index) [inherited]

Add the callback __fn with parameter __index. Like adding someone to the group chat, but for events ๐Ÿ‘‘

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 ๐Ÿ™…โ€โ™€๏ธ


๐ŸŒˆ 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. Cue the map app voice ๐Ÿ—บ๏ธโœจ

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


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

Changing the current read position โ€” the absolute-coordinates version ๐Ÿฆ‹

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


๐ŸŒŸ 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 โ€” the output side finally gets a turn ๐Ÿ’…

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


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

Changing the current write position โ€” exact address only, no directions needed โญ

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


๐ŸŒผ fmtflags std::ios_base::setf (fmtflags __fmtfl) [inline], [inherited]

Setting new format flags. Putting on accessories, but for your stream ๐ŸŽ€โœจ

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. Nothing gets removed, everything just gets added, love that for us ๐Ÿ’–

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


๐Ÿ’ซ fmtflags std::ios_base::setf (fmtflags __fmtfl, fmtflags __mask) [inline], [inherited]

Setting new format flags, but make it surgical ๐Ÿ’…

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.


๐Ÿ‘‘ 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 situation, 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().

And the Referenced by list for that one is literally the whole group chat โ€” every single one, no cuts:

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

๐Ÿ“ค str () const โ€” copying out the string buffer

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

Bestie, this is the โ€œgimme the bufferโ€ moment. Itโ€™s copying out the string buffer.

Returns: rdbuf()->str()


๐Ÿ“ฅ str (const __string_type & __s) โ€” setting a new buffer

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

This one is the โ€œnew buffer just droppedโ€ energy. Itโ€™s setting a new buffer.

Parameters:

  • __s โ€” the string to use as a new sequence.

Calls rdbuf()->str(s).


๐Ÿ”„ sync (void) โ€” synchronizing the stream buffer

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

Okay so this is the synchronizing the stream buffer situation.

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 โ€” standard C I/O, but make it C++

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

Interaction with the standard C I/O objects โ€” yes, the classic crossover episode.

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 (void) โ€” getting the current read position

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

This is the getting the current read position vibe.

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]

Same energy, but for writing: getting the current write position.

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 โ€” fetching the current tied stream

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

Fetches the current tied stream โ€” like checking who your stream is linked to in the group chat.

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 (basic_ostream< _CharT, _Traits > * __tiestr) โ€” tying to an output stream

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

Ties this stream to an output stream. New link unlocked.

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 (void) โ€” unextracting the previous character

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

The unextracting the previous character move. Putting it back, bestie.

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]

Clearing format flags. Wiping the mask, not the whole personality.

Parameters:

  • __mask โ€” the flags to unset.

This function clears __mask in the format flags.


๐Ÿงš widen (char __c) const โ€” widens characters

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.

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]

Flags access, but make it width.

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 (streamsize __wide) โ€” changing flags

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

Changing flags โ€” new width, who dis?

Parameters:

  • __wide โ€” the new width value.

Returns: the previous value of width().


โœ๏ธ write (const char_type * __s, streamsize __n) โ€” 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]

<orange>Character string insertion</orange> โ€” writing a whole chunk, not just one little char.

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]

Access to unique indices โ€” the โ€œeveryone gets their own lockerโ€ function.

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 extraction counter

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 โ€” the alignment mask

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 โ€” append mode

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

Seek to end before each write.

(picking up the reference list from the entry right above โ€” no cap, we're mid-sentence ๐Ÿ’…)

โ€ฆand she's also 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]

Opens the thing and then immediately seeks to the end. Like walking into a party and heading straight to the back of the room. Obsessed.

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

๐Ÿ˜ญ const iostate std::ios_base::badbit [static], [inherited]

The drama queen of the iostate family. This one literally means a loss of integrity in an input or output sequence โ€” think irrecoverable read error from a file. It's giving "we're so done." When badbit shows up, bestie, it is not a vibe.

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()
  • std::ws()

๐ŸŽ€ const fmtflags std::ios_base::basefield [static], [inherited]

A mask of dec|oct|hex. Super handy for the 2-arg form of setf. That's it, that's the whole personality.

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]

Requests a seek relative to the beginning of the stream. Main character position: the start. ๐Ÿซถ

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

๐Ÿฆ‹ const openmode std::ios_base::binary [static], [inherited]

Performs input and output in binary mode โ€” as opposed to text mode. And listen, this is probably not what you think it is; the docs literally say so. Go read https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary before you @ me. ๐Ÿ™ˆ

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

๐ŸŒธ const fmtflags std::ios_base::boolalpha [static], [inherited]

Inserts/extracts bool in alphabetic rather than numeric format. So true/false instead of 1/0. Slay, honestly.

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]

Requests a seek relative to the current position within the sequence. Right here, right now, no cap.

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

๐Ÿ”ฅ const fmtflags std::ios_base::dec [static], [inherited]

Converts integer input, or generates integer output, in base ten. The normal one. The default one. The one everyone forgets to appreciate. ๐Ÿฅฒ

Referenced by std::dec().

๐ŸŒˆ const seekdir std::ios_base::end [static], [inherited]

Requests a seek relative to the current end of the sequence. The finale, the curtain call, the last slide of the presentation.

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

๐Ÿ’€ const iostate std::ios_base::eofbit [static], [inherited]

Means an input operation reached the end of an input sequence. Yes bestie, EOF is a whole state flag and she has a huge friend group. Buckle up:

  • 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()
  • std::ws()

๐Ÿ“ const iostate std::ios_base::failbit [static], [inherited]

The "you had ONE job" flag. It means an input operation failed to read the expected characters, or an output operation failed to generate the desired characters. Not the end of the world (that's badbit), but definitely a moment. ๐Ÿ˜ญ

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

๐ŸŽ€ const fmtflags std::ios_base::fixed [static], [inherited]

Generates floating-point output in fixed-point notation. Like 3.140000 instead of 3.14e+00. She's precise, she's committed, she's showing all her digits. โœจ

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

๐Ÿงš const fmtflags std::ios_base::floatfield [static], [inherited]

A mask of scientific|fixed. Useful for the 2-arg form of setf. The picker-outer for how your floats get dressed. ๐Ÿ’œ

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

๐Ÿ‘‘ const iostate std::ios_base::goodbit [static], [inherited]

Indicates all is well. ๐ŸŒˆ The "no thoughts, head empty, everything's fine" flag. She's referenced everywhere because everyone wants to get back to her:

  • 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()
  • std::ws()

๐ŸŒธ const fmtflags std::ios_base::hex [static], [inherited]

Converts integer input, or generates integer output, in hexadecimal base. Base 16 bestie, 0x 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. This is the default for ifstream and fstream. The reading era. ๐Ÿ“–

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

โญ const fmtflags std::ios_base::internal [static], [inherited]

Adds fill characters at a designated internal point in certain generated output โ€” or it's identical to right if no such point is designated. The "put the padding in the middle, she's quirky" option. ๐ŸŽ€

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. Left-aligned and thriving. ๐Ÿ’…

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! Rare, mysterious, kind of iconic ngl. ๐Ÿ‘‘

Referenced by std::oct().

๐Ÿซถ const openmode std::ios_base::out [static], [inherited]

Open for output. This is the default for ofstream and fstream. The writing era. โœ๏ธ

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()
  • std::basic_filebuf< _CharT, _Traits >::xsputn()
  • const fmtflags std::ios_base::right [static], [inherited] โ€” bestie this one pads with fill characters on the left (the initial positions) of certain generated output. Translation? The thing you print gets flushed all the way to the right. iconic alignment behavior ngl ๐Ÿ’…

Referenced by std::right().

  • const fmtflags std::ios_base::scientific [static], [inherited] โ€” generates floating-point output in scientific notation. science slay ๐Ÿ”ฌโœจ

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

  • const fmtflags std::ios_base::showbase [static], [inherited] โ€” generates a prefix that indicates the numeric base of the generated integer output. basically it tells you what base you're looking at, no cap ๐Ÿงฎ

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. yes girl show that point, even when you didn't have to ๐ŸŽ€

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

  • const fmtflags std::ios_base::showpos [static], [inherited] โ€” generates a + sign in non-negative generated numeric output. positivity era fr fr โž•๐Ÿ’–

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 "read the room, ignore the empty space" โœจ

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] โ€” truncates an existing stream when opening. and heads up bestie: it's the default for ofstream, so likeโ€ฆ it will absolutely wipe your file, that's the whole vibe ๐Ÿ˜ญ๐Ÿ’€
  • const fmtflags std::ios_base::unitbuf [static], [inherited] โ€” flushes output after each output operation. no batching, no waiting, immediate main character energy ๐Ÿซถ

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

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. not a human, not a friend, just Doxygen doing its little robot thing ๐Ÿค–โœจ


okay that's the whole page bestie, we literally made it to the end ๐ŸŽ‰๐Ÿฆ‹ the footer moment: this page is the std::basic_stri...raits, _Alloc >(3cxx) one (yes the title got cutely truncated, iykyk), coming at you from libstdc++, and the date lives down there in that footer line too โ€” go peek at it in the source if you need the exact stamp ๐Ÿ’œ periodt, go write some streams ๐Ÿซถ๐ŸŽ€

๐Ÿ“ฆ where this page comes from