STD::WOFSTREAM(3cxx)

πŸ’– std::basic_ofstream< _CharT, _Traits > β€” Controlling output for files πŸ’–

okay so bestie, welcome to the 3cxx manual section, and lemme tell you, this page is a whole moment. it's all about std::basic_ofstream< _CharT, _Traits >, which is literally the "write stuff to files" stream. main character energy, no cap. πŸŽ€

and listen β€” this page is long, like, seven-parts long. so hydrate, sit criss-cross, and let's get into it. πŸ’…


✨ SYNOPSIS ✨

#include <fstream>

lowkey the most important part: it inherits std::basic_ostream< _CharT, _Traits >. that's the whole vibe. 🌸

🫢 Public Types

okay so here's the type fam, keep every one of these, they're all real:

  • typedef ctype< _CharT > __ctype_type
  • typedef basic_filebuf< char_type, traits_type > __filebuf_type
  • typedef basic_ios< _CharT, _Traits > __ios_type
  • typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type
  • typedef basic_ostream< char_type, traits_type > __ostream_type
  • typedef basic_streambuf< _CharT, _Traits > __streambuf_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. so like, these are the moments an event callback can catch. iconic.
  • typedef void(* event_callback) (event __e, ios_base &__b, int __i) β€” the type of an event callback function. yes bestie, that's a function pointer, she's fancy.
  • typedef _Ios_Fmtflags fmtflags β€” this is a bitmask type. bitmask!! remember that.
  • typedef traits_type::int_type int_type
  • typedef _Ios_Iostate iostate β€” this is a bitmask type too. another one.
  • typedef traits_type::off_type off_type
  • typedef _Ios_Openmode openmode β€” yup, also a bitmask type. they're all bitmasks and they're all slaying.
  • typedef traits_type::pos_type pos_type
  • typedef _Ios_Seekdir seekdir β€” this one is an enumerated type, different vibe entirely.
  • typedef _Traits traits_type
    • typedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_type

πŸ‘‘ Public Member Functions

okay this is the big one. grab a snack. πŸ“

  • basic_ofstream() β€” default constructor. the classic "no thoughts head empty" opener.
  • basic_ofstream(basic_ofstream &&__rhs) β€” move constructor, she moves.
  • template<typename _Path, typename _Require = _If_fs_path<_Path>> basic_ofstream(const _Path &__s, ios_base::openmode __mode=ios_base::out) β€” create an output file stream. template flavored. ✨
  • basic_ofstream(const basic_ofstream &)=delete β€” copy constructor is deleted, so no copying, we don't do that here.
  • basic_ofstream(const char *__s, ios_base::openmode __mode=ios_base::out) β€” create an output file stream. classic const char * style.
  • basic_ofstream(const std::string &__s, ios_base::openmode __mode=ios_base::out) β€” create an output file stream. std::string girlie edition. πŸ’–
  • ~basic_ofstream() β€” the destructor does nothing. literally nothing. she's at peace. 🧘
  • const locale & _M_getloc() const β€” locale access.
  • template<typename _ValueT> basic_ostream< _CharT, _Traits > & _M_insert(_ValueT __v)
  • void _M_setstate(iostate __state)
  • bool bad() const β€” fast error checking.
  • void clear(iostate __state=goodbit) β€” [Re]sets the error state.
  • void close() β€” close the file. bye bestie πŸ‘‹
  • 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.
  • locale getloc() const β€” locale access.
  • bool good() const β€” fast error checking.
  • locale imbue(const locale &__loc) β€” moves to a new locale.
  • bool is_open() β€” wrapper to test for an open file.
  • bool is_open() const β€” the const twin, same energy.
  • long & iword(int __ix) β€” access to integer array.
  • char narrow(char_type __c, char __dfault) const β€” squeezes characters.
  • template<typename _Path> _If_fs_path< _Path, void > open(const _Path &__s, ios_base::openmode __mode=ios_base::out) β€” opens an external file.
  • void open(const char *__s, ios_base::openmode __mode=ios_base::out) β€” opens an external file.
  • void open(const std::string &__s, ios_base::openmode __mode=ios_base::out) β€” opens an external file.
  • __ostream_type & operator<<(__streambuf_type *__sb) β€” extracting from another streambuf.
  • __ostream_type & operator<<(const void *__p) β€” pointer arithmetic inserters.
  • __ostream_type & operator<<(nullptr_t) β€” the nullptr one, she's quirky like that.
  • basic_ofstream & operator=(basic_ofstream &&__rhs) β€” move assignment, she moves again.
  • basic_ofstream & operator=(const basic_ofstream &)=delete β€” copy assignment is deleted too. no copying, periodt.
  • streamsize precision() const β€” flags access.
  • streamsize precision(streamsize __prec) β€” changing flags.
  • void *& pword(int __ix) β€” access to void pointer array.
  • __filebuf_type * rdbuf() const β€” accessing the underlying buffer.
  • basic_streambuf< _CharT, _Traits > * rdbuf(basic_streambuf< _CharT, _Traits > *__sb) β€” changing the underlying buffer.
  • iostate rdstate() const β€” returns the error state of the stream buffer.
  • void register_callback(event_callback __fn, int __index) β€” add the callback __fn with parameter __index.
  • __ostream_type & seekp(off_type, ios_base::seekdir) β€” changing the current write position.
  • __ostream_type & seekp(pos_type) β€” changing the current write position. (yes, another one, she has two forms πŸ’…)
  • fmtflags setf(fmtflags __fmtfl) β€” setting new format flags.
  • fmtflags setf(fmtflags __fmtfl, fmtflags __mask) β€” setting new format flags.
  • void setstate(iostate __state) β€” sets additional flags in the error state.
  • void swap(basic_ofstream &__rhs) β€” swap it, swap it good.
  • pos_type tellp() β€” getting the current write position.
  • basic_ostream< _CharT, _Traits > * tie() const β€” fetches the current tied stream.
  • basic_ostream< _CharT, _Traits > * tie(basic_ostream< _CharT, _Traits > *__tiestr) β€” ties this stream to an output stream.
  • void unsetf(fmtflags __mask) β€” clearing format flags.
  • char_type widen(char __c) const β€” widens characters.
  • streamsize width() const β€” flags access.
  • streamsize width(streamsize __wide) β€” changing flags.

and then there's this little trio chilling underneath, the manipulator interfaces:

  • __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, all the operator<< functions (aka formatted output functions β€” that's their government name) have some common behavior, and it's giving "shared ancestor lore":

  • each one starts by constructing a temporary object of type std::basic_ostream::sentry. this can have several effects, concluding with the setting of a status flag; see the sentry documentation for more. πŸ‘€
  • if the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument.
  • if an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state without causing an ios_base::failure to be thrown. the original exception will then be rethrown. 😭 so like, the badbit goes on, but the original exception comes back. noted.

here come the actual inserters, grouped:

Integer arithmetic inserters πŸ’€ (they all have the same description, don't @ me):

  • __ostream_type & operator<<(long __n) β€” integer arithmetic inserters.
  • __ostream_type & operator<<(unsigned long __n) β€” integer arithmetic inserters.
  • __ostream_type & operator<<(bool __n) β€” integer arithmetic inserters.
  • __ostream_type & operator<<(short __n) β€” integer arithmetic inserters.
  • __ostream_type & operator<<(unsigned short __n) β€” integer arithmetic inserters.
  • __ostream_type & operator<<(int __n) β€” integer arithmetic inserters.
  • __ostream_type & operator<<(unsigned int __n) β€” integer arithmetic inserters.
  • __ostream_type & operator<<(long long __n) β€” integer arithmetic inserters.
  • __ostream_type & operator<<(unsigned long long __n) β€” integer arithmetic inserters.

Floating point arithmetic inserters 🌈

  • __ostream_type & operator<<(double __f) β€” floating point arithmetic inserters.
  • __ostream_type & operator<<(float __f) β€” floating point arithmetic inserters.
  • __ostream_type & operator<<(long double __f) β€” floating point arithmetic inserters.

πŸ¦‹ Unformatted Output Functions

same deal, different subsection. all the unformatted output functions have some common behavior:

  • each starts by constructing a temporary object of type std::basic_ostream::sentry. this has several effects, concluding with the setting of a status flag; see the sentry documentation for more.
  • if the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument.
  • if an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state. if badbit is on in the stream's exceptions mask, the exception will be rethrown without completing its actions. ⚠️ yeah, that's the spicy one β€” note the difference from the formatted inserters up there.

and the functions:

  • __ostream_type & put(char_type __c) β€” simple insertion.
  • __ostream_type & write(const char_type *__s, streamsize __n) β€” character string insertion.

then these two besties:

  • operator bool() const β€” the quick-and-easy status check.
  • bool operator!() const β€” the quick-and-easy status check.

🌟 Static Public Member Functions

only two, but they're important, iykyk:

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

okay that's part one bestie, stay tuned because there is so much more πŸ’œπŸ«Ά

✨ Static Public Attributes ✨

okay so these are the class-level constants, bestie β€” they're all static const, so you don't make one, you just borrow them πŸ’…

  • static const openmode __noreplace β€” literally just sits there with no description in the original, so I'm not gonna invent lore for it 🫢
  • static const fmtflags adjustfield β€” a mask of left|right|internal. Super 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 β€” says the input or output sequence lost its integrity (like an irrecoverable read error from a file). it's giving "something is deeply wrong" 😭
  • 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 β€” do input and output in binary mode (as opposed to text mode). and listen: this is probably not what you think it is, no cap. 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 β€” an input operation reached the end of an input sequence πŸŽ€
  • static const iostate failbit β€” an input operation failed to read the expected characters, or an output operation failed to generate the desired characters. lowkey the saddest flag πŸ’”
  • 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 vibe check passed.
  • 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 is 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. obsessive? maybe. effective? absolutely πŸ’…
  • static const fmtflags uppercase β€” replaces certain lowercase letters with their uppercase equivalents in generated output.

🌸 Protected Types 🌸

  • enum { _S_local_word_size } β€” that's the whole thing. a little mysterious. we respect the mystery 🧚

πŸ¦‹ Protected Member Functions πŸ¦‹

  • 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 ()
  • template<typename _ValueT > __ostream_type & _M_insert (_ValueT __v)
  • void _M_move (ios_base &) noexcept
  • void _M_swap (ios_base &__rhs) noexcept
  • void init (basic_streambuf< _CharT, _Traits > *__sb) β€” all setup is performed here πŸŽ€
  • void move (basic_ios &&__rhs)
  • void move (basic_ios &__rhs)
  • void set_rdbuf (basic_streambuf< _CharT, _Traits > *__sb)
  • void swap (basic_ios &__rhs) noexcept
  • void swap (basic_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
  • 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_ofstream< _CharT, _Traits >

"Controlling output for files." β€” that's the whole mood, honestly πŸ‘‘

Template Parameters

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

This class supports reading from named files, using the inherited functions from std::basic_ostream. to control the associated sequence, an instance of std::basic_filebuf is used, which this page refers to as sb. (yes it says "reading", that's what the original says, don't come for me 🫢)


πŸŽ€ Member Typedef Documentation πŸŽ€

template<typename _CharT , typename _Traits >
    typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
    std::basic_ios< _CharT, _Traits >::__num_get_type [inherited]

these are non-standard types. spicy. we love a non-standard moment πŸ™ˆ

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

the type of an event callback function πŸ’«

Parameters

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

event callbacks are user defined functions that get called during several ios_base and basic_ios functions, specifically imbue(), copyfmt(), and ~ios().


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

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

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

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

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

  • badbit
  • eofbit
  • failbit
  • goodbit

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

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

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

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

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

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

🧚 Member Enumeration Documentation 🧚

enum std::ios_base::event [inherited]

The set of events that may be passed to an event callback. erase_event is used during ~ios() and copyfmt(). imbue_event is used during imbue(). copyfmt_event is used during copyfmt(). three little events, each with a job 🌈


πŸ’– Constructor & Destructor Documentation πŸ’–

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

Default constructor. Initializes sb using its default constructor, and passes &sb to the base class initializer. does not open any files (you haven't given it a filename to open, bestie β€” what's it supposed to do, guess? 😭).

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


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

Create an output file stream ✨

Parameters

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

ios_base::out is automatically included in __mode. periodt.

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


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

Create an output file stream (the std::string edition πŸŽ€).

Parameters

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

ios_base::out is automatically included in __mode.

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


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

Create an output file stream, but make it filesystem-path flavored πŸ¦‹

Parameters

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

ios_base::out is automatically included in __mode.


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

The destructor does nothing. plot twist πŸ’€ the file is closed by the filebuf object, not the formatting stream. so don't go thanking the destructor, it literally did not do that.


⭐ 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. efficient queen πŸ’…

Still in the "Referenced by" era, and no we're not abbreviating it πŸ’… β€” here's the rest of the list that belongs to the entry just above:

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


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

Bestie, this is the fast error check β€” like, blink and you'll miss it, it's [inline] and [inherited] and it does not play games.

Returns: true if the badbit is set. That's it, that's the whole vibe.

Heads up though: other iostate flags may also be set at the same time. badbit being true doesn't mean it's the only one throwing a party πŸŽ‰

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

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


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

[Re]sets the error state. The square brackets are doing so much work here β€” it clears or sets, depending on what you hand it ✨

Parameters:

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

See std::ios_base::iostate for the possible bit values. Most users will not need to pass an argument (the default goodbit handles it, so you're chill).

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

And yes, the duplicate open() entries are literally in the source list. We keep 'em. No cap 🫢

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

Close the file, periodt. It calls std::basic_filebuf::close(), and if that function fails, failbit gets set in the stream's error state β€” so if your close didn't slay, the stream will let you know 😭

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


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 stream. It's giving "twin flame" but for formatting settings πŸ‘―

Parameters:

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

Returns: a reference to this object (so you can keep chaining, icon behaviour).

All fields of __rhs are copied into this object except that rdbuf() and rdstate() remain unchanged β€” those two are the main characters who refused the copy. 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().


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

Another fast error check, same energy as bad(). Lowkey the siblings of this class fr fr.

Returns: true if the eofbit is set.

Same disclaimer as before, bestie: other iostate flags may also be set. Don't assume eofbit is out here solo πŸ’€

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


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

Throwing exceptions on errors β€” the getter version, the one that just tells you what the mask currently is. Very "no thoughts, just vibes" of it honestly.

Returns: the current exceptions mask.

This changes nothing in the stream. See the one-argument version of exceptions(iostate) for the meaning of the return value (it's right below, keep scrolling πŸ¦‹).

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


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

Throwing exceptions on errors β€” the setter, aka the part where things get spicy πŸ”₯

Parameters:

  • __except β€” the new exceptions mask.

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

⚠️ And here's the gag: if the error flag is already set when the exceptions mask is added, the exception is immediately thrown. Not later. Not on the next read. Right then. Try running the following under GCC 3.1 or later:
#include <iostream>
#include <fstream>
#include <exception>

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

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

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

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

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


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

The third of the fast-error-check trio πŸŽ€

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

Checking the badbit in fail() is historical practice β€” it's not a bug, it's heritage, iykyk. 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().


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

Retrieves the empty character β€” the padding character, the filler, the background dancer that holds the whole routine together πŸ’ƒ

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


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

Sets a new empty character πŸŽ€

Parameters:

  • __ch β€” the new character.

Returns: the previous fill character. Yes it gives you back the old one, it's polite like that.

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

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


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

Access to format flags. The const getter, the "just show me what's on" version πŸ‘‘

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

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


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

Setting new format flags all at once β€” the "just redecorate the whole room" option ✨

Parameters:

  • __fmtfl β€” the new flags to set.

Returns: the previous format control flags.

This function overwrites all the format flags with __fmtfl. Not merges. Not adds. Overwrites. So if you had flags you liked... they're gone, bestie 😭


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

Synchronizing the stream buffer. The push-to-make-it-real button 🫢

Returns: *this

If rdbuf() is a null pointer, changes nothing. Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit.

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

Referenced by std::flush().


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

Locale access β€” the "which locale are we even in rn" check 🌍

Returns: a copy of the current locale.

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

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


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

The last of the fast error checks, and honestly the most optimistic one πŸ•ŠοΈ

Returns: true if no error flags are set.

A wrapper around rdstate. Literally just the vibe check of the stream.

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

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


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

Moves to a new locale 🌸

Parameters:

  • __loc β€” the new locale.

Returns: the previous locale (again with the polite handback, we love a consistent queen).

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

Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html β€” yes, that's the literal address in the docs, keep it exactly like that πŸ”—

References std::ios_base::imbue().

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


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

All setup is performed here. This is called from the public constructor β€” it's the backstage crew of the whole operation 🎬

It is not virtual and cannot be redefined. So don't come for it, it's not open for collabs πŸ’€

And that's exactly where this chunk runs out β€” there's more inherited goodness waiting on the other side, so don't touch that dial πŸ‘€

…and this is the tail end of the previous entry β€” its Referenced by list. It's long. It's giving "the group chat when someone asks who's coming to the party." Every line below is exactly what the page says, repeats and all (yes, the constructors are listed three times each β€” that's the overloads, iykyk πŸ’…):

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

🌸 is_open β€” the vibe check for your file 🌸

template<typename _CharT , typename _Traits > bool std::basic_ofstream<
    _CharT, _Traits >::is_open () [inline]

Bestie. It's a wrapper to test for an open file. That's literally it. A tiny little yes/no about whether your stream is actually attached to a file.

Returns: rdbuf()->is_open()

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


πŸ”’ iword β€” the integer scratchpad πŸ”’

long & std::ios_base::iword (int __ix) [inline],  [inherited]

Access to integer array. It's your little drawer of integers you can use for literally any purpose you want.

Parameters:

  • __ix β€” Index into the array.

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

So here's the tea πŸ«–: the iword function gives you access to an array of integers that can be used for any purpose. The array grows as required to hold the index you supply. All integers in the array are initialized to 0.

⚠️ Okay this part matters, don't skim it: the implementation reserves several indices, so you should use xalloc to obtain an index that's actually safe to use. And because the array can grow dynamically, it is not safe to hold onto the reference. Like, it will move out from under you. Do not get attached. πŸ’€

πŸ¦‹ narrow β€” squeezes characters πŸ¦‹

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

Squeezes characters. Cute description, honestly iconic.

Parameters:

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

Returns: The narrowed character.

So what it does: 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 🧚


πŸŽ€ open β€” the filesystem::path era πŸŽ€

template<typename _CharT , typename _Traits > template<typename _Path >
    _If_fs_path< _Path, void > std::basic_ofstream< _CharT, _Traits >::open
    (const _Path & __s, ios_base::openmode __mode = ios_base::out) [inline]

Opens an external file. Main character behavior.

Parameters:

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

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

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


πŸ“ open β€” the const char * one πŸ“

template<typename _CharT , typename _Traits > void std::basic_ofstream<
    _CharT, _Traits >::open (const char * __s, ios_base::openmode __mode =
    ios_base::out) [inline]

Opens an external file.

Parameters:

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

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

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

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


πŸ’œ open β€” the std::string one πŸ’œ

template<typename _CharT , typename _Traits > void std::basic_ofstream<
    _CharT, _Traits >::open (const std::string & __s, ios_base::openmode
    __mode = ios_base::out) [inline]

Opens an external file.

Parameters:

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

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

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


✨ operator bool β€” the quick-and-easy status check ✨

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

The quick-and-easy status check πŸ”₯. This is the whole reason you can write constructs such as if (!a_stream) ... and while (a_stream) ... β€” yes, that's what's happening under there.

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


🫢 operator! β€” same energy, opposite sign 🫢

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

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

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


🌈 operator<< β€” the manipulator interface, take one 🌈

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.


🌈 operator<< β€” the manipulator interface, take two 🌈

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

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


πŸ’… operator<< β€” the streambuf one (lowkey the spicy one) πŸ’…

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

Extracting from another streambuf.

Parameters:

  • __sb β€” A pointer to a streambuf

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

If __sb is NULL, the stream will set failbit in its error state.

Characters are extracted from __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. 🫠


⭐ operator<< β€” inserting a bool ⭐

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

Integer arithmetic inserters.

Parameters:

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

Returns: *this if successful

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


🧚 operator<< β€” inserting a pointer 🧚

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

Pointer arithmetic inserters.

Parameters:

  • __p β€” A variable of pointer type.

Returns: *this if successful

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


🌸 operator<< β€” inserting a double 🌸

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

Floating point arithmetic inserters.

Parameters:

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

Returns: *this if successful

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


πŸŽ€ operator<< β€” inserting a float πŸŽ€

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

Floating point arithmetic inserters.

Parameters:

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

Returns: *this if successful

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


πŸ”₯ operator<< β€” inserting an int πŸ”₯

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

Integer arithmetic inserters.

Parameters:

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

Returns: *this if successful

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


🌈 operator<< β€” the ios_base manipulator one 🌈

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

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


πŸ’œ operator<< β€” inserting a long πŸ’œ

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

Integer arithmetic inserters.

Parameters:

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

Returns: *this if successful

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


πŸ¦‹ operator<< β€” inserting a long double πŸ¦‹

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

Floating point arithmetic inserters.

Parameters:

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

Returns: *this if successful

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


πŸ“ operator<< β€” inserting a long long πŸ“

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

Integer arithmetic inserters.

Parameters:

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

Returns: *this if successful

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


πŸ’« operator<< β€” inserting a short πŸ’«

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

Integer arithmetic inserters.

(and that's where this part cuts off β€” more coming, don't go anywhere πŸ‘‘)

Parameters

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

Returns

*this if it all went through πŸ’–

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting. So like, the locale is doing the actual number-formatting work here, not the stream being cute about it.


operator<< (unsigned int) β€” the other one, same energy

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

Integer arithmetic inserters.

Parameters

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

Returns

*this if successful 🫢

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

operator<< (unsigned long) β€” yes bestie, another one

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

Integer arithmetic inserters.

Parameters

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

Returns

*this if successful 🌸

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

operator<< (unsigned long long) β€” the big one πŸ”₯

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

Integer arithmetic inserters.

Parameters

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

Returns

*this if successful ✨

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

operator<< (unsigned short) β€” tiny but mighty

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

Integer arithmetic inserters.

Parameters

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

Returns

*this if successful πŸ’œ

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


precision() (getter) β€” how many digits are we serving πŸ‘‘

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

Flags access. It's giving "just reading the settings" energy.

Returns

The precision to generate on certain output operations.

⚠️ Be careful if you try to give a definition of precision here; see DR 189. Not me telling you to go read a defect report β€” okay yes, me telling you exactly that. Do it though.

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

precision(streamsize __prec) (setter) β€” now we're changing it

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

Changing flags.

Parameters

  • __prec β€” the new precision value.

Returns

The previous value of precision(). Yes, it hands you the old one back, it's polite like that πŸŽ€


put(char_type __c) β€” one character, simple as

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

Simple insertion.

Parameters

  • __c β€” the character to insert.

Returns

*this

It tries to insert __c. That's the whole vibe.

πŸ“Œ Note: this function is not overloaded on signed char and unsigned char. So don't come for it expecting char-type equality, because it's not there, and it's not going to be there.

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


pword(int __ix) β€” the pointer drawer πŸ—„οΈ

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

Access to void pointer array.

Parameters

  • __ix β€” index into the array.

Returns

A reference to a void* associated with the index.

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

The implementation reserves several indices. You should use xalloc to obtain an index that is safe to use. Also β€” and this is the part everyone fumbles β€” since the array can grow dynamically, it is not safe to hold onto the reference. Like, the reference you got? It might not be valid later. Do not store it, bestie 😭


basic_ofstream::rdbuf() β€” peeking at the buffer

template<typename _CharT , typename _Traits > __filebuf_type *
std::basic_ofstream< _CharT, _Traits >::rdbuf () const [inline]

Accessing the underlying buffer.

Returns

The current basic_filebuf buffer.

This hides both signatures of std::basic_ios::rdbuf(). Sneaky? A little. Iconic? Also yes.

basic_ios::rdbuf(basic_streambuf< _CharT, _Traits > * __sb) β€” swapping it out

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

Changing the underlying buffer.

Parameters

  • __sb β€” the new stream buffer.

Returns

The previous stream buffer.

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

πŸ’€ Okay so here's the mess. 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>

Literally had to qualify it. Not a drill. πŸ™ˆ


rdstate() β€” what's the stream's mood rn

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

Returns the error state of the stream buffer.

Returns

A bit pattern (well, isn't everything?) πŸ’…

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

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


register_callback(event_callback __fn, int __index) β€” RSVP your function to the event list

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

Add the callback __fn with parameter __index.

Parameters

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

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


seekp(off_type __off, ios_base::seekdir __dir) β€” scooting the write head around

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

Changing the current write position.

Parameters

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

Returns

*this

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

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

seekp(pos_type __pos) β€” absolute-position version, same energy

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

Changing the current write position.

Parameters

  • __pos β€” a file position object.

Returns

*this

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

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


setf(fmtflags __fmtfl) β€” adding flags, keeping the old ones

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

Setting new format flags.

Parameters

  • __fmtfl β€” additional flags to set.

Returns

The previous format control flags.

This function sets additional flags in format control. Flags that were previously set remain set. Nothing gets cleared, it's purely additive, we're stacking πŸ₯ž

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

setf(fmtflags __fmtfl, fmtflags __mask) β€” now with a mask, so we do clear stuff

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

Setting new format flags.

Parameters

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

Returns

The previous format control flags.

This function clears mask in the format flags, then sets fmtfl & mask. An example mask is ios_base::adjustfield.


setstate(iostate __state) β€” more error flags, because why not

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

Sets additional flags in the error state.

Parameters

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

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

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

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


sync_with_stdio(bool __sync = true) β€” the C/C++ friendship pact 🀝

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.

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 🌈


tellp() β€” where's the write head at

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

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 β€” fetches the current tied stream πŸŽ€

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

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

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

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


tie (basic_ostream< _CharT, _Traits > * __tiestr) β€” ties this stream to an output stream πŸ¦‹

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

Parameters:

  • __tiestr β€” the output stream.

Returns: The previously tied output stream, or NULL if the stream was not tied.

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


unsetf (fmtflags __mask) β€” clearing format flags ✨

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

Parameters:

  • __mask β€” the flags to unset.

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


widen (char __c) const β€” widens characters 🌸

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

Parameters:

  • __c β€” the character to widen.

Returns: The widened character.

Maps a character of char to a character of char_type.

Returns the result of

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

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

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


width () const β€” flags access πŸ“

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

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

Minimum field width refers to the number of characters.

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


width (streamsize __wide) β€” changing flags πŸ“

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

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]

Parameters:

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

Returns: *this

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

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

xalloc () β€” access to unique indices πŸ”‘

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

Returns: An integer different from all previous calls.

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

The implementation maintains a static variable that is incremented and returned on each invocation. xalloc is guaranteed to return an index that is safe to use in the iword and pword arrays. fr fr πŸ”₯


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

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


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

A mask of dec|oct|hex. Useful for the 2-arg form of setf.

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.

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.

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]

Converts integer input or generates integer output in decimal base.

Referenced by std::dec().


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

Request a seek relative to the current end of the sequence.

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


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

Indicates that an input operation reached the end of an input sequence.

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. πŸ’”

okay bestie we're still finishing off a Referenced by list from the last entry β€” and babes, it is a whole saga 😭 grab a snack πŸ“ because this constant is 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()
and yes bestie the same names show up more than once in that list β€” that's literally what the page says, i'm not fighting Doxygen over it πŸ’€

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

Makes your floating-point output come out in fixed-point notation β€” no surprise exponent jumps, just the number sitting there looking cute ✨

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


πŸŽ€ const fmtflags std::ios_base::floatfield [static], [inherited] πŸŽ€

It's a mask of scientific|fixed β€” and it's the one that's actually useful for the 2-arg form of setf πŸ‘‘

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


πŸ¦‹ const iostate std::ios_base::goodbit [static], [inherited] πŸ¦‹

The vibe check of stream states: it indicates 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()
  • std::ws()

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

Converts integer input, or generates integer output, in hexadecimal base β€” base 16 stans 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. It's the default for ifstream and fstream, so you get it for free, no cap ✨

Referenced by:

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

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

Adds fill characters at a designated internal point in certain generated output β€” or, if no such point is designated, it's identical to right πŸ™ˆ

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, main character on the left side of the frame πŸ’…

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 girlies, this one's for you πŸŽ€

Referenced by: std::oct().


πŸ’– const openmode std::ios_base::out [static], [inherited] πŸ’–

Open for output. It's the default for ofstream and fstream β€” the write girlies' default setting πŸ‘‘

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] 🌸

Adds fill characters on the left (initial positions) of certain generated output β€” i.e., the thing you print is flush right, and it ate, no notes πŸ’…

Referenced by: std::right().


πŸ¦‹ const fmtflags std::ios_base::scientific [static], [inherited] πŸ¦‹

Generates floating-point output in scientific notation β€” like 1.23e+04, the little exponent moment ✨

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 β€” so everyone knows what base you're on, iykyk ✨

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 β€” the point is showing up whether it's needed or not, icon behaviour 😌

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, literally πŸ’–

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


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

Skips leading white space before certain input operations. The "ignore the noise" setting fr fr 🫢

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


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

Truncate an existing stream when opening. It's the default for ofstream β€” so yes, bestie, opening is a whole commitment here πŸ’€ it's literally in the name.


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

Flushes output after each output operation β€” impatient? same. zero buffering 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 β€” GLOW UP FOR YOUR LETTERS, periodt πŸ’…

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


🫢 Author 🫢

Not a human, babes β€” it's the classic line: "Generated automatically by Doxygen for libstdc++ from the source code." The robots did this one πŸ€–βœ¨


and that's a wrap on the whole page bestie!! πŸŽ‰πŸ’– this little masterpiece came straight out of libstdc++ β€” spun up automatically by Doxygen from the source code β€” and it's the std::basic_ofstream< _CharT, _Traits > (3cxx) page, dated whenever your footer says it is 🌸 go forth and stream responsibly, ily, bye πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from