STD::IOSTREAM(3cxx)
๐ std::basic_iostream< _CharT, _Traits > from 3cxx ๐
okay bestie, welcome to the 3cxx manual page for std::basic_iostream< _CharT, _Traits > โ yep, that whole template-y name is the manual name, and we're folding it in right here at the top instead of making you read a copied header line. ๐
โจ NAME โจ
std::basic_iostream< _CharT, _Traits > โ Template class basic_iostream.
๐ฆ SYNOPSIS ๐ฆ
#include <istream>
Inherits std::basic_istream< _CharT, _Traits >, and std::basic_ostream< _CharT, _Traits >.
Inherited by std::basic_fstream< _CharT, _Traits >, and std::basic_stringstream< _CharT, _Traits, _Alloc >.
๐ Public Types ๐
typedef ctype< _CharT > __ctype_typeโ the page lists this one twice, so I'm listing it twice too. no cap.typedef ctype< _CharT > __ctype_typeโ yep, again ๐typedef basic_ios< _CharT, _Traits > __ios_typeโ here's the first one.typedef basic_ios< _CharT, _Traits > __ios_typeโ and here's the second one.typedef basic_istream< _CharT, _Traits > __istream_typetypedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_typetypedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_typetypedef basic_ostream< _CharT, _Traits > __ostream_typetypedef basic_streambuf< _CharT, _Traits > __streambuf_typeโ first appearance.typedef basic_streambuf< _CharT, _Traits > __streambuf_typeโ second appearance, because the page said so.typedef _CharT char_typeenum event { erase_event, imbue_event, copyfmt_event }โ the set of events that may be passed to an event callback.typedef void(* event_callback) (event __e, ios_base &__b, int __i)โ the type of an event callback function.typedef _Ios_Fmtflags fmtflagsโ this is a bitmask type.typedef _Traits::int_type int_typetypedef _Ios_Iostate iostateโ this is a bitmask type.typedef _Traits::off_type off_typetypedef _Ios_Openmode openmodeโ this is a bitmask type.typedef _Traits::pos_type pos_typetypedef _Ios_Seekdir seekdirโ this is an enumerated type.typedef _Traits traits_typetypedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_typeโ and yes, the page repeats this one right aftertraits_type; not me being extra, that's literally what's there ๐ซถ
๐ธ Public Member Functions ๐ธ
basic_iostream (basic_streambuf< _CharT, _Traits > *__sb)โ constructor does nothing.virtual ~basic_iostream ()โ destructor does nothing.template<typename _ValueT > basic_istream< _CharT, _Traits > & _M_extract (_ValueT &__v)const locale & _M_getloc () constโ locale access.template<typename _ValueT > basic_ostream< _CharT, _Traits > & _M_insert (_ValueT __v)void _M_setstate (iostate __state)bool bad () constโ fast error checking.void clear (iostate __state=goodbit)โ [re]sets the error state.basic_ios & copyfmt (const basic_ios &__rhs)โ copies fields of__rhsinto this.bool eof () constโ fast error checking.iostate exceptions () constโ throwing exceptions on errors.void exceptions (iostate __except)โ throwing exceptions on errors.bool fail () constโ fast error checking.char_type fill () constโ retrieves the empty character.char_type fill (char_type __ch)โ sets a new empty character.fmtflags flags () constโ access to format flags.fmtflags flags (fmtflags __fmtfl)โ setting new format flags all at once.__ostream_type & flush ()โ synchronizing the stream buffer.streamsize gcount () constโ character counting.basic_istream< char > & getline (char_type *__s, streamsize __n, char_type __delim)โ explicit specialization declarations, defined insrc/istream.cc.basic_istream< wchar_t > & getline (char_type *__s, streamsize __n, char_type __delim)locale getloc () constโ locale access.bool good () constโ fast error checking.basic_istream< char > & ignore (streamsize __n)basic_istream< wchar_t > & ignore (streamsize __n)basic_istream< char > & ignore (streamsize __n, int_type __delim)basic_istream< wchar_t > & ignore (streamsize __n, int_type __delim)locale imbue (const locale &__loc)โ moves to a new locale.long & iword (int __ix)โ access to integer array.char narrow (char_type __c, char __dfault) constโ squeezes characters.__ostream_type & operator<< (__streambuf_type *__sb)โ extracting from another streambuf.__ostream_type & operator<< (const void *__p)โ pointer arithmetic inserters.__ostream_type & operator<< (nullptr_t)__istream_type & operator>> (__streambuf_type *__sb)โ extracting into another streambuf.__istream_type & operator>> (void *&__p)โ basic arithmetic extractors.streamsize precision () constโ flags access.streamsize precision (streamsize __prec)โ changing flags.void *& pword (int __ix)โ access to void pointer array.basic_streambuf< _CharT, _Traits > * rdbuf () constโ accessing the underlying buffer.basic_streambuf< _CharT, _Traits > * rdbuf (basic_streambuf< _CharT, _Traits > *__sb)โ changing the underlying buffer.iostate rdstate () constโ returns the error state of the stream buffer.void register_callback (event_callback __fn, int __index)โ add the callback__fnwith parameter__index.__ostream_type & seekp (off_type, ios_base::seekdir)โ changing the current write position.__ostream_type & seekp (pos_type)โ changing the current write position.fmtflags setf (fmtflags __fmtfl)โ setting new format flags.fmtflags setf (fmtflags __fmtfl, fmtflags __mask)โ setting new format flags.void setstate (iostate __state)โ sets additional flags in the error state.pos_type tellp ()โ getting the current write position.basic_ostream< _CharT, _Traits > * tie () constโ fetches the current tied stream.basic_ostream< _CharT, _Traits > * tie (basic_ostream< _CharT, _Traits > *__tiestr)โ ties this stream to an output stream.void unsetf (fmtflags __mask)โ clearing format flags.char_type widen (char __c) constโ widens characters.streamsize width () constโ flags access.streamsize width (streamsize __wide)โ changing flags.__istream_type & operator>> (__istream_type &(*__pf)(__istream_type &))โ interface for manipulators.__istream_type & operator>> (__ios_type &(*__pf)(__ios_type &))โ interface for manipulators.__istream_type & operator>> (ios_base &(*__pf)(ios_base &))โ interface for manipulators.
โญ Extractors โญ
all the operator>> functions (aka formatted input functions) have some common behavior, bestie. each one starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to false. this has several effects, concluding with the setting of a status flag; see the sentry documentation for more. ๐ซ
if the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument.
if an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state (without causing an ios_base::failure to be thrown) and the original exception will be rethrown if badbit is set in the exceptions mask.
__istream_type & operator>> (bool &__n)โ integer arithmetic extractors.__istream_type & operator>> (short &__n)โ integer arithmetic extractors.__istream_type & operator>> (unsigned short &__n)โ integer arithmetic extractors.__istream_type & operator>> (int &__n)โ integer arithmetic extractors.__istream_type & operator>> (unsigned int &__n)โ integer arithmetic extractors.__istream_type & operator>> (long &__n)โ integer arithmetic extractors.__istream_type & operator>> (unsigned long &__n)โ integer arithmetic extractors.__istream_type & operator>> (long long &__n)โ integer arithmetic extractors.__istream_type & operator>> (unsigned long long &__n)โ integer arithmetic extractors.__istream_type & operator>> (float &__f)โ floating point arithmetic extractors.__istream_type & operator>> (double &__f)โ floating point arithmetic extractors.__istream_type & operator>> (long double &__f)โ floating point arithmetic extractors.
๐ฆ Unformatted Input Functions ๐ฆ
all the unformatted input functions have some common behavior too. each starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to true. this has several effects, concluding with the setting of a status flag; see the sentry documentation for more. โจ
if the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument.
the number of characters extracted is stored for later retrieval by gcount().
if an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state (without causing an ios_base::failure to be thrown) and the original exception will be rethrown if badbit is set in the exceptions mask.
int_type get ()โ simple extraction.__istream_type & get (char_type &__c)โ simple extraction.__istream_type & get (char_type *__s, streamsize __n, char_type __delim)โ simple multiple-character extraction.__istream_type & get (char_type *__s, streamsize __n)โ simple multiple-character extraction.__istream_type & get (__streambuf_type &__sb, char_type __delim)โ extraction into another streambuf.__istream_type & get (__streambuf_type &__sb)โ extraction into another streambuf.__istream_type & getline (char_type *__s, streamsize __n, char_type __delim)โ string extraction.__istream_type & getline (char_type *__s, streamsize __n)โ string extraction.__istream_type & ignore (streamsize __n, int_type __delim)โ discarding characters.__istream_type & ignore (streamsize __n)โ simple extraction.__istream_type & ignore ()โ simple extraction.int_type peek ()โ looking ahead in the stream.__istream_type & read (char_type *__s, streamsize __n)โ extraction without delimiters.streamsize readsome (char_type *__s, streamsize __n)โ extraction until the buffer is exhausted, but no more.__istream_type & putback (char_type __c)โ unextracting a single character.__istream_type & unget ()โ unextracting the previous character.int sync ()โ synchronizing the stream buffer.pos_type tellg ()โ getting the current read position.__istream_type & seekg (pos_type)โ changing the current read position.__istream_type & seekg (off_type, ios_base::seekdir)โ changing the current read position.operator bool () constโ the quick-and-easy status check.bool operator! () constโ the quick-and-easy status check.__ostream_type & operator<< (__ostream_type &(*__pf)(__ostream_type &))โ the manipulator hook, bestie ๐ this is how stuff like<kbd>-style stream manipulators get applied to abasic_ostream.__ostream_type & operator<< (__ios_type &(*__pf)(__ios_type &))โ same deal, manipulator interface but for the__ios_typeflavour.__ostream_type & operator<< (ios_base &(*__pf)(ios_base &))โ and the third one, manipulator interface takingios_base &. Three flavours, all iconic, all slaying โจ
๐ Inserters ๐
Okay so literally all the operator<< functions (aka the formatted output functions, iykyk) share some common behavior, and the way that works is:
Every single one starts by constructing a temporary object of type std::basic_ostream::sentry. No cap. This temp object can do several things, and it wraps up with setting a status flag โ go read the sentry documentation for the full tea on that one ๐ซ
If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument. Simple as that.
Okay important warning though ๐ญ if an exception gets thrown during insertion,ios_base::badbitwill be turned on in the stream's error state without causing anios_base::failureto be thrown. Then the original exception gets rethrown. So like, no sneaky extra exception, just the og one coming back for round two ๐
__ostream_type & operator<< (long __n)โ integer arithmetic inserter ๐งฎ__ostream_type & operator<< (unsigned long __n)โ integer arithmetic inserter ๐งฎ__ostream_type & operator<< (bool __n)โ integer arithmetic inserter ๐งฎ__ostream_type & operator<< (short __n)โ integer arithmetic inserter ๐งฎ__ostream_type & operator<< (unsigned short __n)โ integer arithmetic inserter ๐งฎ__ostream_type & operator<< (int __n)โ integer arithmetic inserter ๐งฎ__ostream_type & operator<< (unsigned int __n)โ integer arithmetic inserter ๐งฎ__ostream_type & operator<< (long long __n)โ integer arithmetic inserter ๐งฎ__ostream_type & operator<< (unsigned long long __n)โ integer arithmetic inserter ๐งฎ__ostream_type & operator<< (double __f)โ floating point arithmetic inserter ๐__ostream_type & operator<< (float __f)โ floating point arithmetic inserter ๐__ostream_type & operator<< (long double __f)โ floating point arithmetic inserter ๐
๐ฆ Unformatted Output Functions ๐ฆ
So the unformatted output functions also have common behavior, and the way that works: each one starts by constructing a temporary object of type std::basic_ostream::sentry. This has several effects, finishing up with the setting of a status flag โ again, sentry documentation, go read it ๐
If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument.
But here's where it differs, bestie, pay attention ๐ญ If an exception is thrown during insertion,ios_base::badbitwill be turned on in the stream's error state. And ifbadbitis on in the stream's exceptions mask, the exception will be rethrown without completing its actions. Very much not the same as the formatted ones up there โญ
__ostream_type & put (char_type __c)โ simple insertion โจ just yeet one character in.__ostream_type & write (const char_type *__s, streamsize __n)โ character string insertion ๐ you're writing__ncharacters from__s.
๐ Static Public Member Functions ๐
static bool sync_with_stdio (bool __sync=true)โ the whole interaction-with-the-standard-C-I/O-objects situation ๐ default istrue, so it's synced unless you say otherwise.static int xalloc () throw ()โ access to unique indices ๐ that's the whole vibe.
๐ธ Static Public Attributes ๐ธ
static const openmode __noreplaceโ that's the one.static const fmtflags adjustfieldโ a mask ofleft|right|internal. Useful for the 2-arg form ofsetf๐static const openmode appโ seek to end before each write. Every. Single. Write.static const openmode ateโ open and seek to end immediately after opening.static const iostate badbitโ indicates a loss of integrity in an input or output sequence (like an irrecoverable read error from a file) ๐static const fmtflags basefieldโ a mask ofdec|oct|hex. Useful for the 2-arg form ofsetf๐static const seekdir begโ request a seek relative to the beginning of the stream.static const openmode binaryโ perform input and output in binary mode (as opposed to text mode). And here's the thing: this is probably not what you think it is ๐ญ seehttps://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binaryfor the real explanation before you go assuming stuff.static const fmtflags boolalphaโ insert/extractboolin alphabetic rather than numeric format โจ (true/falseinstead of1/0, iconic).static const seekdir curโ request a seek relative to the current position within the sequence.static const fmtflags decโ converts integer input or generates integer output in decimal base.static const seekdir endโ request a seek relative to the current end of the sequence.static const iostate eofbitโ indicates that an input operation reached the end of an input sequence ๐static const iostate failbitโ indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters ๐ฌ rough out here.static const fmtflags fixedโ generate floating-point output in fixed-point notation.static const fmtflags floatfieldโ a mask ofscientific|fixed. Useful for the 2-arg form ofsetf๐static const iostate goodbitโ indicates all is well ๐โจ literally the good vibes flag.static const fmtflags hexโ converts integer input or generates integer output in hexadecimal base.static const openmode inโ open for input. Default forifstreamandfstream.static const fmtflags internalโ adds fill characters at a designated internal point in certain generated output, or identical torightif 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 forofstreamandfstream.static const fmtflags rightโ adds fill characters on the left (initial positions) of certain generated output. (I.e., the thing you print is flush right.) ๐static const fmtflags scientificโ generates floating-point output in scientific notation ๐งชstatic const fmtflags showbaseโ generates a prefix indicating the numeric base of generated integer output.static const fmtflags showpointโ generates a decimal-point character unconditionally in generated floating-point output. Unconditionally. That's the whole point (pun intended) ๐static const fmtflags showposโ generates a+sign in non-negative generated numeric output.static const fmtflags skipwsโ skips leading white space before certain input operations.static const openmode truncโ truncate an existing stream when opening. Default forofstream. Yes it will eat your file, be normal about it ๐static const fmtflags unitbufโ flushes output after each output operation.static const fmtflags uppercaseโ replaces certain lowercase letters with their uppercase equivalents in generated output ๐
๐ง Protected Types ๐ง
enum { _S_local_word_size }โ yep, that's the enum. Protected, so hands off unless you're a subclass bestie.
๐ Protected Member Functions ๐
basic_iostream (basic_iostream &&__rhs)โ move-y constructor situation.basic_iostream (const basic_iostream &)=deleteโ copy constructor? Deleted. No copying, not today, not ever ๐void _M_cache_locale (const locale &__loc)โ caches the locale.void _M_call_callbacks (event __ev) throw ()โ call the callbacks for that event.void _M_dispose_callbacks (void) throw ()โ dispose of the callbacks.template<typename _ValueT > __istream_type & _M_extract (_ValueT &__v)โ the internal extract machinery._Words & _M_grow_words (int __index, bool __iword)โ grows the words array.void _M_init () throw ()โ internal init.template<typename _ValueT > __ostream_type & _M_insert (_ValueT __v)โ the internal insert machinery.void _M_move (ios_base &) noexceptโ internal move.void _M_swap (ios_base &__rhs) noexceptโ internal swap.void init (basic_streambuf< _CharT, _Traits > *__sb)โ all setup is performed here โจ literally everything, this is the main character of the setup functions.void move (basic_ios &&__rhs)โ move from an rvaluebasic_ios.void move (basic_ios &__rhs)โ move from an lvaluebasic_ios.basic_iostream & operator= (basic_iostream &&__rhs)โ move assignment, slay.basic_iostream & operator= (const basic_iostream &)=deleteโ copy assignment? Also deleted ๐ no copying periodt.void set_rdbuf (basic_streambuf< _CharT, _Traits > *__sb)โ sets the rdbuf.void swap (basic_ios &__rhs) noexceptโ swap with abasic_ios.void swap (basic_iostream &__rhs)โ swap with anotherbasic_iostream.void swap (basic_istream &__rhs)โ swap with abasic_istream.void swap (basic_ostream &__rhs)โ swap with abasic_ostream.
๐ Protected Attributes ๐
_Callback_list * _M_callbacksโ the callback list pointer.const __ctype_type * _M_ctypeโ the ctype facet pointer.iostate _M_exceptionโ the exception state.char_type _M_fillโ the fill character.bool _M_fill_initโ whether the fill got initialized.fmtflags _M_flagsโ the format flags.streamsize _M_gcountโ the gcount.locale _M_ios_localeโ the locale, of course._Words _M_local_word [_S_local_word_size]โ the local word array, sized_S_local_word_size๐const __num_get_type * _M_num_getโ the num_get facet pointer.const __num_put_type * _M_num_putโ the num_put facet pointer.streamsize _M_precisionโ the precision.basic_streambuf< _CharT, _Traits > * _M_streambufโ the streambuf pointer, the actual engine under the hood ๐ฅiostate _M_streambuf_stateโ the streambuf state.basic_ostream< _CharT, _Traits > * _M_tieโ the tie pointer.streamsize _M_widthโ the width._Words * _M_wordโ pointer to the words.int _M_word_sizeโ how big the words situation is._Words _M_word_zeroโ the zeroth word, just vibing.
โญ Detailed Description โญ
template<typename _CharT, typename _Traits>
class std::basic_iostream< _CharT, _Traits >
Okay so this is Template class basic_iostream ๐
Template Parameters โ because you gotta know your types, bestie:
_CharTโ type of character stream ๐_Traitsโ traits for character type, defaults tochar_traits<_CharT>.
And the whole thing? This class multiply inherits from the input and output stream classes simply to provide a single interface. That's it, that's the reason โ one interface, two parents, main character energy ๐
๐ Member Typedef Documentation ๐
Ok bestie, these are the little name-aliases the class hands you so you don't have to type out the whole ungodly template soup every time. Slay.
typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > std::basic_ios< _CharT, _Traits >::__num_put_type[inherited]โ heads up: these are non-standard types, so don't go assuming they're portable across the whole universe, mkay? ๐typedef void(* std::ios_base::event_callback) (event __e, ios_base &__b, int __i)[inherited]โ it's the type of an event callback function. ๐ฆ
Parameters, in order:
__eโ one of the members of theeventenum.__bโ reference to theios_baseobject.__iโ the integer that was provided when the callback was registered.
Event callbacks are user-defined functions that get called during several ios_base and basic_ios functions โ specifically imbue(), copyfmt(), and ~ios(). So like, your callback is literally on the invite list for those three moments. ๐
typedef _Ios_Fmtflags std::ios_base::fmtflags[inherited]โ this is a bitmask type._Ios_Fmtflagsis implementation-defined, but โ and this is the important part โ it is valid to perform bitwise operations on these values and expect the Right Thing to happen. โจ Defined objects of typefmtflagsare:boolalphadecfixedhexinternalleftoctrightscientificshowbaseshowpointshowposskipwsunitbufuppercaseadjustfieldbasefieldfloatfield
typedef _Ios_Iostate std::ios_base::iostate[inherited]โ also a bitmask type._Ios_Iostateis implementation-defined, but again: bitwise operations on these values, Right Thing, guaranteed. ๐ Defined objects of typeiostateare:badbiteofbitfailbitgoodbit
typedef _Ios_Openmode std::ios_base::openmode[inherited]โ yeah you guessed it, bitmask type number three._Ios_Openmodeis implementation-defined, and bitwise ops on these values do the Right Thing. ๐ฅ Defined objects of typeopenmodeare:appatebinaryinouttrunc
typedef _Ios_Seekdir std::ios_base::seekdir[inherited]โ this one's an enumerated type._Ios_Seekdiris implementation-defined. ๐ง Defined values of typeseekdirare:begcur, equivalent toSEEK_CURin the C standard library.end, equivalent toSEEK_ENDin the C standard library.
๐ธ Member Enumeration Documentation ๐ธ
๐ enum std::ios_base::event [inherited]
The set of events that may be passed to an event callback. Let me spell out the whole drama for you:
erase_eventis used during~ios()andcopyfmt().imbue_eventis used duringimbue().copyfmt_eventis used duringcopyfmt().
That's the entire cast. Three characters, no filler. ๐
โจ Constructor & Destructor Documentation โจ
๐ซถ template<typename _CharT , typename _Traits > std::basic_iostream< _CharT, _Traits >::basic_iostream (basic_streambuf< _CharT, _Traits > * __sb) [inline], [explicit]
Constructor does nothing. Literally nothing. ๐ญ Both of the parent classes are initialized with the same streambuf pointer that was passed to this constructor, and then it's like... that's it, we're done here.
๐ซถ template<typename _CharT , typename _Traits > virtual std::basic_iostream< _CharT, _Traits >::~basic_iostream () [inline], [virtual]
Destructor does nothing. Matching energy. Balance restored. ๐ฆ
โญ Member Function Documentation โญ
๐ const locale & std::ios_base::_M_getloc () const [inline], [inherited]
Locale access. โจ
Returns: a reference to the current locale.
It's like getloc above, but it returns a reference instead of generating a copy โ so no unnecessary copying, we love efficiency.
Referenced by: std::money_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_date(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_time(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::num_put< _CharT, _OutIter >::do_put(), std::time_put< _CharT, _OutIter >::do_put(), std::time_get< _CharT, _InIter >::get(), and std::time_put< _CharT, _OutIter >::put().
๐ template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT, _Traits >::bad () const [inline], [inherited]
Fast error checking. โก
Returns: True if the badbit is set.
Note that other iostate flags may also be set โ so like, don't read this as "only badbit, nothing else going on." ๐
References: std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by: std::basic_ostream< _CharT, _Traits >::sentry::sentry().
๐ template<typename _CharT , typename _Traits > void std::basic_ios< _CharT, _Traits >::clear (iostate __state = goodbit) [inherited]
[Re]sets the error state. ๐
Parameters:
__stateโ the new state flag(s) to set.
See std::ios_base::iostate for the possible bit values. Most users will not need to pass an argument โ the default is goodbit, so calling it bare just wipes the slate clean. ๐
Referenced by: std::basic_ios< _CharT, _Traits >::exceptions(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_fstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_fstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::__detail::operator>>(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_istream< _CharT, _Traits >::unget().
(Yes, open() and seekg() really do show up twice in that list. We don't make the rules, we just report them faithfully. ๐)
๐ template<typename _CharT , typename _Traits > basic_ios< _CharT, _Traits > & std::basic_ios< _CharT, _Traits >::copyfmt (const basic_ios< _CharT, _Traits > & __rhs) [inherited]
Copies fields of __rhs into this. It's giving "becoming your friend's whole personality" but in a sanctioned, documented way. ๐
Parameters:
__rhsโ the source values for the copies.
Returns: a reference to this object.
Now the important fine print: all fields of __rhs are copied into this object except that rdbuf() and rdstate() remain unchanged. All values in the pword and iword arrays are copied. ๐ฆ
The order of operations, because it matters, bestie:
- 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]
Fast error checking. โก
Returns: True if the eofbit is set.
Same disclaimer asbad(): otheriostateflags may also be set. Don't let the single-purpose name fool you. ๐
References: std::ios_base::eofbit, and std::basic_ios< _CharT, _Traits >::rdstate().
๐ template<typename _CharT , typename _Traits > iostate std::basic_ios< _CharT, _Traits >::exceptions () const [inline], [inherited]
Throwing exceptions on errors โ this is the getter half of the duo. ๐
Returns: the current exceptions mask.
This changes nothing in the stream โ it's read-only vibes. See the one-argument version of exceptions(iostate) for the meaning of the return value.
Referenced by: std::basic_ios< _CharT, _Traits >::copyfmt().
๐ template<typename _CharT , typename _Traits > void std::basic_ios< _CharT, _Traits >::exceptions (iostate __except) [inline], [inherited]
Throwing exceptions on errors โ now the setter. ๐
Parameters:
__exceptโ the new exceptions mask.
By default, error flags are set silently. You can set an exceptions mask for each stream; if a bit in the mask becomes set in the error flags, then an exception of type std::ios_base::failure is thrown. ๐ฅ
โ ๏ธ And here's the spicy part: if the error flag is already set when the exceptions mask is added, the exception is immediately thrown. Like, no waiting, no grace period, instant.
Try running the following under GCC 3.1 or later:
#include <iostream>
#include <fstream>
#include <exception>
int main()
{
std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
std::ifstream f ("/etc/motd");
std::cerr << "Setting badbit\n";
f.setstate (std::ios_base::badbit);
std::cerr << "Setting exception mask\n";
f.exceptions (std::ios_base::badbit);
}
References: std::basic_ios< _CharT, _Traits >::clear().
๐ template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT, _Traits >::fail () const [inline], [inherited]
Fast error checking. โก
Returns: True if either the badbit or the failbit is set.
Checking the badbit in fail() is historical practice โ that's just how it's always been done, we're not here to question history. Also, note that other iostate flags may be set too. ๐
References: std::ios_base::badbit, std::ios_base::failbit, and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by: std::basic_ios< _CharT, _Traits >::operator bool(), std::basic_ios< _CharT, _Traits >::operator!(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_ostream< _CharT, _Traits >::tellp(), and std::regex_traits< _Ch_type >::value().
๐ template<typename _CharT , typename _Traits > char_type std::basic_ios< _CharT, _Traits >::fill () const [inline], [inherited]
Retrieves the empty character. ๐
Returns: the current fill character.
It defaults to a space (' ') in the current locale. So when nothing fancy is set, you're padding with spaces like a normal person. โจ
References: std::basic_ios< _CharT, _Traits >::widen().
Referenced by: std::basic_ios< _CharT, _Traits >::copyfmt(), and std::basic_ios< _CharT, _Traits >::fill().
๐ template<typename _CharT , typename _Traits > char_type std::basic_ios< _CharT, _Traits >::fill (char_type __ch) [inline], [inherited]
Sets a new empty character. ๐
Parameters:
__chโ the new character.
Returns: the previous fill character. (Yes, it hands you back the old one โ trade offer style. ๐ซถ)
The fill character is used to fill out space when P characters have been requested (e.g., via setw), Q characters are actually used, and Q<P. It defaults to a space (' ') in the current locale.
References: std::basic_ios< _CharT, _Traits >::fill().
๐ fmtflags std::ios_base::flags () const [inline], [inherited]
Access to format flags. ๐
Returns: the format control flags for both input and output โ one shared little flag bucket for everything.
Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), std::num_put< _CharT, _OutIter >::do_put(), std::normal_distribution< double >::operator()(), std::operator<<(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), std::__detail::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), and std::operator>>().
(That is a lot of operator>>()s and we are reporting every single one of them, because accuracy is the whole assignment. ๐)
๐ fmtflags std::ios_base::flags (fmtflags __fmtfl) [inline], [inherited]
Setting new format flags all at once โ the "replace everything, no notes" option. ๐ฅ
Parameters:
__fmtflโ the new flags to set.
Returns: the previous format control flags.
This function overwrites all the format flags with __fmtfl. Not merges. Not ORs. Overwrites. So if you had other flags set and you wanted to keep them, uh, you should've thought about that first. ๐
References: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), std::num_put< _CharT, _OutIter >::do_put(), std::normal_distribution< double >::operator()(), std::operator<<(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), std::__detail::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), and std::operator>>().
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::flush () โ inherited ๐
Okay so this one is literally just syncing the stream buffer. That's the whole vibe.
Returns: *this
So like, if rdbuf() is a null pointer, bestie, nothing happens. Not a single thing. It just vibes.
Otherwise? It calls rdbuf()->pubsync(), and if that returns -1, it sets badbit. That's it, that's the whole function ๐ซถ
References: std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by: std::flush().
template<typename _CharT , typename _Traits > streamsize std::basic_istream< _CharT, _Traits >::gcount () const โ inline, inherited โจ
Character counting, icon behavior honestly.
Returns: the number of characters extracted by the previous unformatted input function dispatched for this stream. Like, the last one. Not a running total, just the last one, no cap.
References: std::basic_istream< _CharT, _Traits >::_M_gcount.
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits >::int_type std::basic_istream< _CharT, _Traits >::get (void) โ inherited ๐ฆ
Simple extraction. Very demure, very mindful.
Returns: a character, or eof().
It tries to extract a character. If none are available? Sets failbit and returns traits::eof(). Rip ๐ญ
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by: std::basic_istream< _CharT, _Traits >::get(), and std::basic_istream< _CharT, _Traits >::get().
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb) โ inline, inherited ๐
Extraction into another streambuf. Passing the aux, basically.
Parameters:
__sbโ a streambuf in which to store data.
Returns: *this
It literally just returns get(__sb,widen('\n')). That's the whole thing, she's a one-liner ๐
References: std::basic_istream< _CharT, _Traits >::get(), and std::basic_ios< _CharT, _Traits >::widen().
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb, char_type __delim) โ inherited ๐ธ
Extraction into another streambuf, but now with a stop character. Main character energy.
Parameters:
__sbโ a streambuf in which to store data.__delimโ a 'stop' character.
Returns: *this
So characters get extracted and inserted into __sb until one of these things happens:
- the input sequence reaches EOF
- insertion into the output buffer fails โ and in this case, the character that would have been inserted is not extracted, okurrr
- the next character equals
__delimโ in this case the character is not extracted - an exception occurs (and in this case it is caught, we're being safe)
If no characters are stored, failbit is set in the stream's error state. F in the chat.
References: std::basic_istream< _CharT, _Traits >::_M_gcount, and std::ios_base::goodbit.
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (char_type & __c) โ inherited ๐ง
Simple extraction, take two.
Parameters:
__cโ the character in which to store data.
Returns: *this
Tries to extract a character and store it in __c. If none are available, sets failbit and returns traits::eof().
Note: this function is not overloaded onsigned charandunsigned char. Just so you know ๐
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::get (char_type * __s, streamsize __n) โ inline, inherited ๐
Simple multiple-character extraction. We're scaling up, besties.
Parameters:
__sโ pointer to an array.__nโ maximum number of characters to store ins.
Returns: *this
Returns get(__s,__n,widen('\n')). Again, one line, she's efficient.
References: std::basic_istream< _CharT, _Traits >::get(), and std::basic_ios< _CharT, _Traits >::widen().
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (char_type * __s, streamsize __n, char_type __delim) โ inherited ๐
Simple multiple-character extraction, full version.
Parameters:
__sโ pointer to an array.__nโ maximum number of characters to store in__s.__delimโ a 'stop' character.
Returns: *this
Characters are extracted and stored into __s until one of these happens:
__n-1characters are stored- the input sequence reaches EOF
- the next character equals
__delim, in which case the character is not extracted
If no characters are stored, failbit is set in the stream's error state.
In any case, a null character is stored into the next location in the array. Periodt โจ
Note: again, this function is not overloaded onsigned charandunsigned char.
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::getline (char_type * __s, streamsize __n) โ inline, inherited ๐
String extraction! The classic.
Parameters:
__sโ a character array in which to store the data.__nโ maximum number of characters to extract.
Returns: *this
Returns getline(__s,__n,widen('\n')). Yes bestie, the '\n' is just a widened default.
References: std::basic_istream< _CharT, _Traits >::getline(), and std::basic_ios< _CharT, _Traits >::widen().
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::getline (char_type * __s, streamsize __n, char_type __delim) โ inherited ๐
String extraction, the real one. Pay attention because the ordering here is not a vibe, it's a requirement.
Parameters:
__sโ a character array in which to store the data.__nโ maximum number of characters to extract.__delimโ a 'stop' character.
Returns: *this
Extracts and stores characters into __s until one of these happens. And note โ these criteria are required to be tested in the order listed here, so that an input line can exactly fill the __s array without setting failbit. Like, the order is the whole point, don't touch it ๐ฅ
- the input sequence reaches end-of-file, in which case
eofbitis set in the stream error state - the next character equals
__delim, in which case the character is extracted (and therefore counted ingcount()) but not stored __n-1characters are stored, in which casefailbitis set in the stream error state
If no characters are extracted, failbit is set. (An empty line of input should therefore not cause failbit to be set โ important!! ๐)
In any case, a null character is stored in the next location in the array.
Referenced by: std::basic_istream< _CharT, _Traits >::getline().
basic_istream< char > & std::basic_istream< char >::getline (char_type * __s, streamsize __n, char_type __delim) โ inherited โญ
Explicit specialization declarations, defined in src/istream.cc. That's it, that's the whole note, she's just chillin' there ๐
locale std::ios_base::getloc () const โ inline, inherited ๐ฆ
Locale access, iykyk.
Returns: a copy of the current locale.
So if imbue(loc) has previously been called, then this function returns loc. Otherwise, it returns a copy of std::locale(), the global C++ locale. Simple as that.
Referenced by: std::basic_ios< _CharT, _Traits >::copyfmt(), std::money_put< _CharT, _OutIter >::do_put(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), and std::ws().
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT, _Traits >::good () const โ inline, inherited ๐ซถ
Fast error checking. The vibe check function, truly.
Returns: True if no error flags are set.
It's a wrapper around rdstate. That's literally all she does and she does it flawlessly.
References: std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and std::__detail::operator>>().
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (void) โ inherited ๐ธ
Simple extraction. Someone get this girl a consistent description, she's got three overloads and two of them say the exact same thing ๐ญ
Returns: a character, or eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sbumpc().
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n) โ inherited ๐
Simple extraction, part two, electric boogaloo.
Returns: a character, or eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n, int_type __delim) โ inherited ๐ฅ
Discarding characters. The "no thoughts, head empty, throw it away" function, we love her.
Parameters:
__nโ number of characters to discard.__delimโ a 'stop' character.
Returns: *this
Extracts characters and throws them away until one of these happens:
- if
__n != std::numeric_limits<int>::max(),__ncharacters are extracted - the input sequence reaches end-of-file
- the next character equals
__delim(in this case the character is extracted); note that this condition will never occur if__delimequalstraits::eof()
NB: provide three overloads, instead of the single function (with defaults) mandated by the Standard: this leads to a better performing implementation, while still conforming to the Standard. She's doing the most and somehow still following the rules, iconic ๐
template<typename _CharT , typename _Traits > locale std::basic_ios< _CharT, _Traits >::imbue (const locale & __loc) โ inherited ๐
Moves to a new locale. Glow-up arc.
Parameters:
__locโ the new locale.
Returns: the previous locale. (She remembers where you came from ๐ฅบ)
Calls ios_base::imbue(loc), and if a stream buffer is associated with this stream, calls that buffer's pubimbue(loc).
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html โ go read them, bestie, they're good for you โจ
References: std::ios_base::imbue().
Referenced by: std::chrono::operator<<().
template<typename _CharT , typename _Traits > void std::basic_ios< _CharT, _Traits >::init (basic_streambuf< _CharT, _Traits > * __sb) โ protected, inherited ๐ง
All setup is performed here. Like, all of it. This is called from the public constructor.
It is not virtual and cannot be redefined. She's final. Periodt ๐
Okay so before we get to the next function, here's everybody who's out here referencing this constructor โ it's a whole friend group, no cap ๐
Referenced by std::basic_fstream< _CharT, _Traits >::basic_fstream(),
std::basic_fstream< _CharT, _Traits >::basic_fstream(),
std::basic_fstream< _CharT, _Traits >::basic_fstream(),
std::basic_ifstream< _CharT, _Traits >::basic_ifstream(),
std::basic_ifstream< _CharT, _Traits >::basic_ifstream(),
std::basic_ifstream< _CharT, _Traits >::basic_ifstream(),
std::basic_ios< _CharT, _Traits >::basic_ios(), std::basic_istream<
_CharT, _Traits >::basic_istream(), std::basic_istringstream< _CharT,
_Traits, _Alloc >::basic_istringstream(), std::basic_istringstream<
_CharT, _Traits, _Alloc >::basic_istringstream(),
std::basic_istringstream< _CharT, _Traits, _Alloc
>::basic_istringstream(), std::basic_ofstream< _CharT, _Traits
>::basic_ofstream(), std::basic_ofstream< _CharT, _Traits
>::basic_ofstream(), std::basic_ofstream< _CharT, _Traits
>::basic_ofstream(), std::basic_ostream< _CharT, _Traits
>::basic_ostream(), std::basic_ostringstream< _CharT, _Traits, _Alloc
>::basic_ostringstream(), std::basic_ostringstream< _CharT, _Traits,
_Alloc >::basic_ostringstream(), std::basic_ostringstream< _CharT,
_Traits, _Alloc >::basic_ostringstream(), std::basic_stringstream<
_CharT, _Traits, _Alloc >::basic_stringstream(),
std::basic_stringstream< _CharT, _Traits, _Alloc
>::basic_stringstream(), and std::basic_stringstream< _CharT, _Traits,
_Alloc >::basic_stringstream().
Like, literally the entire stream family showed up. Iconic behavior honestly ๐ซถ
long & std::ios_base::iword (int __ix)</p> [inline], [inherited]
Access to integer array.
Yep, your very own integer closet โจ
Parameters
__ixโ Index into the array.
Returns
A reference to an integer associated with the index.
So bestie, iword hands you an array of integers that you can use for literally any purpose you want. The array grows as required to hold whatever index you throw at it โ it's giving elastic waistband energy ๐ธ And every single integer in the array starts out initialized to 0.
โ ๏ธ Two things, and I need you to hear me: the implementation reserves several indices for itself, so you should use xalloc to grab an index that's actually safe for you to touch. And because the array can grow dynamically, it is not safe to hold onto that reference โ it can go poof ๐ซ
char std::basic_ios< _CharT, _Traits >::narrow (char_type __c, char __dfault) const</p> [inline], [inherited]
Squeezes characters.
Not me making a character smaller ๐ญ it's a whole glow-down for chars.
Parameters
__cโ The character to narrow.__dfaultโ The character to narrow.
Returns
The narrowed character.
What it does: maps a character of char_type down to a character of char, if that's even possible ๐ซ
It returns the result of this, exactly:
std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)
And if you wanna get into the l10n lore, additional notes live at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html ๐ง
std::basic_ios< _CharT, _Traits >::operator bool () const</p> [inline], [explicit], [inherited]
The quick-and-easy status check.
This is the vibe check for your stream, periodt โจ It's what lets you write little baddies like if (!a_stream) ... and while (a_stream) ... โ chef's kiss, so clean ๐
References std::basic_ios< _CharT, _Traits >::fail().
bool std::basic_ios< _CharT, _Traits >::operator! () const</p> [inline], [inherited]
The quick-and-easy status check.
Same energy, opposite sign ๐ You get constructs such as if (!a_stream) ... and while (a_stream) ... โ yes, both of these functions exist to make exactly those two things cute.
References std::basic_ios< _CharT, _Traits >::fail().
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (__ios_type &(*)(__ios_type &) __pf)</p> [inline], [inherited]
Interface for manipulators.
Okay so manipulators like std::endl and std::hex use these functions in constructs like 'std::cout << std::endl' โ you've literally been using them this whole time without knowing, iykyk ๐
For more info, go peek at the iomanip header ๐ฆ
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (__ostream_type &(*)(__ostream_type &) __pf)</p> [inline], [inherited]
Interface for manipulators.
Round two, same slay ๐ Manipulators such as std::endl and std::hex use these functions in constructs like 'std::cout << std::endl'. For more information, see the iomanip header โจ
basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (__streambuf_type * __sb)</p> [inherited]
Extracting from another streambuf.
Sharing is caring bestie ๐
Parameters
__sbโ A pointer to a streambuf
This one behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior ๐
๐จ If__sbisNULL, the stream will setfailbitin its error state. Dead. Gone. ๐
Characters are extracted from __sb and inserted into *this until one of the following occurs:
- the input stream reaches end-of-file,
- insertion into the output sequence fails โ in this case, the character that would have been inserted is not extracted ๐ญ โ or
- an exception occurs while getting a character from
__sb, which setsfailbitin the error state
And if the function inserts no characters at all? failbit gets set. Empty-handed = flagged ๐
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (bool __n)</p> [inline], [inherited]
Integer arithmetic inserters.
Parameters
__nโ A variable of builtin integral type.
Returns
*this if successful
These functions use the stream's current locale โ specifically, the num_get facet โ to do the numeric formatting ๐ซ
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (const void * __p)</p> [inline], [inherited]
Pointer arithmetic inserters.
Parameters
__pโ A variable of pointer type.
Returns
*this if successful
Again: these functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting ๐ธ
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (double __f)</p> [inline], [inherited]
Floating point arithmetic inserters.
Parameters
__fโ A variable of builtin floating point type.
Returns
*this if successful
Current locale, num_get facet, numeric formatting โ the holy trinity, no cap โจ
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (float __f)</p> [inline], [inherited]
Floating point arithmetic inserters.
Parameters
__fโ A variable of builtin floating point type.
Returns
*this if successful
Yes, same locale / num_get facet / numeric formatting situation as its sibling ๐ซถ
basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (int __n)</p> [inherited]
Integer arithmetic inserters.
Parameters
__nโ A variable of builtin integral type.
Returns
*this if successful
Locale. num_get facet. Numeric formatting. You know the drill by now bestie ๐
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (ios_base &(*)(ios_base &) __pf)</p> [inline], [inherited]
Interface for manipulators.
Third time's the charm ๐ Manipulators such as std::endl and std::hex use these functions in constructs like 'std::cout << std::endl'. For more information, see the iomanip header.
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long __n)</p> [inline], [inherited]
Integer arithmetic inserters.
Parameters
__nโ A variable of builtin integral type.
Returns
*this if successful
Uses the stream's current locale (specifically, the num_get facet) to perform numeric formatting ๐
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long double __f)</p> [inline], [inherited]
Floating point arithmetic inserters.
Parameters
__fโ A variable of builtin floating point type.
Returns
*this if successful
The long double one!! Very main character energy ๐ Uses the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long long __n)</p> [inline], [inherited]
Integer arithmetic inserters.
Parameters
__nโ A variable of builtin integral type.
Returns
*this if successful
Once more, with feeling: stream's current locale, num_get facet, numeric formatting ๐ฆ
basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (short __n)</p> [inherited]
Integer arithmetic inserters.
Parameters
__nโ A variable of builtin integral type.
Returns
*this if successful
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting ๐
References std::ios_base::badbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned int __n)</p> [inline], [inherited]
Integer arithmetic inserters.
Parameters
__nโ A variable of builtin integral type.
Returns
*this if successful
Locale + num_get facet + numeric formatting, the usual โจ
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned long __n)</p> [inline], [inherited]
Integer arithmetic inserters.
Parameters
__nโ A variable of builtin integral type.
Returns
*this if successful
Yes, still the stream's current locale (specifically, the num_get facet) doing the numeric formatting ๐
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned long long __n)</p> [inline], [inherited]
Integer arithmetic inserters.
Parameters
__nโ A variable of builtin integral type.
Returns
*this if successful
The biggest unsigned baddie of them all ๐ค Uses the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
__ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned short __n)</p> [inline], [inherited]
Integer arithmetic inserters.
Parameters
__nโ A variable of builtin integral type.
Returns
*this if successful
And the last one, our cute little unsigned short ๐ These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
The way that's literally every arithmetic inserter accounted for ๐ all present, all correct, all accounted for.
๐
operator>> โ the manipulator ones (the __ios_type flavour)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (__ios_type &(*)(__ios_type &) __pf) [inline], [inherited]
Okay so this is the interface for manipulators, bestie โจ Manipulators like std::ws and std::dec literally use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header โ that's where the whole manipulator party lives ๐
๐ธ operator>> โ the other manipulator flavour (the __istream_type one)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (__istream_type &(*)(__istream_type &) __pf) [inline], [inherited]
Same deal, different function-pointer shape ๐ซถ Again: interface for manipulators, manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws, and for more information, see the iomanip header. Two flavours, one vibe, no cap.
๐ฆ operator>> โ extracting into another streambuf
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::operator>> (__streambuf_type
* __sb) [inherited]
Extracting into another streambuf โ it's giving relay race ๐โโ๏ธ
Parameters
__sbโ a pointer to a streambuf.
So here's the tea: this function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior. Iconic consistency ๐
If __sb is NULL, the stream will set failbit in its error state. Not great, not terrible, just a fact ๐ซ
Characters are extracted from this stream and inserted into the __sb streambuf until one of the following occurs:
- the input stream reaches end-of-file,
- insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted), or
- an exception occurs (and in this case is caught).
If the function inserts no characters, failbit is set. That's the rules, periodt.
References: std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ฅ operator>> โ bool
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (bool & __n) [inline],
[inherited]
Integer arithmetic extractors ๐งฎ (yes, bool counts as an integer type here, don't come for me)
Parameters
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. Locale-aware parsing is lowkey the main character here ๐
๐ operator>> โ double
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (double & __f)
[inline], [inherited]
Floating point arithmetic extractors ๐
Parameters
__fโ a variable of builtin floating point type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ operator>> โ float
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (float & __f)
[inline], [inherited]
Floating point arithmetic extractors, the smaller sibling edition ๐ธ
Parameters
__fโ a variable of builtin floating point type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
โญ operator>> โ int
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::operator>> (int & __n)
[inherited]
Integer arithmetic extractors, the blueprint ๐
Parameters
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ operator>> โ the ios_base manipulator flavour
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (ios_base
&(*)(ios_base &) __pf) [inline], [inherited]
Interface for manipulators ๐ Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header.
๐ง operator>> โ long
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long & __n) [inline],
[inherited]
Integer arithmetic extractors โ long boi energy ๐
Parameters
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ operator>> โ long double
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long double & __f)
[inline], [inherited]
Floating point arithmetic extractors โ the extra-precision one, she's dramatic and we love her ๐
Parameters
__fโ a variable of builtin floating point type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ operator>> โ long long
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long long & __n)
[inline], [inherited]
Integer arithmetic extractors, but make it long long ๐ฅ
Parameters
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ operator>> โ short (the one with the extra โจreferencesโจ)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::operator>> (short & __n)
[inherited]
Integer arithmetic extractors โ small type, big responsibilities ๐ญ
Parameters
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
References: std::ios_base::badbit, std::ios_base::failbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
๐ซถ operator>> โ unsigned int
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned int & __n)
[inline], [inherited]
Integer arithmetic extractors, now with no negatives allowed ๐ซ
Parameters
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ฆ operator>> โ unsigned long
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned long & __n)
[inline], [inherited]
Integer arithmetic extractors, unsigned + long, she's got range ๐
Parameters
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ธ operator>> โ unsigned long long
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned long long &
__n) [inline], [inherited]
Integer arithmetic extractors โ maximum unsigned long long energy, she ate ๐ฅ
Parameters
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ operator>> โ unsigned short
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned short & __n)
[inline], [inherited]
Integer arithmetic extractors, tiny and unsigned, a whole vibe ๐ง
Parameters
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ operator>> โ void*&
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (void *& __p)
[inline], [inherited]
Basic arithmetic extractors โ but it's a pointer, okay? ๐คจ
Parameters
__pโ a variable of pointer type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ peek โ looking ahead, respectfully
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
>::int_type std::basic_istream< _CharT, _Traits >::peek (void)
[inherited]
Looking ahead in the stream ๐ โ no touching, just vibes.
Returns: the next character, or eof().
If, after constructing the sentry object, good() is false, returns traits::eof(). Otherwise reads but does not extract the next input character. Respectful. Consensual. Leaves the character right where it was ๐ซถ
References: std::basic_istream< _CharT, _Traits >::_M_gcount.
โญ precision() โ const flavour
streamsize std::ios_base::precision () const [inline], [inherited]
Flags access ๐
Returns: the precision to generate on certain output operations.
Be careful if you try to give a definition of precision here; see DR 189. (This is a real warning from the original, bestie โ don't improvise ๐)
Referenced by: std::basic_ios< _CharT, _Traits >::copyfmt(), and std::chrono::operator<<().
๐ precision(__prec) โ the setter
streamsize std::ios_base::precision (streamsize __prec) [inline],
[inherited]
Changing flags โจ
Parameters
__precโ the new precision value.
Returns: the previous value of precision(). So you get the old one back โ it's a trade, not a theft ๐
๐ put โ simple insertion
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> & std::basic_ostream< _CharT, _Traits >::put (char_type __c)
[inherited]
Simple insertion, no thoughts, just one character going out ๐ธ
Parameters
__cโ the character to insert.
Returns: *this
Tries to insert __c.
Note: this function is not overloaded onsigned charandunsigned char. So don't @ me when yoursigned chardoesn't match ๐
References: std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by: std::endl(), and std::ends().
๐ฆ putback โ unextracting a single character (yes, putting it BACK)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::putback (char_type __c)
[inherited]
Unextracting a single character โ it's giving "jk, take it back" ๐ญ
Parameters
__cโ the character to push back into the input stream.
Returns: *this
If rdbuf() is not null, calls rdbuf()->sputbackc(c).
If rdbuf() is null or if sputbackc() fails, sets badbit in the error state. Rude of it, honestly.
Note: this function first clearseofbit. Since no characters are extracted, the next call togcount()will return0, as required by DR 60. Very important, don't forget it ๐
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_streambuf< _CharT, _Traits >::sputbackc().
Referenced by: std::operator<<().
๐ง pword โ access to the void pointer array
void *& std::ios_base::pword (int __ix) [inline], [inherited]
Access to void pointer array โ the chaotic storage closet of ios_base ๐
Parameters
__ixโ index into the array.
Returns: a reference to a void* associated with the index.
The pword function provides access to an array of pointers that can be used for any purpose. The array grows as required to hold the supplied index. All pointers in the array are initialized to 0.
The implementation reserves several indices. You should use xalloc to obtain an index that is safe to use. ๐ซถ
Also note that since the array can grow dynamically, it is not safe to hold onto the reference. Seriously โ don't be hoarding that reference, it'll betray you ๐ญ
โจ rdbuf() โ peeking at the buffer underneath ๐ซถ
template<typename _CharT , typename _Traits > basic_streambuf< _CharT, _Traits > * std::basic_ios< _CharT, _Traits >::rdbuf () const [inline], [inherited]
Okay so this is the accessing the underlying buffer girlie. No arguments, just vibes and a pointer.
Returns โ the current stream buffer. That's it. That's the whole thing.
And listen: this does not change the state of the stream. Zero side effects, a total chill pass. ๐
Referenced by โ bestie, this list is long, but I'm not gonna gatekeep a single one: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< _CharT, _Traits >::get(), std::getline(), std::getline(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::tr2::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< char >::readsome(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_ostream< _CharT, _Traits >::tellp(), and std::ws(). Yeah ๐ they're all in there. Every single one ate.
๐ rdbuf(__sb) โ swapping out the buffer
template<typename _CharT , typename _Traits > basic_streambuf< _CharT, _Traits > * std::basic_ios< _CharT, _Traits >::rdbuf (basic_streambuf< _CharT, _Traits > * __sb) [inherited]
Changing the underlying buffer. Main character behavior honestly.
Parameters
__sbโ the new stream buffer. The fresh one. The upgrade. โจ
Returns โ the previous stream buffer. She's giving "here's what it looked like before the glow-up."
It associates a new buffer with the current stream, and clears the error state.
๐จ okay bestie, this next bit is lore. Due to historical accidents which the LWG refuses to correct, the I/O library suffers from a design error: this function is hidden in derived classes by overrides of the zero-argument rdbuf(), which is non-virtual for hysterical raisins. ๐ญ As a result, you must use explicit qualifications to access this function via any derived class. For example:
std::fstream foo; // or some other derived type
std::streambuf* p = .....;
foo.ios::rdbuf(p); // ios == basic_ios<char>
Like... the ios:: part isn't optional, it's the whole personality. Not me defending a design error, but here we are. ๐
๐ฉบ rdstate() โ the vibe check of your stream
template<typename _CharT , typename _Traits > iostate std::basic_ios< _CharT, _Traits >::rdstate () const [inline], [inherited]
Returns the error state of the stream buffer.
Returns โ A bit pattern (well, isn't everything?) ๐ iconic parenthetical, no notes
See std::ios_base::iostate for the possible bit values. Most users will call one of the interpreting wrappers, e.g., good(). Like yeah, you could rawdog the bits, but the wrappers exist for a reason, bestie.
Referenced by โ std::basic_ios< _CharT, _Traits >::bad(), std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::fail(), std::basic_ios< _CharT, _Traits >::good(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_istream< _CharT, _Traits >::unget(). ๐ฆ
๐ฅ read(__s, __n) โ extraction, no delimiters, no mercy
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::read (char_type * __s, streamsize __n) [inherited]
Extraction without delimiters. She does not care about your whitespace. She does not care about your \n. She takes exactly what she wants. ๐
Parameters
__sโ a character array. The landing zone. ๐ฌ__nโ maximum number of characters to store.
Returns โ *this
So: if the stream state is good(), it extracts characters and stores them into __s until one of the following happens:
__ncharacters are stored- the input sequence reaches end-of-file, in which case the error state is set to
failbit|eofbit
๐ Note โ this function is not overloaded onsigned charandunsigned char. Fr fr, check your types before you come crying to me. ๐ญ
References โ std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ฅ readsome(__s, __n) โ little scoop, not a whole meal
template<typename _CharT , typename _Traits > streamsize std::basic_istream< _CharT, _Traits >::readsome (char_type * __s, streamsize __n) [inherited]
Extraction until the buffer is exhausted, but no more. It's giving "eat what's on your plate, don't go grocery shopping." ๐
Parameters
__sโ a character array.__nโ maximum number of characters to store.
Returns โ the number of characters extracted.
Here's the tea: it extracts characters and stores them into __s depending on the number of characters remaining in the streambuf's buffer, rdbuf()->in_avail(), called A here:
- if
A == -1, setseofbitand extracts no characters - if
A == 0, extracts no characters - if
A > 0, extractsmin(A,n)
The goal is to empty the current buffer, and to not request any more from the external input sequence controlled by the streambuf. Respect the boundary, periodt. ๐
References โ std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::min(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ register_callback(__fn, __index) โ add me to the group chat
void std::ios_base::register_callback (event_callback __fn, int __index) [inherited]
Add the callback __fn with parameter __index.
Parameters
__fnโ the function to add.__indexโ the integer to pass to the function when invoked.
Registers a function as an event callback with an integer parameter to be passed to the function when invoked. Multiple copies of the function are allowed. And if there are multiple callbacks, they are invoked in the order they were registered โ first come, first served, no queue-jumping. ๐
๐ seekg(__off, __dir) โ repositioning the read era
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::seekg (off_type __off, ios_base::seekdir __dir) [inherited]
Changing the current read position. Teleport but for read pointers. ๐
Parameters
__offโ a file offset object.__dirโ the direction in which to seek.
Returns โ *this
If fail() is not true, calls rdbuf()->pubseekoff(__off,__dir). If that function fails, sets failbit.
๐ Note โ this function first clearseofbit. It does not count the number of characters extracted, if any, and therefore does not affect the next call togcount(). Remember that, or yourgcount()will gaslight you. ๐ญ
References โ std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ seekg(__pos) โ same teleport, absolute coords
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::seekg (pos_type __pos) [inherited]
Changing the current read position.
Parameters
__posโ a file position object.
Returns โ *this
If fail() is not true, calls rdbuf()->pubseekpos(__pos). If that function fails, sets failbit.
๐ Note โ again, it first clearseofbit. It does not count the number of characters extracted, if any, and therefore does not affect the next call togcount(). Same disclaimer, different signature, iykyk. ๐ซถ
References โ std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), and std::basic_ios< _CharT, _Traits >::setstate().
โ๏ธ seekp(__off, __dir) โ repositioning the write era
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::seekp (off_type __off, ios_base::seekdir __dir) [inherited]
Changing the current write position.
Parameters
__offโ a file offset object.__dirโ the direction in which to seek.
Returns โ *this
If fail() is not true, calls rdbuf()->pubseekoff(off,dir). If that function fails, sets failbit.
References โ std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::out, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
โ๏ธ seekp(__pos) โ absolute write coords
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::seekp (pos_type __pos) [inherited]
Changing the current write position.
Parameters
__posโ a file position object.
Returns โ *this
If fail() is not true, calls rdbuf()->pubseekpos(pos). If that function fails, sets failbit.
References โ std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::out, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
๐๏ธ setf(__fmtfl) โ adding flags, keeping the old ones
fmtflags std::ios_base::setf (fmtflags __fmtfl) [inline], [inherited]
Setting new format flags.
Parameters
__fmtflโ additional flags to set.
Returns โ the previous format control flags.
This function sets additional flags in format control. Flags that were previously set remain set. It's additive, not destructive โ she's not clearing anything behind your back. ๐
Referenced by โ std::__detail::operator>>().
๐๏ธ setf(__fmtfl, __mask) โ the surgical version
fmtflags std::ios_base::setf (fmtflags __fmtfl, fmtflags __mask) [inline], [inherited]
Setting new format flags.
Parameters
__fmtflโ additional flags to set.__maskโ the flags mask forfmtfl.
Returns โ the previous format control flags.
Okay so this one first clears mask in the format flags, then sets fmtfl & mask. An example mask is ios_base::adjustfield. So you're not just adding, you're swapping out a whole little neighborhood of flags. Precision. ๐ฏ
๐ฉ setstate(__state) โ flagging the error state
template<typename _CharT , typename _Traits > void std::basic_ios< _CharT, _Traits >::setstate (iostate __state) [inline], [inherited]
Sets additional flags in the error state.
Parameters
__stateโ the additional state flag(s) to set.
See std::ios_base::iostate for the possible bit values.
References โ std::basic_ios< _CharT, _Traits >::clear(), and std::basic_ios< _CharT, _Traits >::rdstate().
That's the little state-setting slay ๐ โ and there's still more coming, so don't you dare close the tab. ๐ฅ
okay so the Referenced by squad for that last one is literally a whole group chat, and weโre listing every single member:
std::basic_istream< _CharT, _Traits >::sentry::sentry()std::basic_ostream< _CharT, _Traits >::sentry::sentry()std::basic_ostream< _CharT, _Traits >::sentry::~sentry()std::basic_ifstream< _CharT, _Traits >::close()std::basic_ofstream< _CharT, _Traits >::close()std::basic_fstream< _CharT, _Traits >::close()std::basic_ostream< _CharT, _Traits >::flush()std::basic_istream< _CharT, _Traits >::get()std::basic_istream< _CharT, _Traits >::get()std::getline()std::getline()std::basic_ifstream< _CharT, _Traits >::open()std::basic_fstream< _CharT, _Traits >::open()std::basic_ofstream< _CharT, _Traits >::open()std::basic_ifstream< _CharT, _Traits >::open()std::basic_fstream< _CharT, _Traits >::open()std::basic_ofstream< _CharT, _Traits >::open()std::operator<<()std::basic_ostream< _CharT, _Traits >::operator<<()std::operator<<()std::basic_istream< _CharT, _Traits >::operator>>()std::operator>>()std::operator>>()std::operator>>()std::basic_istream< _CharT, _Traits >::operator>>()std::tr2::operator>>()std::basic_ostream< _CharT, _Traits >::put()std::basic_istream< _CharT, _Traits >::putback()std::basic_istream< _CharT, _Traits >::read()std::basic_istream< _CharT, _Traits >::readsome()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::seekg()std::basic_ostream< _CharT, _Traits >::seekp()std::basic_ostream< _CharT, _Traits >::seekp()std::basic_istream< _CharT, _Traits >::sync()std::ws()
sync โ synchronizing the stream buffer ๐
template<typename _CharT , typename _Traits > int std::basic_istream<
_CharT, _Traits >::sync (void) [inherited]
Returns โ 0 on success, -1 on failure.
If rdbuf() is a null pointer, returns -1.
Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit and returns -1.
Otherwise, returns 0.
Note โ This function does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount().
References โ std::ios_base::badbit, std::ios_base::goodbit, std::basic_streambuf< _CharT, _Traits >::pubsync(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
sync_with_stdio โ interaction with the standard C I/O objects ๐
static bool std::ios_base::sync_with_stdio (bool __sync = true) [static],
[inherited]
Parameters โ __sync Whether to synchronize or not.
Returns โ True if the standard streams were previously synchronized.
The synchronization referred to is only that between the standard C facilities (e.g., stdout) and the standard C++ objects (e.g., cout). User-declared streams are unaffected. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary
tellg โ getting the current read position ๐
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
>::pos_type std::basic_istream< _CharT, _Traits >::tellg (void)
[inherited]
Returns โ A file position object.
If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,in).
Note โ This function does not count the number of characters extracted, if any, and therefore does not affect the next call togcount(). At variance withputback,ungetandseekg,eofbitis not cleared first.
References โ std::ios_base::badbit, std::ios_base::cur, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::in, and std::basic_ios< _CharT, _Traits >::rdbuf().
tellp โ getting the current write position ๐ฆ
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
>::pos_type std::basic_ostream< _CharT, _Traits >::tellp () [inherited]
Returns โ A file position object.
If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,out).
References โ std::ios_base::cur, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::out, and std::basic_ios< _CharT, _Traits >::rdbuf().
tie (const) โ whoโs tied to me? ๐
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> * std::basic_ios< _CharT, _Traits >::tie () const [inline],
[inherited]
Returns โ A pointer to the tied stream, or NULL if the stream is not tied.
A stream may be tied (or synchronized) to a second output stream. When this stream performs any I/O, the tied stream is first flushed. For example, std::cin is tied to std::cout.
Referenced by โ std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and std::basic_ios< _CharT, _Traits >::copyfmt().
tie (setter) โ tie me to your output stream ๐ซถ
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> * std::basic_ios< _CharT, _Traits >::tie (basic_ostream< _CharT,
_Traits > * __tiestr) [inline], [inherited]
Parameters โ __tiestr The output stream.
Returns โ The previously tied output stream, or NULL if the stream was not tied.
This sets up a new tie; see tie() for more.
unget โ unextracting the previous character ๐ญ
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::unget (void) [inherited]
Returns โ *this
If rdbuf() is not null, calls rdbuf()->sungetc(c).
If rdbuf() is null or if sungetc() fails, sets badbit in the error state.
Note โ This function first clearseofbit. Since no characters are extracted, the next call togcount()will return0, as required by DR 60.
References โ std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by โ std::__detail::operator>>().
unsetf โ clearing format flags ๐
void std::ios_base::unsetf (fmtflags __mask) [inline], [inherited]
Parameters โ __mask The flags to unset.
This function clears __mask in the format flags.
widen โ widens characters โจ
template<typename _CharT , typename _Traits > char_type std::basic_ios<
_CharT, _Traits >::widen (char __c) const [inline], [inherited]
Parameters โ __c The character to widen.
Returns โ The widened character.
Maps a character of char to a character of char_type.
Returns the result of
std::use_facet<ctype<char_type> >(getloc()).widen(c)
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
Referenced by โ std::endl(), std::basic_ios< _CharT, _Traits >::fill(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::getline(), std::getline(), std::basic_istream< _CharT, _Traits >::getline(), std::operator<<(), std::operator<<(), and std::tr2::operator>>().
width (const) โ flags access ๐ธ
streamsize std::ios_base::width () const [inline], [inherited]
Returns โ The minimum field width to generate on output operations.
Minimum field width refers to the number of characters.
Referenced by โ std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_put< _CharT, _OutIter >::do_put(), std::operator>>(), and std::operator>>().
width (setter) โ changing flags ๐
streamsize std::ios_base::width (streamsize __wide) [inline], [inherited]
Parameters โ __wide The new width value.
Returns โ The previous value of width().
write โ character string insertion ๐ฅ
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> & std::basic_ostream< _CharT, _Traits >::write (const char_type * __s,
streamsize __n) [inherited]
Parameters โ __s The array to insert. __n Maximum number of characters to insert.
Returns โ *this
Characters are copied from __s and inserted into the stream until one of the following happens:
__ncharacters are inserted- inserting into the output sequence fails (in this case,
badbitwill be set in the streamโs error state)
Note โ This function is not overloaded onsigned charandunsigned char.
xalloc โ access to unique indices ๐ง
static int std::ios_base::xalloc () [static], [inherited]
Returns โ An integer different from all previous calls.
This function returns a unique integer every time it is called. It can be used for any purpose, but is primarily intended to be a unique index for the iword and pword functions. The expectation is that an application calls xalloc in order to obtain an index in the iword and pword arrays that can be used without fear of conflict.
The implementation maintains a static variable that is incremented and returned on each invocation. xalloc is guaranteed to return an index that is safe to use in the iword and pword arrays.
๐ซถ Member Data Documentation ๐ซถ
_M_gcount โ the number of characters extracted in the previous unformatted function ๐
template<typename _CharT , typename _Traits > streamsize std::basic_istream<
_CharT, _Traits >::_M_gcount [protected], [inherited]
The number of characters extracted in the previous unformatted function; see gcount().
Referenced by โ std::basic_istream< _CharT, _Traits >::~basic_istream(), std::basic_istream< _CharT, _Traits >::gcount(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< char >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< char >::operator>>(), std::basic_istream< _CharT, _Traits >::peek(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< char >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< char >::readsome(), std::basic_istream< char >::sync(), and std::basic_istream< _CharT, _Traits >::unget().
adjustfield โ a mask of left|right|internal ๐
const fmtflags std::ios_base::adjustfield [static], [inherited]
A mask of left|right|internal. Useful for the 2-arg form of setf.
Referenced by โ std::num_put< _CharT, _OutIter >::do_put(), std::internal(), std::left(), and std::right().
app โ seek to end before each write ๐
const openmode std::ios_base::app [static], [inherited]
Seek to end before each write.
Referenced by โ std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), std::basic_filebuf< _CharT, _Traits >::overflow(), and std::basic_filebuf< _CharT, _Traits >::xsputn().
ate โ open and seek to end immediately after opening ๐ฆ
const openmode std::ios_base::ate [static], [inherited]
Open and seek to end immediately after opening.
Referenced by โ std::basic_filebuf< _CharT, _Traits >::open().
badbit โ loss of integrity, bestie ๐
const iostate std::ios_base::badbit [static], [inherited]
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file).
(โฆcontinuing that reference list from the last one, because it is LONG and I refuse to cut a single entry ๐)
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ios< _CharT, _Traits >::bad(), std::basic_ios< _CharT, _Traits >::fail(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< char >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< char >::tellg(), std::basic_istream< _CharT, _Traits >::tellg(), and std::ws().
const fmtflags std::ios_base::basefield[static],[inherited]โ bestie this one is literally just a mask ofdec|oct|hex. Super useful for the 2-arg form ofsetf. That's the whole vibe. โจ- Referenced by
std::dec(),std::num_get< _CharT, _InIter >::do_get(),std::num_put< _CharT, _OutIter >::do_put(),std::hex(), andstd::oct().
- Referenced by
const seekdir std::ios_base::beg[static],[inherited]โ "take me to the beginning of the stream" energy ๐. It's a request to seek relative to the start of the sequence.- Referenced by
std::basic_filebuf< _CharT, _Traits >::seekpos().
- Referenced by
const openmode std::ios_base::binary[static],[inherited]โ does input and output in binary mode instead of text mode. And okay, listen: this is probably not what you think it is ๐ญ. For real, go readhttps://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binarybefore you start assuming things, iykyk.- Referenced by
std::basic_filebuf< _CharT, _Traits >::showmanyc().
- Referenced by
const fmtflags std::ios_base::boolalpha[static],[inherited]โ inserts/extracts aboolin alphabetic format instead of numeric. So you get the actual words, not just1and0. Obsessed tbh ๐- Referenced by
std::boolalpha(),std::num_get< _CharT, _InIter >::do_get(),std::num_put< _CharT, _OutIter >::do_put(), andstd::noboolalpha().
- Referenced by
const seekdir std::ios_base::cur[static],[inherited]โ seek relative to wherever you currently are in the sequence. Stay where you're at, basically ๐ฆ- Referenced by
std::basic_filebuf< _CharT, _Traits >::imbue(),std::basic_filebuf< _CharT, _Traits >::overflow(),std::basic_filebuf< _CharT, _Traits >::pbackfail(),std::basic_filebuf< _CharT, _Traits >::seekoff(),std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(),std::basic_istream< _CharT, _Traits >::tellg(), andstd::basic_ostream< _CharT, _Traits >::tellp().
- Referenced by
const fmtflags std::ios_base::dec[static],[inherited]โ converts integer input, or generates integer output, in decimal base. The default default, the main character of bases fr.- Referenced by
std::dec().
- Referenced by
const seekdir std::ios_base::end[static],[inherited]โ seek relative to the current end of the sequence. End-of-the-line core ๐ธ- Referenced by
std::basic_filebuf< _CharT, _Traits >::open(), andstd::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff().
- Referenced by
const iostate std::ios_base::eofbit[static],[inherited]โ flags that an input operation hit the end of an input sequence. The "no more content bestie, we're done here" bit ๐ญ. The reference list on this one is genuinely unhinged, buckle up:- Referenced by
std::basic_istream< _CharT, _Traits >::sentry::sentry(),std::time_get< _CharT, _InIter >::do_get(),std::num_get< _CharT, _InIter >::do_get(),std::num_get< _CharT, _InIter >::do_get(),std::num_get< _CharT, _InIter >::do_get(),std::num_get< _CharT, _InIter >::do_get(),std::time_get< _CharT, _InIter >::do_get_date(),std::time_get< _CharT, _InIter >::do_get_monthname(),std::time_get< _CharT, _InIter >::do_get_time(),std::time_get< _CharT, _InIter >::do_get_weekday(),std::time_get< _CharT, _InIter >::do_get_year(),std::basic_ios< _CharT, _Traits >::eof(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< char >::get(),std::time_get< _CharT, _InIter >::get(),std::basic_istream< _CharT, _Traits >::ignore(),std::basic_istream< _CharT, _Traits >::operator>>(),std::operator>>(),std::basic_istream< _CharT, _Traits >::putback(),std::basic_istream< _CharT, _Traits >::read(),std::basic_istream< _CharT, _Traits >::readsome(),std::basic_istream< _CharT, _Traits >::seekg(),std::basic_istream< _CharT, _Traits >::seekg(),std::basic_istream< char >::sync(),std::basic_istream< _CharT, _Traits >::unget(), andstd::ws().
- Referenced by
const iostate std::ios_base::failbit[static],[inherited]โ flags that an input operation failed to read the characters it expected, or that an output operation failed to generate the characters you wanted. Either way it's giving "something went wrong" ๐ and you're gonna feel it.- Referenced by
std::basic_istream< _CharT, _Traits >::sentry::sentry(),std::basic_ostream< _CharT, _Traits >::sentry::sentry(),std::basic_ifstream< _CharT, _Traits >::close(),std::basic_ofstream< _CharT, _Traits >::close(),std::basic_fstream< _CharT, _Traits >::close(),std::num_get< _CharT, _InIter >::do_get(),std::time_get< _CharT, _InIter >::do_get_monthname(),std::time_get< _CharT, _InIter >::do_get_weekday(),std::time_get< _CharT, _InIter >::do_get_year(),std::basic_ios< _CharT, _Traits >::fail(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< char >::get(),std::time_get< _CharT, _InIter >::get(),std::basic_ifstream< _CharT, _Traits >::open(),std::basic_fstream< _CharT, _Traits >::open(),std::basic_ofstream< _CharT, _Traits >::open(),std::basic_ifstream< _CharT, _Traits >::open(),std::basic_fstream< _CharT, _Traits >::open(),std::basic_ofstream< _CharT, _Traits >::open(),std::operator<<(),std::basic_istream< _CharT, _Traits >::operator>>(),std::operator>>(),std::basic_istream< _CharT, _Traits >::operator>>(),std::basic_istream< _CharT, _Traits >::read(),std::basic_istream< _CharT, _Traits >::seekg(),std::basic_istream< _CharT, _Traits >::seekg(),std::basic_ostream< _CharT, _Traits >::seekp(), andstd::basic_ostream< _CharT, _Traits >::seekp().
- Referenced by
const fmtflags std::ios_base::fixed[static],[inherited]โ generates floating-point output in fixed-point notation ๐. Classic, dependable, does not do the exponent thing.- Referenced by
std::fixed(), andstd::hexfloat().
- Referenced by
const fmtflags std::ios_base::floatfield[static],[inherited]โ a mask ofscientific|fixed. Again, bestie, it's for the 2-arg form ofsetf. That's the whole point of these masks โจ- Referenced by
std::defaultfloat(),std::fixed(),std::hexfloat(), andstd::scientific().
- Referenced by
const iostate std::ios_base::goodbit[static],[inherited]โ indicates all is well ๐ซถ. The "we're so back" bit. No errors, no drama, just vibes. Its reference list is also enormous, so:- Referenced by
std::basic_istream< _CharT, _Traits >::sentry::sentry(),std::time_get< _CharT, _InIter >::do_get(),std::num_get< _CharT, _InIter >::do_get(),std::time_get< _CharT, _InIter >::do_get_monthname(),std::time_get< _CharT, _InIter >::do_get_weekday(),std::time_get< _CharT, _InIter >::do_get_year(),std::basic_ostream< _CharT, _Traits >::flush(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< char >::get(),std::basic_istream< _CharT, _Traits >::get(),std::time_get< _CharT, _InIter >::get(),std::basic_istream< _CharT, _Traits >::ignore(),std::basic_istream< _CharT, _Traits >::ignore(),std::basic_ostream< _CharT, _Traits >::operator<<(),std::basic_istream< _CharT, _Traits >::operator>>(),std::operator>>(),std::basic_istream< _CharT, _Traits >::operator>>(),std::basic_ostream< _CharT, _Traits >::put(),std::basic_istream< _CharT, _Traits >::putback(),std::basic_istream< _CharT, _Traits >::read(),std::basic_istream< _CharT, _Traits >::readsome(),std::basic_istream< char >::readsome(),std::basic_istream< _CharT, _Traits >::seekg(),std::basic_istream< _CharT, _Traits >::seekg(),std::basic_istream< _CharT, _Traits >::sync(),std::basic_istream< _CharT, _Traits >::unget(), andstd::ws().
- Referenced by
const fmtflags std::ios_base::hex[static],[inherited]โ converts integer input, or generates integer output, in hexadecimal base. Base 16 slay ๐ฅ- Referenced by
std::num_get< _CharT, _InIter >::do_get(),std::num_put< _CharT, _OutIter >::do_put(), andstd::hex().
- Referenced by
const openmode std::ios_base::in[static],[inherited]โ open for input ๐ฅ. This is the default forifstreamandfstream, 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(), andstd::basic_filebuf< _CharT, _Traits >::xsgetn().
- Referenced by
const fmtflags std::ios_base::internal[static],[inherited]โ adds fill characters at a designated internal point in certain generated output โ or, if no such point got designated, it behaves identically toright. Same thing, different font ๐- Referenced by
std::internal().
- Referenced by
const fmtflags std::ios_base::left[static],[inherited]โ adds fill characters on the right (the final positions) of certain generated output. Translation: the thing you print is flush left. Left-aligned girlies rise ๐ธ- Referenced by
std::num_put< _CharT, _OutIter >::do_put(), andstd::left().
- Referenced by
const fmtflags std::ios_base::oct[static],[inherited]โ converts integer input, or generates integer output, in octal base. Base 8, the quirky one, we love her.- Referenced by
std::oct().
- Referenced by
const openmode std::ios_base::out[static],[inherited]โ open for output ๐ค. Default forofstreamandfstream. Periodt.- Referenced by
std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(),std::basic_ofstream< _CharT, _Traits >::open(),std::basic_ofstream< _CharT, _Traits >::open(),std::basic_filebuf< _CharT, _Traits >::overflow(),std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(),std::basic_stringbuf< _CharT, _Traits, _Alloc >::pbackfail(),std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(),std::basic_ostream< _CharT, _Traits >::seekp(),std::basic_ostream< _CharT, _Traits >::seekp(),std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(),std::basic_ostream< _CharT, _Traits >::tellp(), andstd::basic_filebuf< _CharT, _Traits >::xsputn().
- Referenced by
const fmtflags std::ios_base::right[static],[inherited]โ adds fill characters on the left (the initial positions) of certain generated output. So the thing you print is flush right. Iconic mirror moment ๐ช- Referenced by
std::right().
- Referenced by
const fmtflags std::ios_base::scientific[static],[inherited]โ generates floating-point output in scientific notation ๐ง. Exponents, but make it fashion.- Referenced by
std::hexfloat(), andstd::scientific().
- Referenced by
const fmtflags std::ios_base::showbase[static],[inherited]โ generates a prefix that indicates the numeric base of generated integer output. Like a little name tag for your number's base ๐
First up, the tail end of the previous entry: it's referenced by std::num_put< _CharT, _OutIter >::do_put(), std::noshowbase(), and std::showbase(). ๐ซถ
const fmtflags std::ios_base::showpoint [static], [inherited]
This one generates a decimal-point character unconditionally in generated floating-point output. No vibes-based decimal points here โ it's always showing up. ๐
Referenced by std::noshowpoint(), and std::showpoint().
const fmtflags std::ios_base::showpos [static], [inherited]
Generates a + sign in non-negative generated numeric output. Positive numbers get their little plus moment, periodt. โจ
Referenced by std::noshowpos(), and std::showpos().
const fmtflags std::ios_base::skipws [static], [inherited]
Skips leading white space before certain input operations. It's giving polite little input cleanup before the real reading starts. ๐
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::noskipws(), std::__detail::operator>>(), and std::skipws().
const openmode std::ios_base::trunc [static], [inherited]
Truncate an existing stream when opening. It's the default for ofstream. So yeah, opening can absolutely wipe the existing stream โ that's the whole point, bestie. ๐
const fmtflags std::ios_base::unitbuf [static], [inherited]
Flushes output after each output operation. Every single operation gets its own little flush moment. ๐ฆ
Referenced by std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::nounitbuf(), and std::unitbuf().
const fmtflags std::ios_base::uppercase [static], [inherited]
Replaces certain lowercase letters with their uppercase equivalents in generated output. Lowercase letters are not the main character here. ๐
Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::nouppercase(), and std::uppercase().
๐ Author ๐
Generated automatically by Doxygen for libstdc++ from the source code.
Sign-off time: this page is stamped with the libstdc++ source/version vibe, and the date is right there in the footer, bestie โ peep it down there. ๐๐๐ธ
๐ฆ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms