STD::BASIC_IOS(3cxx)

πŸŽ€ NAME πŸŽ€

okay bestie, welcome to the std::basic_ios< _CharT, _Traits > manual page from section 3cxx πŸ’– β€” this is the template class basic_ios, the virtual base class for all stream classes. πŸ‘‘


✨ SYNOPSIS ✨

#include <ios>
  • Inherits std::ios_base.
  • Inherited by:
    • std::basic_istream< char > [virtual]
    • std::basic_istream< char, _Traits > [virtual]
    • std::basic_ostream< char, _Traits > [virtual]
    • std::basic_ostream< char > [virtual]
    • std::basic_istream< _CharT, _Traits > [virtual]
    • std::basic_ostream< _CharT, _Traits > [virtual]

🌈 Public Types 🌈

  • 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 _Ios_Iostate iostate β€” this is a bitmask type. 🧩
  • typedef _Ios_Openmode openmode β€” this is a bitmask type. 🧩
  • typedef _Ios_Seekdir seekdir β€” this is an enumerated type. πŸ—ΊοΈ
  • typedef _CharT char_type
  • typedef _Traits::int_type int_type
  • typedef _Traits::pos_type pos_type
  • typedef _Traits::off_type off_type
  • typedef _Traits traits_type
  • typedef ctype< _CharT > __ctype_type
  • typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type
  • typedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_type

πŸ’… Public Member Functions πŸ’…

  • basic_ios (basic_streambuf< _CharT, _Traits > *__sb) β€” constructor, and it performs initialization. πŸ› οΈ
  • virtual ~basic_ios () β€” empty. literally just empty. πŸ’€
  • const locale & _M_getloc () const β€” locale access. 🌍
  • void _M_setstate (iostate __state) β€” no description on this one, bestie. πŸ«₯
  • 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. 🚩
  • locale getloc () const β€” locale access. 🌍
  • bool good () const β€” fast error checking. 🚨
  • 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. πŸ—œοΈ
  • streamsize precision () const β€” flags access. 🚩
  • streamsize precision (streamsize __prec) β€” changing flags. 🚩
  • void *& pword (int __ix) β€” access to void pointer array. 🫳
  • basic_streambuf< _CharT, _Traits > * rdbuf () const β€” accessing the underlying buffer. 🧺
  • basic_streambuf< _CharT, _Traits > * rdbuf (basic_streambuf< _CharT, _Traits > *__sb) β€” changing the underlying buffer. 🧺
  • iostate rdstate () const β€” returns the error state of the stream buffer. 🚦
  • void register_callback (event_callback __fn, int __index) β€” add the callback __fn with parameter __index. πŸ“ž
  • 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. 🚦
  • basic_ostream< _CharT, _Traits > * tie () const β€” fetches the current tied stream. πŸ”—
  • basic_ostream< _CharT, _Traits > * tie (basic_ostream< _CharT, _Traits > *__tiestr) β€” ties this stream to an output stream. πŸ”—
  • void unsetf (fmtflags __mask) β€” clearing format flags. 🧽
  • char_type widen (char __c) const β€” widens characters. πŸͺ„
  • streamsize width () const β€” flags access. 🚩
  • streamsize width (streamsize __wide) β€” changing flags. 🚩
  • operator bool () const β€” the quick-and-easy status check. βœ…
  • bool operator! () const β€” the quick-and-easy status check. ❌

🌟 Static Public Member Functions 🌟

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

πŸ¦‹ Static Public Attributes πŸ¦‹

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

🧚 Protected Types 🧚

  • enum { _S_local_word_size }

πŸ’œ Protected Member Functions πŸ’œ

  • basic_ios () β€” empty. πŸ’€
  • basic_ios (const basic_ios &)=delete
  • void _M_cache_locale (const locale &__loc)
  • void _M_call_callbacks (event __ev) throw ()
  • void _M_dispose_callbacks (void) throw ()
  • _Words & _M_grow_words (int __index, bool __iword)
  • void _M_init () throw ()
  • void _M_move (ios_base &) noexcept
  • void _M_swap (ios_base &__rhs) noexcept
  • void init (basic_streambuf< _CharT, _Traits > *__sb) β€” all setup is performed here. πŸ› οΈ
  • void move (basic_ios &&__rhs)
  • void move (basic_ios &__rhs)
  • basic_ios & operator= (const basic_ios &)=delete
  • void set_rdbuf (basic_streambuf< _CharT, _Traits > *__sb)
  • void swap (basic_ios &__rhs) noexcept

πŸ“ 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
  • locale _M_ios_locale
  • _Words _M_local_word [_S_local_word_size]
  • const __num_get_type * _M_num_get
  • const __num_put_type * _M_num_put
  • streamsize _M_precision
  • basic_streambuf< _CharT, _Traits > * _M_streambuf
  • iostate _M_streambuf_state
  • basic_ostream< _CharT, _Traits > * _M_tie
  • streamsize _M_width
  • _Words * _M_word
  • int _M_word_size
  • _Words _M_word_zero

πŸ‘‘ Detailed Description πŸ‘‘

template<typename _CharT, typename _Traits>
    class std::basic_ios< _CharT, _Traits >"Template class basic_ios,
    virtual base class for all stream classes.

bestie, yes, that stray " is in the source text and we are keeping it exactly 😭

🌸 Template Parameters 🌸

  • _CharT β€” type of character stream. πŸ”€
  • _Traits β€” traits for character type, defaults to char_traits<_CharT>. 🧬

Most of the member functions called dispatched on stream objects (e.g., std::cout.foo(bar);) are consolidated in this class. πŸ‘‘

πŸ’– MEMBER TYPEDEF DOCUMENTATION πŸ’–

okay bestie, typedefs are literally just nicknames for types, and this class has a whole little friend group of them. some are "standard types" (blessed, portable, iconique) and some are "non-standard" (GCC's own little extras, iykyk). let's go 🫢

  • __ctype_type β€” template<typename _CharT, typename _Traits> typedef ctype<_CharT> std::basic_ios<_CharT, _Traits>::__ctype_type These are non-standard types. πŸ™ˆ
  • __num_get_type β€” template<typename _CharT, typename _Traits> typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > std::basic_ios<_CharT, _Traits>::__num_get_type These are non-standard types. πŸ™ˆ
  • __num_put_type β€” template<typename _CharT, typename _Traits> typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > std::basic_ios<_CharT, _Traits>::__num_put_type These are non-standard types. πŸ™ˆ
  • char_type β€” template<typename _CharT, typename _Traits> typedef _CharT std::basic_ios<_CharT, _Traits>::char_type These are standard types. They permit a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. slay, standardized πŸ’…
  • event_callback β€” 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(). so like, your callback gets a little invite to the party πŸŽ‰

  • fmtflags β€” 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
  • int_type β€” template<typename _CharT, typename _Traits> typedef _Traits::int_type std::basic_ios<_CharT, _Traits>::int_type These are standard types. They permit a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. πŸ’–
  • iostate β€” 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
  • off_type β€” template<typename _CharT, typename _Traits> typedef _Traits::off_type std::basic_ios<_CharT, _Traits>::off_type These are standard types. They permit a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. πŸ¦‹
  • openmode β€” 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
  • pos_type β€” template<typename _CharT, typename _Traits> typedef _Traits::pos_type std::basic_ios<_CharT, _Traits>::pos_type These are standard types. They permit a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. 🌸
  • seekdir β€” 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.
  • traits_type β€” template<typename _CharT, typename _Traits> typedef _Traits std::basic_ios<_CharT, _Traits>::traits_type These are standard types. They permit a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. πŸ‘‘

πŸŽ€ MEMBER ENUMERATION DOCUMENTATION πŸŽ€

  • enum std::ios_base::event [inherited] β€” the set of events that may be passed to an event callback. erase_event is used during ~ios() and copyfmt(). imbue_event is used during imbue(). copyfmt_event is used during copyfmt(). literally the three moods of an event callback 😭✨

πŸ’… CONSTRUCTOR & DESTRUCTOR DOCUMENTATION πŸ’…

  • template<typename _CharT, typename _Traits> std::basic_ios<_CharT, _Traits>::basic_ios (basic_streambuf<_CharT, _Traits> * __sb) [inline], [explicit] Constructor performs initialization. The parameter is passed by derived streams. 🫢

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

  • template<typename _CharT, typename _Traits> virtual std::basic_ios<_CharT, _Traits>::~basic_ios () [inline], [virtual] Empty. The destructor does nothing. More specifically, it does not destroy the streambuf held by rdbuf(). not me expecting it to clean up and it's just standing there πŸ’€
  • template<typename _CharT, typename _Traits> std::basic_ios<_CharT, _Traits>::basic_ios () [inline], [protected] Empty. The default constructor does nothing and is not normally accessible to users. πŸ™ˆ

🌈 MEMBER FUNCTION DOCUMENTATION 🌈

  • const locale & std::ios_base::_M_getloc () const [inline], [inherited] Locale access. 🌍

Returns a reference to the current locale.

Like getloc above, but returns a reference instead of generating a copy. lowkey a glow-up, no cap.

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(). that's a whole friend group right there πŸ«‚

  • template<typename _CharT, typename _Traits> bool std::basic_ios<_CharT, _Traits>::bad () const [inline] Fast error checking. ⚑

Returns true if the badbit is set.

Note that other iostate flags may also be set. so like, don't assume it's only badbit, bestie.

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

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

  • template<typename _CharT, typename _Traits> void std::basic_ios<_CharT, _Traits>::clear (iostate __state = goodbit) [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. (fr fr, just call it empty and move on πŸ’…)

Referenced by std::basic_ios<_CharT, _Traits>::exceptions(), std::basic_ifstream<_CharT, _Traits>::open(), std::basic_fstream<_CharT, _Traits>::open(), std::basic_ofstream<_CharT, _Traits>::open(), std::basic_ifstream<_CharT, _Traits>::open(), std::basic_fstream<_CharT, _Traits>::open(), std::basic_ofstream<_CharT, _Traits>::open(), std::__detail::operator>>(), std::basic_istream<_CharT, _Traits>::putback(), std::basic_istream<_CharT, _Traits>::seekg(), std::basic_istream<_CharT, _Traits>::seekg(), std::basic_ios<_CharT, _Traits>::setstate(), and std::basic_istream<_CharT, _Traits>::unget(). (yes, the open() and seekg() entries show up twice in the original list β€” we don't erase, we respect the source 😌)

  • template<typename _CharT, typename _Traits> basic_ios<_CharT, _Traits> & std::basic_ios<_CharT, _Traits>::copyfmt (const basic_ios<_CharT, _Traits> & __rhs) 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(). it's giving "makeover montage" energy πŸ’–

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

  • template<typename _CharT, typename _Traits> bool std::basic_ios<_CharT, _Traits>::eof () const [inline] Fast error checking. ⚑

Returns true if the eofbit is set.

Note that other iostate flags may also be set. again, don't assume, bestie 🫢

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

  • template<typename _CharT, typename _Traits> iostate std::basic_ios<_CharT, _Traits>::exceptions () const [inline] 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().

  • template<typename _CharT, typename _Traits> void std::basic_ios<_CharT, _Traits>::exceptions (iostate __except) [inline] 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. so like, one minute everything's chill and the next: drama πŸ’€

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

  • template<typename _CharT, typename _Traits> bool std::basic_ios<_CharT, _Traits>::fail () const [inline] 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. yes it's a little quirky, it's grandfathered in, we love her anyway πŸ’…

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(). iconic crossover episode honestly 🌟

char_type fill() const β€” the "what's my filler character" check ✨

Grabs the current fill character for you, bestie.

Returns: the current fill character, no cap.

Heads up: it defaults to a space (' ') in the current locale. So like, if you never set anything, you're getting a space. Iconic, minimal, reliable.

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

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


char_type fill(char_type __ch) β€” setting a new filler πŸ’…

Sets a brand-new empty character. Like a glow-up but for padding.

Parameters:

  • __ch β€” the new character.

Returns: the previous fill character (so you can put it back, we love a reversible slay).

So here's the tea on what fill actually does: the fill character is used to fill out space when P+ characters have been requested (think setw), Q characters are actually used, and Q<P. Big padding energy. It defaults to a space (' ') in the current locale.

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


fmtflags std::ios_base::flags() const β€” [inherited] πŸŽ€

Access to format flags. The format-flag vault, unlocked.

Returns: the format control flags for both input and output. Yes, both. One blob of flags, both directions.

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 duplicates are real, that's literally what it says, iykyk.)


fmtflags std::ios_base::flags(fmtflags __fmtfl) β€” [inherited] πŸ¦‹

Setting new format flags all at once. Bold. Decisive.

Parameters:

  • __fmtfl β€” the new flags to set.

Returns: the previous format control flags.

Real talk: this function overwrites all the format flags with __fmtfl. Not a merge, not a vibe check β€” a full overwrite. So if you were attached to your old flags, save them first.

locale std::ios_base::getloc() const β€” [inherited] 🌍

Locale access, bestie. Who are you, culturally, as a stream?

Returns: a copy of the current locale.

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

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


bool good() const β€” the fast vibe check πŸ”₯

Fast error checking, literally the speedrun version.

Returns: true if no error flags are set. That's it, that's the whole mood.

It's just a wrapper around rdstate.

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

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


locale imbue(const locale & __loc) β€” moving to a new locale ✈️

Glow-up relocation arc. New locale, new you.

Parameters:

  • __loc β€” the new locale.

Returns: the previous locale. (Catch it, it's falling.)

What it does under the hood: calls ios_base::imbue(loc), and if a stream buffer is associated with this stream, it calls that buffer's pubimbue(loc). So both layers get the memo.

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

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

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


void init(basic_streambuf< _CharT, _Traits > * __sb) β€” [protected] 🧚

All setup is performed here. Like, all of it. This is called from the public constructor.

Important: it is not virtual and cannot be redefined. Don't try it, bestie, it's not that kind of function.

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

(Three of each, because constructors come in threes, apparently. Periodt.)


long & std::ios_base::iword(int __ix) β€” [inherited] πŸ“

Access to the integer array. It's giving "just some integers, don't ask".

Parameters:

  • __ix β€” index into the array.

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

So 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, and all integers in the array are initialized to 0.

Two things, bestie, and they matter: the implementation reserves several indices β€” you should use xalloc to obtain an index that's safe to use. Also, since the array can grow dynamically, it is not safe to hold onto the reference. Let it go. πŸ’€

char narrow(char_type __c, char __dfault) const β€” squeezing characters 🧽

Squishes a char_type down into a char. Compression arc.

Parameters:

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

(Yes, the manpage genuinely gives the same one-liner for both. Not me, that's the source, fr fr.)

Returns: the narrowed character.

It maps a character of char_type to a character of char, if possible. And it 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


operator bool() const β€” [explicit] πŸ‘‘

The quick-and-easy status check. This lets you write constructs such as if (!a_stream) ... and while (a_stream) ... β€” which is, lowkey, the whole reason anyone loves streams.

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


bool operator!() const β€” the little negation that could πŸ’€

Also the quick-and-easy status check. This allows you to write constructs such as if (!a_stream) ... and while (a_stream) ....

Yeah, it's the same description as operator bool β€” they're twins, they share a wardrobe.

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


streamsize std::ios_base::precision() const β€” [inherited] ⭐

Flags access, the read-only flavour.

Returns: the precision to generate on certain output operations.

Careful, bestie: be careful if you try to give a definition of precision here; see DR 189. That's a whole thing, don't @ me.

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


streamsize std::ios_base::precision(streamsize __prec) β€” [inherited] 🌈

Changing flags, the setter edition.

Parameters:

  • __prec β€” the new precision value.

Returns: the previous value of precision(). Always handing you back the receipts.


void *& std::ios_base::pword(int __ix) β€” [inherited] 🫢

Access to the void pointer array. Chaos storage, but make it indexed.

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.

Same two warnings as its sibling: the implementation reserves several indices, so use xalloc to obtain an index that's safe to use. And because the array can grow dynamically, it is not safe to hold onto the reference. Truly do not bookmark it. πŸ™ˆ

basic_streambuf< _CharT, _Traits > * rdbuf() const β€” peeking at the buffer πŸ‘€

Accessing the underlying buffer. The main character behind the scenes.

Returns: the current stream buffer.

And listen: this does not change the state of the stream. Purely a look, no touch. Respectful.

Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< _CharT, _Traits >::get(), std::getline(), std::getline(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::tr2::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< char >::readsome(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_ostream< _CharT, _Traits >::tellp(), and std::ws().

That's a lot of friends. Popular function. 🌸


basic_streambuf< _CharT, _Traits > * rdbuf(basic_streambuf< _CharT, _Traits > * __sb) β€” swapping the buffer πŸ”„

Changing the underlying buffer. The makeover episode.

Parameters:

  • __sb β€” the new stream buffer.

Returns: the previous stream buffer.

It associates a new buffer with the current stream, and clears the error state. Two birds, one slay.

Okay so this next bit is wild and I need you to focus. 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>

That's a real quote, "hysterical raisins," we simply must stan. 🧚


iostate rdstate() const β€” the error state reveal 🎭

Returns the error state of the stream buffer. The moment of truth.

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() β€” because reading raw bit patterns is a whole personality type and honestly, most of us are not that.


Referenced by: the whole squad pulled up β€” 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(). πŸ’…


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

Okay bestie, this one adds the callback __fn and gives it the parameter __index. Like putting your friend's number in the group chat so they get pinged too.

Parameters

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

So the vibe is: you register a function as an event callback, and it comes with an integer parameter that gets handed to the function whenever it's invoked. Multiple copies of the function are allowed β€” no gatekeeping πŸ’–. And if there are multiple callbacks, they're invoked in the order they were registered. First come, first served. Periodt.


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

Setting new format flags. ✨

Parameters

  • __fmtfl β€” Additional flags to set.

Returns

  • The previous format control flags.

This function sets additional flags in format control. Flags that were previously set remain set β€” nothing gets unset, it's purely additive, like stacking bracelets. πŸŽ€

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. So you're literally saying "wipe this specific zone, then drop these bits in" β€” very targeted, very main character. πŸ‘‘


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

Sets additional flags in the error state. 🚨

Parameters

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

See std::ios_base::iostate for the possible bit values β€” that's where the whole menu of state bits lives.

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

Referenced by β€” grab a snack, this list is long πŸ“:

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

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

Interaction with the standard C I/O objects. 🀝

Parameters

  • __sync β€” Whether to synchronize or not.

Returns

  • True if the standard streams were previously synchronized.

Okay so real talk: 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 β€” they're off living their own life, not in this situationship. πŸ™ˆ

See https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary


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

Fetches the current tied stream. πŸŽ€

Returns

  • A pointer to the tied stream, or NULL if the stream is not tied.

Here's the lore: 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. So yeah β€” reading from cin flushes cout first, that's the whole reason your prompt shows up before it blocks. iykyk 😌

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


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

Ties this stream to an output stream. πŸ’ž

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. Yes it's the same name β€” that's not a typo, that's overloading being iconic. ✨


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

Clearing format flags. 🧹

Parameters

  • __mask β€” The flags to unset.

This function clears __mask in the format flags. That's it, that's the function. Sometimes the simplest self-care is just unsetting a mask. πŸ’…


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

Widens characters. πŸ¦‹

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


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

Flags access. πŸ“

Returns

  • The minimum field width to generate on output operations.

Minimum field width refers to the number of characters β€” not pixels, not vibes, characters. ✨

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


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

Changing flags. πŸŽ€

Parameters

  • __wide β€” The new width value.

Returns

  • The previous value of width().

Set a new width, get handed back the old one like a little receipt. 🧾


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

Access to unique indices. πŸ”‘

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. No fighting over storage, we don't do that here. 🫢

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. Guaranteed. No cap. πŸ’―


🌈 Member Data Documentation 🌈

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


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

Seek to end before each write. πŸ“

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


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

Open and seek to end immediately after opening. 🏁

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


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

Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file). πŸ’€ It's giving "the file said no and meant it."

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. Useful for the 2-arg form of setf.

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


const seekdir std::ios_base::beg [static], [inherited]

Request a seek relative to the beginning of the stream. 🏠

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


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

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

This is probably not what you think it is; see https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary

Like, genuinely, read the link before you go making assumptions bestie. 😭

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


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

Insert/extract bool in alphabetic rather than numeric format. So true/false instead of 1/0. Obsessed. πŸ¦‹

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


const seekdir std::ios_base::cur [static], [inherited]

Request a seek relative to the current position within the sequence. πŸ‘€

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

const fmtflags std::ios_base::dec [static] [inherited]

Okay so this one converts integer input or generates integer output in decimal base. That's the boring base-10 one your math teacher loved. πŸ“

Referenced by std::dec().

const seekdir std::ios_base::end [static] [inherited]

Request a seek relative to the current end of the sequence β€” like, "start from the back bestie." πŸ’…

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

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

Indicates that an input operation reached the end of an input sequence. Basically the stream going "that's it, that's the whole thing, nothing left." 😭

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

const iostate std::ios_base::failbit [static] [inherited]

Indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters. Not a slay. 😭 The vibe check did not pass.

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

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

Generate floating-point output in fixed-point notation. The "no surprises, no vibes, just digits" of the float world. πŸŽ€

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. That's literally the whole thing, bestie, it's a mask. ✨

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

const iostate std::ios_base::goodbit [static] [inherited]

Indicates all is well. The main character state. The "we're so back" of stream states. πŸ‘‘ (Also note: it's the value zero of iostate, which is why it's a "bit" that's never actually set as a flag β€” but the man page just says all is well, so: all is well πŸ’œ.)

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

const fmtflags std::ios_base::hex [static] [inherited]

Converts integer input or generates integer output in hexadecimal base. For when you want to feel like a hacker in a movie. πŸ’€πŸ”₯

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

const openmode std::ios_base::in [static] [inherited]

Open for input. Default for ifstream and fstream. 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(), and std::basic_filebuf< _CharT, _Traits >::xsgetn().

const fmtflags std::ios_base::internal [static] [inherited]

Adds fill characters at a designated internal point in certain generated output, or is identical to right if no such point is designated. Ngl this is the weird one and I love her for it. πŸ¦‹

Referenced by std::internal().

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

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

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

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

Converts integer input or generates integer output in octal base. Eight is great, apparently. πŸ™

Referenced by std::oct().

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

Open for output. Default for ofstream and fstream. Writing era, we love to see it. ✍️

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

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

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

Referenced by std::right().

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

Generates floating-point output in scientific notation. 1.23e+45 core. πŸ”¬βœ¨

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

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

Generates a prefix indicating the numeric base of generated integer output. So like, 0x and friends show up to the party uninvited but correct. 😌

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. Even when it's unnecessary. She's extra and we respect it. πŸ’…

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 influencer behavior 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. Self-care for your parser: ignore the noise first. 🧚

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

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

Truncate an existing stream when opening. Default for ofstream. Yes it means what you think it means: the old contents are gone gone. ⚠️ Handle with care bestie, this one does not do second chances.

Truncation is destructive. Opening with trunc on an existing file throws away its contents β€” that's the documented behavior, not a bug. πŸ’€

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

Flushes output after each output operation. Oversharer energy: nothing stays buffered, everything goes out immediately. πŸ—£οΈ

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 (who even wrote this)

Generated automatically by Doxygen for libstdc++ from the source code. No human author, just ✨ automation ✨ doing its little thing.


And that's the whole page, bestie! πŸŽ€ Every last static constant of std::ios_base that std::basic_ios< _CharT, _Traits > inherited, all accounted for, nothing skipped, no cap. πŸ’–

This whole thing comes straight out of the libstdc++ docs β€” auto-generated by Doxygen from the source code β€” and the source/version stamp plus the date are sitting right there in the footer at the bottom of the page (under that slightly cursed libststd::basic_ios< _CharT, _Traits >(3cxx) line, iykyk πŸ™ˆ). Go read your streams, drink some water, and remember: check failbit. πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from