STD::BASIC_STRINGSTREAM(3cxx)
okay bestie, welcome to the std::basic_stri...raits, _Alloc >(3cxx) page โ part 1 of 10, and we are not skipping a single crumb. The manual name is folded in right here so you can find it without the wonky header line. ๐
๐ NAME ๐
std::basic_stringstream< _CharT, _Traits, _Alloc > โ controlling input and output for std::string. That's the whole vibe: it's the string-stream bestie.
โจ SYNOPSIS โจ
#include <sstream>
Inherits std::basic_iostream< _CharT, _Traits >.
๐ Public Types ๐
typedef ctype< _CharT > __ctype_typetypedef ctype< _CharT > __ctype_typeโ yes, it's listed twice in the original, don't come for me ๐typedef basic_ios< _CharT, _Traits > __ios_typetypedef basic_ios< _CharT, _Traits > __ios_typeโ also twice, and we're keeping ittypedef basic_iostream< char_type, traits_type > __iostream_typetypedef 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_typetypedef basic_streambuf< _CharT, _Traits > __streambuf_typeโ another twin, iconictypedef basic_string< _CharT, _Traits, _Alloc > __string_typetypedef basic_stringbuf< _CharT, _Traits, _Alloc > __stringbuf_typetypedef _Alloc allocator_typetypedef _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_type::int_type int_typetypedef _Ios_Iostate iostateโ this is a bitmask type.typedef traits_type::off_type off_typetypedef _Ios_Openmode openmodeโ this is a bitmask type.typedef traits_type::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โ yep, it shows up again at the end, that's the original's whole thing ๐ซถ
๐ธ Public Member Functions ๐ธ
okay, deep breath, bestie โ this is the big list. Every signature stays exactly as written; only the commentary is getting the group-chat treatment. ๐
basic_stringstream ()โ default constructor, starts with an empty string buffer.basic_stringstream (basic_stringstream &&__rhs)basic_stringstream (const __string_type &__str, ios_base::openmode __m=ios_base::out|ios_base::in)โ starts with an existing string buffer.basic_stringstream (const basic_stringstream &)=deletebasic_stringstream (ios_base::openmode __m)โ starts with an empty string buffer.~basic_stringstream ()โ the destructor does nothing.template<typename _ValueT > basic_istream< _CharT, _Traits > & _M_extract (_ValueT &__v)const locale & _M_getloc () constโ locale access.template<typename _ValueT > basic_ostream< _CharT, _Traits > & _M_insert (_ValueT __v)void _M_setstate (iostate __state)bool bad () constโ fast error checking.void clear (iostate __state=goodbit)โ [re]sets the error state.basic_ios & copyfmt (const basic_ios &__rhs)โ copies fields of__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)basic_stringstream & operator= (basic_stringstream &&__rhs)basic_stringstream & operator= (const basic_stringstream &)=delete__istream_type & operator>> (__streambuf_type *__sb)โ extracting into another streambuf.__istream_type & operator>> (void *&__p)โ basic arithmetic extractors.streamsize precision () constโ flags access.streamsize precision (streamsize __prec)โ changing flags.void *& pword (int __ix)โ access to void pointer array.__stringbuf_type * rdbuf () constโ accessing the underlying buffer.basic_streambuf< _CharT, _Traits > * rdbuf (basic_streambuf< _CharT, _Traits > *__sb)โ changing the underlying buffer.iostate rdstate () constโ returns the error state of the stream buffer.void register_callback (event_callback __fn, int __index)โ add the callback__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.__string_type str () constโ copying out the string buffer.void str (const __string_type &__s)โ setting a new buffer.void swap (basic_stringstream &__rhs)pos_type tellp ()โ getting the current write position.basic_ostream< _CharT, _Traits > * tie () constโ fetches the current tied stream.basic_ostream< _CharT, _Traits > * tie (basic_ostream< _CharT, _Traits > *__tiestr)โ ties this stream to an output stream.void unsetf (fmtflags __mask)โ clearing format flags.basic_string_view< char_type, traits_type > view () const noexceptchar_type widen (char __c) constโ widens characters.streamsize width () constโ flags access.streamsize width (streamsize __wide)โ changing flags.__istream_type & operator>> (__istream_type &(*__pf)(__istream_type &))โ interface for manipulators.__istream_type & operator>> (__ios_type &(*__pf)(__ios_type &))โ interface for manipulators.__istream_type & operator>> (ios_base &(*__pf)(ios_base &))โ interface for manipulators.
๐ฅ Extractors ๐ฅ
okay so every single operator>> (a.k.a. the formatted input functions) shares some common behavior. Each one starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to false. That does several things, and it ends with setting a status flag; peek the sentry documentation for the full lore.
If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument.
If an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state (without causing an ios_base::failure to be thrown) and the original exception will be rethrown if badbit is set in the exceptions mask.
__istream_type & operator>> (bool &__n)โ integer arithmetic extractors.__istream_type & operator>> (short &__n)โ integer arithmetic extractors.__istream_type & operator>> (unsigned short &__n)โ integer arithmetic extractors.__istream_type & operator>> (int &__n)โ integer arithmetic extractors.__istream_type & operator>> (unsigned int &__n)โ integer arithmetic extractors.__istream_type & operator>> (long &__n)โ integer arithmetic extractors.__istream_type & operator>> (unsigned long &__n)โ integer arithmetic extractors.__istream_type & operator>> (long long &__n)โ integer arithmetic extractors.__istream_type & operator>> (unsigned long long &__n)โ integer arithmetic extractors.__istream_type & operator>> (float &__f)โ floating point arithmetic extractors.__istream_type & operator>> (double &__f)โ floating point arithmetic extractors.__istream_type & operator>> (long double &__f)โ floating point arithmetic extractors.
๐ซถ Unformatted Input Functions ๐ซถ
All the unformatted input functions have some common behavior too. Each one starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to true. That has several effects, concluding with the setting of a status flag; see the sentry documentation for more.
If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument.
The number of characters extracted is stored for later retrieval by gcount().
If an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state (without causing an ios_base::failure to be thrown) and the original exception will be rethrown if badbit is set in the exceptions mask.
int_type get ()โ the simplest lil extraction, literally just grab one character and go ๐ซถ__istream_type & get (char_type &__c)โ same simple extraction, except the character lands in__c__istream_type & get (char_type *__s, streamsize __n, char_type __delim)โ simple multiple-character extraction, stopping at__delim๐__istream_type & get (char_type *__s, streamsize __n)โ simple multiple-character extraction, no delimiter era__istream_type & get (__streambuf_type &__sb, char_type __delim)โ extraction straight into another streambuf, stopping at__delim__istream_type & get (__streambuf_type &__sb)โ extraction into another streambuf, periodt__istream_type & getline (char_type *__s, streamsize __n, char_type __delim)โ string extraction ๐__istream_type & getline (char_type *__s, streamsize __n)โ string extraction, default vibes__istream_type & ignore (streamsize __n, int_type __delim)โ discarding characters, we simply do not perceive them โจ__istream_type & ignore (streamsize __n)โ simple extraction (yes bestie, the label really does say that)__istream_type & ignore ()โ simple extraction again, no args no thoughtsint_type peek ()โ looking ahead in the stream ๐ you're nosy but make it legal__istream_type & read (char_type *__s, streamsize __n)โ extraction without delimiters, no manners at allstreamsize readsome (char_type *__s, streamsize __n)โ extraction until the buffer is exhausted, but no more. Respects the limit fr fr__istream_type & putback (char_type __c)โ unextracting a single character, gaslighting the stream into thinking it never left__istream_type & unget ()โ unextracting the previous character, the uno reverse card ๐ฆint sync ()โ synchronizing the stream bufferpos_type tellg ()โ getting the current read position, where are we even ๐__istream_type & seekg (pos_type)โ changing the current read position__istream_type & seekg (off_type, ios_base::seekdir)โ changing the current read position, but with extra instructionsoperator bool () constโ the quick-and-easy status check ๐bool operator! () constโ the quick-and-easy status check, but inverted bestie__ostream_type & operator<< (__ostream_type &(*__pf)(__ostream_type &))โ interface for manipulators__ostream_type & operator<< (__ios_type &(*__pf)(__ios_type &))โ interface for manipulators__ostream_type & operator<< (ios_base &(*__pf)(ios_base &))โ interface for manipulators
๐ Inserters ๐
okay so listen, all the operator<< functions (aka the formatted output functions, fancy name i know) have some common behavior, and you will be tested on it ๐
Each one starts by constructing a temporary object of type std::basic_ostream::sentry. That lil guy can have several effects, and it concludes with the setting of a status flag โ see the sentry documentation for more, i'm not doing its whole lore dump here.
If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument. simple as that โจ
If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state without causing an ios_base::failure to be thrown. The original exception will then be rethrown. so like, chaos but contained ๐
__ostream_type & operator<< (long __n)โ integer arithmetic inserter__ostream_type & operator<< (unsigned long __n)โ integer arithmetic inserter__ostream_type & operator<< (bool __n)โ integer arithmetic inserter__ostream_type & operator<< (short __n)โ integer arithmetic inserter__ostream_type & operator<< (unsigned short __n)โ integer arithmetic inserter__ostream_type & operator<< (int __n)โ integer arithmetic inserter__ostream_type & operator<< (unsigned int __n)โ integer arithmetic inserter__ostream_type & operator<< (long long __n)โ integer arithmetic inserter__ostream_type & operator<< (unsigned long long __n)โ integer arithmetic inserter__ostream_type & operator<< (double __f)โ floating point arithmetic inserter ๐ธ__ostream_type & operator<< (float __f)โ floating point arithmetic inserter__ostream_type & operator<< (long double __f)โ floating point arithmetic inserter
๐ง Unformatted Output Functions ๐ง
bestie, these ones have their own common behavior, don't mix them up ๐
Each one starts by constructing a temporary object of type std::basic_ostream::sentry. This has several effects, concluding with the setting of a status flag โ see the sentry documentation for more, again.
If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument.
If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state. If badbit is on in the stream's exceptions mask, the exception will be rethrown without completing its actions. that's the difference, ok, write it down ๐
__ostream_type & put (char_type __c)โ simple insertion__ostream_type & write (const char_type *__s, streamsize __n)โ character string insertion, the whole squad goes in ๐
โญ Static Public Member Functions โญ
static bool sync_with_stdio (bool __sync=true)โ interaction with the standard C I/O objects. note the default__sync=true, she's opt-outstatic int xalloc () throw ()โ access to unique indices ๐ฅ
๐ Static Public Attributes ๐
static const openmode __noreplacestatic const fmtflags adjustfieldโ a mask ofleft|right|internal. useful for the 2-arg form ofsetfstatic const openmode appโ seek to end before each writestatic const openmode ateโ open and seek to end immediately after openingstatic const iostate badbitโ indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file) ๐ญstatic const fmtflags basefieldโ a mask ofdec|oct|hex. useful for the 2-arg form ofsetfstatic const seekdir begโ request a seek relative to the beginning of the streamstatic const openmode binaryโ perform input and output in binary mode (as opposed to text mode). This is probably not what you think it is; seehttps://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary. no cap, go read it ๐static const fmtflags boolalphaโ insert/extractboolin alphabetic rather than numeric formatstatic const seekdir curโ request a seek relative to the current position within the sequencestatic const fmtflags decโ converts integer input or generates integer output in decimal basestatic const seekdir endโ request a seek relative to the current end of the sequencestatic const iostate eofbitโ indicates that an input operation reached the end of an input sequencestatic const iostate failbitโ indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters ๐static const fmtflags fixedโ generate floating-point output in fixed-point notationstatic const fmtflags floatfieldโ a mask ofscientific|fixed. useful for the 2-arg form ofsetfstatic const iostate goodbitโ indicates all is well ๐ซถ the good endingstatic const fmtflags hexโ converts integer input or generates integer output in hexadecimal basestatic const openmode inโ open for input. default forifstreamandfstreamstatic const fmtflags internalโ adds fill characters at a designated internal point in certain generated output, or identical torightif no such point is designatedstatic 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 basestatic const openmode outโ open for output. default forofstreamandfstreamstatic 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 notationstatic const fmtflags showbaseโ generates a prefix indicating the numeric base of generated integer outputstatic const fmtflags showpointโ generates a decimal-point character unconditionally in generated floating-point outputstatic const fmtflags showposโ generates a+sign in non-negative generated numeric outputstatic const fmtflags skipwsโ skips leading white space before certain input operationsstatic const openmode truncโ truncate an existing stream when opening. default forofstreamstatic const fmtflags unitbufโ flushes output after each output operationstatic const fmtflags uppercaseโ replaces certain lowercase letters with their uppercase equivalents in generated output
๐ฆ Protected Types ๐ฆ
enum { _S_local_word_size }
๐ธ Protected Member Functions ๐ธ
void _M_cache_locale (const locale &__loc)void _M_call_callbacks (event __ev) throw ()void _M_dispose_callbacks (void) throw ()template<typename _ValueT > __istream_type & _M_extract (_ValueT &__v)_Words & _M_grow_words (int __index, bool __iword)void _M_init () throw ()template<typename _ValueT > __ostream_type & _M_insert (_ValueT __v)void _M_move (ios_base &) noexceptvoid _M_swap (ios_base &__rhs) noexceptvoid init (basic_streambuf< _CharT, _Traits > *__sb)โ all setup is performed here โจ one function to rule them allvoid move (basic_ios &&__rhs)void move (basic_ios &__rhs)void set_rdbuf (basic_streambuf< _CharT, _Traits > *__sb)void swap (basic_ios &__rhs) noexceptvoid swap (basic_iostream &__rhs)void swap (basic_istream &__rhs)void swap (basic_ostream &__rhs)
๐ Protected Attributes ๐
_Callback_list * _M_callbacksconst __ctype_type * _M_ctypeiostate _M_exceptionchar_type _M_fillbool _M_fill_initfmtflags _M_flagsstreamsize _M_gcountlocale _M_ios_locale_Words _M_local_word [_S_local_word_size]const __num_get_type * _M_num_getconst __num_put_type * _M_num_putstreamsize _M_precisionbasic_streambuf< _CharT, _Traits > * _M_streambufiostate _M_streambuf_statebasic_ostream< _CharT, _Traits > * _M_tiestreamsize _M_width_Words * _M_wordint _M_word_size_Words _M_word_zero
๐ Detailed Description ๐
template<typename _CharT, typename _Traits, typename _Alloc>
class std::basic_stringstream< _CharT, _Traits, _Alloc >
Controlling input and output for std::string. that's the whole assignment bestie, main character energy ๐
๐ Template Parameters ๐
_CharTโ type of character stream_Traitsโ traits for character type, defaults tochar_traits<_CharT>_Allocโ allocator type, defaults toallocator<_CharT>
This class supports reading from and writing to objects of type std::basic_string, using the inherited functions from std::basic_iostream. To control the associated sequence, an instance of std::basic_stringbuf is used, which this page refers to as sb. and that's the tea โ iykyk
๐ธ Member Typedef Documentation ๐ธ
๐ std::basic_ios< _CharT, _Traits >::__num_put_type (inherited)
template<typename _CharT , typename _Traits > typedef num_put<_CharT,
ostreambuf_iterator<_CharT, _Traits> > std::basic_ios< _CharT, _Traits
>::__num_put_type [inherited]
Heads up bestie: these are non-standard types. โจ
๐ std::ios_base::event_callback (inherited)
typedef void(* std::ios_base::event_callback) (event __e, ios_base &__b, int
__i) [inherited]
The type of an event callback function. ๐
Parameters:
__eโ one of the members of theeventenum.__bโ reference to theios_baseobject.__iโ the integer provided when the callback was registered.
Event callbacks are user defined functions that get called during several ios_base and basic_ios functions, specifically imbue(), copyfmt(), and ~ios(). ๐ซถ
๐ฆ std::ios_base::fmtflags (inherited)
typedef _Ios_Fmtflags std::ios_base::fmtflags [inherited]
This is a bitmask type. _Ios_Fmtflags is implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of type fmtflags are:
boolalphadecfixedhexinternalleftoctrightscientificshowbaseshowpointshowposskipwsunitbufuppercaseadjustfieldbasefieldfloatfield
๐ std::ios_base::iostate (inherited)
typedef _Ios_Iostate std::ios_base::iostate [inherited]
This is a bitmask type. _Ios_Iostate is implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of type iostate are:
badbiteofbitfailbitgoodbit
๐ฅ std::ios_base::openmode (inherited)
typedef _Ios_Openmode std::ios_base::openmode [inherited]
This is a bitmask type. _Ios_Openmode is implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of type openmode are:
appatebinaryinouttrunc
๐ std::ios_base::seekdir (inherited)
typedef _Ios_Seekdir std::ios_base::seekdir [inherited]
This is an enumerated type. _Ios_Seekdir is implementation-defined. Defined values of type seekdir are:
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)
enum std::ios_base::event [inherited]
The set of events that may be passed to an event callback. erase_event is used during ~ios() and copyfmt(). imbue_event is used during imbue(). copyfmt_event is used during copyfmt(). ๐
๐ Constructor & Destructor Documentation ๐
๐
basic_stringstream() โ default constructor
template<typename _CharT , typename _Traits , typename _Alloc >
std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream
() [inline]
Default constructor starts with an empty string buffer. Initializes sb using the mode in|out, and passes &sb to the base class initializer. Does not allocate any buffer. โจ
That's a lie. We initialize the base class with NULL, because the string class does its own memory management. ๐ญ
References std::basic_ios< _CharT, _Traits >::init().
๐ซถ basic_stringstream(ios_base::openmode __m) โ explicit
template<typename _CharT , typename _Traits , typename _Alloc >
std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream
(ios_base::openmode __m) [inline], [explicit]
Starts with an empty string buffer. ๐ธ
Parameters:
__mโ whether the buffer can read, or write, or both.
Initializes sb using the mode from __m, and passes &sb to the base class initializer. Does not allocate any buffer.
That's a lie. We initialize the base class with NULL, because the string class does its own memory management. ๐ญ
References std::basic_ios< _CharT, _Traits >::init().
๐ฆ basic_stringstream(const __string_type & __str, ios_base::openmode __m = ios_base::out | ios_base::in) โ explicit
template<typename _CharT , typename _Traits , typename _Alloc >
std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream
(const __string_type & __str, ios_base::openmode __m = ios_base::out |
ios_base::in) [inline], [explicit]
Starts with an existing string buffer. ๐
Parameters:
__strโ a string to copy as a starting buffer.__mโ whether the buffer can read, or write, or both.
Initializes sb using __str and __m, and passes &sb to the base class initializer.
That's a lie. We initialize the base class with NULL, because the string class does its own memory management. ๐ญ
References std::basic_ios< _CharT, _Traits >::init().
๐ ~basic_stringstream() โ destructor
template<typename _CharT , typename _Traits , typename _Alloc >
std::basic_stringstream< _CharT, _Traits, _Alloc >::~basic_stringstream
() [inline]
The destructor does nothing. The buffer is deallocated by the stringbuf object, not the formatting stream. ๐
๐ Member Function Documentation ๐
๐ std::ios_base::_M_getloc() โ inherited
const locale & std::ios_base::_M_getloc () const [inline], [inherited]
Locale access. Returns a reference to the current locale. Like getloc above, but returns a reference instead of generating a copy. ๐
Referenced by std::money_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_date(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_time(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::num_put< _CharT, _OutIter >::do_put(), std::time_put< _CharT, _OutIter >::do_put(), std::time_get< _CharT, _InIter >::get(), and std::time_put< _CharT, _OutIter >::put().
๐ฆ std::basic_ios< _CharT, _Traits >::bad() โ inherited
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
_Traits >::bad () const [inline], [inherited]
Fast error checking. Returns true if the badbit is set. Note that other iostate flags may also be set. ๐
References std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by std::basic_ostream< _CharT, _Traits >::sentry::sentry().
๐ฅ std::basic_ios< _CharT, _Traits >::clear(iostate __state = goodbit) โ inherited
template<typename _CharT , typename _Traits > void std::basic_ios< _CharT,
_Traits >::clear (iostate __state = goodbit) [inherited]
[Re]sets the error state. โจ
Parameters:
__stateโ the new state flag(s) to set.
See std::ios_base::iostate for the possible bit values. Most users will not need to pass an argument.
Referenced by std::basic_ios< _CharT, _Traits >::exceptions(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_fstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_fstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::__detail::operator>>(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_istream< _CharT, _Traits >::unget().
๐ std::basic_ios< _CharT, _Traits >::copyfmt(const basic_ios< _CharT, _Traits > & __rhs) โ inherited
template<typename _CharT , typename _Traits > basic_ios< _CharT, _Traits > &
std::basic_ios< _CharT, _Traits >::copyfmt (const basic_ios< _CharT,
_Traits > & __rhs) [inherited]
Copies fields of __rhs into this. ๐ซถ
Parameters:
__rhsโ the source values for the copies.
Returns a reference to this object.
All fields of __rhs are copied into this object except that rdbuf() and rdstate() remain unchanged. All values in the pword and iword arrays are copied. Before copying, each callback is invoked with erase_event. After copying, each (new) callback is invoked with copyfmt_event. The final step is to copy exceptions().
References std::__addressof(), std::basic_ios< _CharT, _Traits >::exceptions(), std::basic_ios< _CharT, _Traits >::fill(), std::ios_base::flags(), std::ios_base::getloc(), std::ios_base::precision(), std::basic_ios< _CharT, _Traits >::tie(), std::tie(), and std::ios_base::width().
๐ธ std::basic_ios< _CharT, _Traits >::eof() โ inherited
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
_Traits >::eof () const [inline], [inherited]
Fast error checking. Returns true if the eofbit is set. Note that other iostate flags may also be set. ๐
References std::ios_base::eofbit, and std::basic_ios< _CharT, _Traits >::rdstate().
๐ฆ std::basic_ios< _CharT, _Traits >::exceptions() โ inherited
template<typename _CharT , typename _Traits > iostate std::basic_ios<
_CharT, _Traits >::exceptions () const [inline], [inherited]
Throwing exceptions on errors. Returns the current exceptions mask. This changes nothing in the stream. See the one-argument version of exceptions(iostate) for the meaning of the return value. โจ
Referenced by std::basic_ios< _CharT, _Traits >::copyfmt().
๐ซถ std::basic_ios< _CharT, _Traits >::exceptions(iostate __except) โ inherited
template<typename _CharT , typename _Traits > void std::basic_ios< _CharT,
_Traits >::exceptions (iostate __except) [inline], [inherited]
Throwing exceptions on errors. ๐
Parameters:
__exceptโ the new exceptions mask.
By default, error flags are set silently. You can set an exceptions mask for each stream; if a bit in the mask becomes set in the error flags, then an exception of type std::ios_base::failure is thrown.
If the error flag is already set when the exceptions mask is added, the exception is immediately thrown. Try running the following under GCC 3.1 or later:
#include <iostream>
#include <fstream>
#include <exception>
int main()
{
std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
std::ifstream f ("/etc/motd");
std::cerr << "Setting badbit\n";
f.setstate (std::ios_base::badbit);
std::cerr << "Setting exception mask\n";
f.exceptions (std::ios_base::badbit);
}
References std::basic_ios< _CharT, _Traits >::clear().
๐ std::basic_ios< _CharT, _Traits >::fail() โ inherited
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
_Traits >::fail () const [inline], [inherited]
Fast error checking. Returns true if either the badbit or the failbit is set. Checking the badbit in fail() is historical practice. Note that other iostate flags may also be set. ๐ญ
References std::ios_base::badbit, std::ios_base::failbit, and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by std::basic_ios< _CharT, _Traits >::operator bool(), std::basic_ios< _CharT, _Traits >::operator!(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_ostream< _CharT, _Traits >::tellp(), and std::regex_traits< _Ch_type >::value().
๐ std::basic_ios< _CharT, _Traits >::fill() โ inherited
template<typename _CharT , typename _Traits > char_type std::basic_ios<
_CharT, _Traits >::fill () const [inline], [inherited]
Retrieves the empty character. Returns the current fill character. It defaults to a space (' ') in the current locale. ๐
References std::basic_ios< _CharT, _Traits >::widen().
Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), and std::basic_ios< _CharT, _Traits >::fill().
๐ <code>char_type std::basic_ios<_CharT, _Traits>::fill (char_type __ch) [inline], [inherited]</code> โ setting the fill char
template<typename _CharT , typename _Traits > char_type std::basic_ios<
_CharT, _Traits >::fill (char_type __ch) [inline], [inherited]
Okay so this one sets a brand-new empty character. That's the whole vibe. ๐
Parameters
__chโ the new character, bestie.
Returns โ the previous fill character. It's giving "here's what you had before, don't say I never gave you anything". ๐
So like, the fill character is what gets used to fill out space when P+ characters have been requested (e.g., via setw), Q characters are actually used, and Q<P. It defaults to a space (' ') in the current locale. Iconic default honestly.
References std::basic_ios< _CharT, _Traits >::fill().
๐ฅ <code>fmtflags std::ios_base::flags () const [inline], [inherited]</code> โ peeking at the flags
fmtflags std::ios_base::flags () const [inline], [inherited]
Access to format flags, no cap. ๐ซถ
Returns โ the format control flags for both input and output. Both of them. She's multifaceted.
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), std::num_put< _CharT, _OutIter >::do_put(), std::normal_distribution< double >::operator()(), std::operator<<(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), std::__detail::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), and std::operator>>().
(yes the std::operator>>() really does show up that many times, I'm not doing a bit, the list is just like that ๐ญ)
โจ <code>fmtflags std::ios_base::flags (fmtflags __fmtfl) [inline], [inherited]</code> โ setting them all at once
fmtflags std::ios_base::flags (fmtflags __fmtfl) [inline], [inherited]
Setting new format flags, all at once, main character energy. ๐
Parameters
__fmtflโ the new flags to set.
Returns โ the previous format control flags.
Heads up: this function overwrites all the format flags with __fmtfl. Not a merge, not a little update โ a full overwrite. So know what you're doing, bestie. ๐
๐ <code>basic_ostream<_CharT, _Traits> & std::basic_ostream<_CharT, _Traits>::flush () [inherited]</code> โ syncing the stream buffer
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> & std::basic_ostream< _CharT, _Traits >::flush () [inherited]
Synchronizing the stream buffer. The way that this one just does things. ๐ธ
Returns โ *this
If rdbuf() is a null pointer, changes nothing. Nothing at all. Chill.
Otherwise, it calls rdbuf()->pubsync(), and if that returns -1, sets badbit. So there's a real chance of a bad time here. ๐
References std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by std::flush().
๐งฎ <code>streamsize std::basic_istream<_CharT, _Traits>::gcount () const [inline], [inherited]</code> โ character counting
template<typename _CharT , typename _Traits > streamsize std::basic_istream<
_CharT, _Traits >::gcount () const [inline], [inherited]
Character counting. She's literally just counting. ๐
Returns โ the number of characters extracted by the previous unformatted input function dispatched for this stream.
References std::basic_istream< _CharT, _Traits >::_M_gcount.
๐ <code>basic_istream<_CharT, _Traits>::int_type std::basic_istream<_CharT, _Traits>::get (void) [inherited]</code> โ the simple extraction
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
>::int_type std::basic_istream< _CharT, _Traits >::get (void)
[inherited]
Returns โ a character, or eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof(). That's it, that's the function. ๐
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by std::basic_istream< _CharT, _Traits >::get(), and std::basic_istream< _CharT, _Traits >::get().
๐ฆ <code>__istream_type & std::basic_istream<_CharT, _Traits>::get (__streambuf_type & __sb) [inline], [inherited]</code> โ extraction into another streambuf
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb)
[inline], [inherited]
Parameters
__sbโ a streambuf in which to store data.
Returns โ *this
Literally just returns get(__sb,widen('\n')). A lil one-liner. She's delegating and honestly? Respect. โจ
References std::basic_istream< _CharT, _Traits >::get(), and std::basic_ios< _CharT, _Traits >::widen().
๐ <code>basic_istream<_CharT, _Traits> & std::basic_istream<_CharT, _Traits>::get (__streambuf_type & __sb, char_type __delim) [inherited]</code> โ extraction with a stop char
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb,
char_type __delim) [inherited]
Parameters
__sbโ a streambuf in which to store data.__delimโ a 'stop' character.
Returns โ *this
Characters are extracted and inserted into __sb until one of the following happens:
- the input sequence reaches EOF
- insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted)
- the next character equals
__delim(in this case, the character is not extracted) - an exception occurs (and in this case is caught)
If no characters are stored, failbit is set in the stream's error state. ๐ซถ
References std::basic_istream< _CharT, _Traits >::_M_gcount, and std::ios_base::goodbit.
๐ <code>basic_istream<_CharT, _Traits> & std::basic_istream<_CharT, _Traits>::get (char_type & __c) [inherited]</code> โ simple extraction, by reference
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::get (char_type & __c)
[inherited]
Parameters
__cโ the character in which to store data.
Returns โ *this
Tries to extract a character and store it in __c. If none are available, sets failbit and returns traits::eof(). Same drama as before, just with somewhere to put the result. ๐
Note โ this function is not overloaded onsigned charandunsigned char. Read that twice, bestie. ๐ฅ
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ธ <code>__istream_type & std::basic_istream<_CharT, _Traits>::get (char_type * __s, streamsize __n) [inline], [inherited]</code> โ multi-character extraction
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::get (char_type * __s, streamsize
__n) [inline], [inherited]
Parameters
__sโ pointer to an array.__nโ maximum number of characters to store ins.
Returns โ *this
Returns get(__s,__n,widen('\n')). Another lil handoff, we love a delegation queen. ๐ง
References std::basic_istream< _CharT, _Traits >::get(), and std::basic_ios< _CharT, _Traits >::widen().
๐ <code>basic_istream<_CharT, _Traits> & std::basic_istream<_CharT, _Traits>::get (char_type * __s, streamsize __n, char_type __delim) [inherited]</code> โ the full multi-char version
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::get (char_type * __s,
streamsize __n, char_type __delim) [inherited]
Parameters
__sโ pointer to an array.__nโ maximum number of characters to store in__s.__delimโ a 'stop' character.
Returns โ *this
Characters are extracted and stored into __s until one of the following happens:
__n-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. Always. Non-negotiable. ๐
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().
๐ <code>__istream_type & std::basic_istream<_CharT, _Traits>::getline (char_type * __s, streamsize __n) [inline], [inherited]</code> โ string extraction
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::getline (char_type * __s,
streamsize __n) [inline], [inherited]
Parameters
__sโ a character array in which to store the data.__nโ maximum number of characters to extract.
Returns โ *this
Returns getline(__s,__n,widen('\n')). Yes bestie, another delegate. ๐
References std::basic_istream< _CharT, _Traits >::getline(), and std::basic_ios< _CharT, _Traits >::widen().
๐ <code>basic_istream<_CharT, _Traits> & std::basic_istream<_CharT, _Traits>::getline (char_type * __s, streamsize __n, char_type __delim) [inherited]</code> โ the real string extraction
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::getline (char_type * __s,
streamsize __n, char_type __delim) [inherited]
Parameters
__sโ a character array in which to store the data.__nโ maximum number of characters to extract.__delimโ a 'stop' character.
Returns โ *this
Extracts and stores characters into __s until one of the following happens. Note that these criteria are required to be tested in the order listed here, to allow an input line to exactly fill the __s array without setting failbit. The order is load-bearing, iykyk. ๐ฅ
- 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. She said what she said. ๐
)
In any case, a null character is stored in the next location in the array.
Referenced by std::basic_istream< _CharT, _Traits >::getline().
๐ง <code>basic_istream<char> & std::basic_istream<char>::getline (char_type * __s, streamsize __n, char_type __delim) [inherited]</code> โ the special one
basic_istream< char > & std::basic_istream< char >::getline (char_type *
__s, streamsize __n, char_type __delim) [inherited]
Explicit specialization declarations, defined in src/istream.cc. That's the whole thing โ she's special-cased and shipped off to her own file. Main character. ๐
๐ <code>locale std::ios_base::getloc () const [inline], [inherited]</code> โ locale access
locale std::ios_base::getloc () const [inline], [inherited]
Returns โ a copy of the current locale.
If imbue(loc) has previously been called, then this function returns loc. Otherwise, it returns a copy of std::locale(), the global C++ locale. Easy. โจ
Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), std::money_put< _CharT, _OutIter >::do_put(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), and std::ws().
โญ <code>bool std::basic_ios<_CharT, _Traits>::good () const [inline], [inherited]</code> โ fast error checking
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
_Traits >::good () const [inline], [inherited]
Returns โ true if no error flags are set.
Literally just a wrapper around rdstate. Short, sweet, does the job. ๐ซถ
References std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and std::__detail::operator>>().
๐ <code>basic_istream<_CharT, _Traits> & std::basic_istream<_CharT, _Traits>::ignore (void) [inherited]</code> โ simple extraction
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::ignore (void) [inherited]
Returns โ a character, or eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof(). (The docs really said "copy paste? no, copy paste with confidence" ๐ญ)
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sbumpc().
๐ <code>basic_istream<_CharT, _Traits> & std::basic_istream<_CharT, _Traits>::ignore (streamsize __n) [inherited]</code> โ simple extraction, counting edition
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n)
[inherited]
Returns โ a character, or eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().
๐ <code>basic_istream<_CharT, _Traits> & std::basic_istream<_CharT, _Traits>::ignore (streamsize __n, int_type __delim) [inherited]</code>
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n,
int_type __delim) [inherited]
Discarding characters.
__nโ number of characters to discard ๐__delimโ a 'stop' character.
Returns: *this โจ
So what it does is extract characters and justโฆ throw them away ๐๏ธ until one of these happens:
- if
__n != std::numeric_limits<int>::max(),__ncharacters are extracted - the input sequence reaches end-of-file
- the next character equals
__delim(and in this case, the character is extracted โ it gets eaten too ๐); note that this condition will never occur if__delimequalstraits::eof()
NB: it provides three overloads instead of the single function (with defaults) that the Standard mandates โ this leads to a better performing implementation, while still conforming to the Standard ๐
template<typename _CharT , typename _Traits > locale std::basic_ios< _CharT, _Traits >::imbue (const locale & __loc) [inherited] โ moves to a new locale ๐
__locโ the new locale.
Returns: the previous locale.
It calls ios_base::imbue(loc), and if a stream buffer is associated with this stream, it calls that buffer's pubimbue(loc). no cap, it's thorough ๐ซถ
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
References std::ios_base::imbue().
Referenced by std::chrono::operator<<().
template<typename _CharT , typename _Traits > void std::basic_ios< _CharT, _Traits >::init (basic_streambuf< _CharT, _Traits > * __sb) [protected], [inherited] โ all the setup lives here ๐
This is called from the public constructor. It is not virtual and cannot be redefined. periodt.
Referenced by std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ios< _CharT, _Traits >::basic_ios(), std::basic_istream< _CharT, _Traits >::basic_istream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ostream< _CharT, _Traits >::basic_ostream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream(), std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream(), and std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream().
(likeโฆ every stream constructor ever, bestie. iconic behaviour honestly ๐ญ)
long & std::ios_base::iword (int __ix) [inline], [inherited] โ access to the integer array ๐ข
__ixโ index into the array.
Returns: a reference to an integer associated with the index.
The iword function provides access to an array of integers that can be used for any purpose. The array grows as required to hold the supplied index. All integers in the array are initialized to 0.
โ ๏ธ The implementation reserves several indices, so you should use xalloc to obtain an index that is safe to use. Also note that since the array can grow dynamically, it is not safe to hold onto the reference ๐ like, do not clutch that reference, it will betray you.
template<typename _CharT , typename _Traits > char std::basic_ios< _CharT, _Traits >::narrow (char_type __c, char __dfault) const [inline], [inherited] โ squeezes characters ๐ง
__cโ the character to narrow.__dfaultโ the character to narrow.
Returns: the narrowed character.
Maps a character of char_type to a character of char, if possible.
Returns the result of
std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
template<typename _CharT , typename _Traits > std::basic_ios< _CharT, _Traits >::operator bool () const [inline], [explicit], [inherited] โ the quick-and-easy status check โ
This lets you write constructs such as if (!a_stream) ... and while (a_stream) ...
References std::basic_ios< _CharT, _Traits >::fail().
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT, _Traits >::operator! () const [inline], [inherited] โ the quick-and-easy status check, but with a ! ๐จ
This lets you write constructs such as if (!a_stream) ... and while (a_stream) ...
References std::basic_ios< _CharT, _Traits >::fail().
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (__ios_type &(*)(__ios_type &) __pf) [inline], [inherited] โ interface for manipulators ๐๏ธ
Manipulators such as std::endl and std::hex use these functions in constructs like 'std::cout << std::endl'. For more information, see the iomanip header.
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (__ostream_type &(*)(__ostream_type &) __pf) [inline], [inherited] โ interface for manipulators, the sequel ๐๏ธโจ
Manipulators such as std::endl and std::hex use these functions in constructs like 'std::cout << std::endl'. For more information, see the iomanip header.
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (__streambuf_type * __sb) [inherited] โ extracting from another streambuf ๐ซ
__sbโ a pointer to a streambuf.
This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.
If__sbisNULL, the stream will setfailbitin its error state ๐
Characters are extracted from __sb and inserted into *this until one of the following occurs:
- the input stream reaches end-of-file,
- insertion into the output sequence fails (in this case, the character that would have been inserted is not extracted), or
- an exception occurs while getting a character from
__sb, which setsfailbitin the error state.
If the function inserts no characters, failbit is set.
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (bool __n) [inline], [inherited] โ integer arithmetic inserter ๐
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (const void * __p) [inline], [inherited] โ pointer arithmetic inserter ๐
__pโ a variable of pointer type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (double __f) [inline], [inherited] โ floating point arithmetic inserter ๐ฆ
__fโ a variable of builtin floating point type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (float __f) [inline], [inherited] โ floating point arithmetic inserter, the float edition ๐ธ
__fโ a variable of builtin floating point type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (int __n) [inherited] โ integer arithmetic inserter, int flavoured ๐ฅ
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (ios_base &(*)(ios_base &) __pf) [inline], [inherited] โ interface for manipulators, part three ๐๏ธ๐
Manipulators such as std::endl and std::hex use these functions in constructs like 'std::cout << std::endl'. For more information, see the iomanip header.
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long __n) [inline], [inherited] โ integer arithmetic inserter, long edition ๐
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long double __f) [inline], [inherited] โ floating point arithmetic inserter, long double edition โญ
__fโ a variable of builtin floating point type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long long __n) [inline], [inherited] โ integer arithmetic inserter, long long edition ๐ซ
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (short __n) [inherited] โ integer arithmetic inserter, short edition ๐
__nโ a variable of builtin integral type.
Returns: *this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
References std::ios_base::badbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned int __n) [inline], [inherited] โ integer arithmetic inserter, unsigned int edition ๐
__nโ a variable of builtin integral type.
Returns: *this if successful.
๐ operator<< โ unsigned long inserter
template<typename _CharT , typename _Traits > __ostream_type &
std::basic_ostream< _CharT, _Traits >::operator<< (unsigned long __n)
[inline], [inherited]
Integer arithmetic inserters, bestie. โจ
- Parameters
- _n โ a variable of builtin integral type.
- Returns โ
*thisif successful.
Lowkey these functions use the stream's current locale (specifically, the num_get facet) to do the numeric formatting. That's the whole vibe. ๐
๐ operator<< โ unsigned long long inserter
template<typename _CharT , typename _Traits > __ostream_type &
std::basic_ostream< _CharT, _Traits >::operator<< (unsigned long long __n)
[inline], [inherited]
Another integer arithmetic inserter, same energy, bigger number. ๐ฅ
- Parameters
- _n โ a variable of builtin integral type.
- Returns โ
*thisif successful.
And yeah โ these use the stream's current locale (specifically the num_get facet) to perform numeric formatting. No cap. ๐
๐ operator<< โ unsigned short inserter
template<typename _CharT , typename _Traits > __ostream_type &
std::basic_ostream< _CharT, _Traits >::operator<< (unsigned short __n)
[inline], [inherited]
Integer arithmetic inserters, the short king edition. ๐
- Parameters
- _n โ a variable of builtin integral type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting. Periodt. ๐ธ
๐ฆ operator>> โ manipulator via __ios_type &(*) (__ios_type &)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (__ios_type
&(*)(__ios_type &) __pf) [inline], [inherited]
This is the interface for manipulators. Like, manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more info, go look at the iomanip header. โจ
๐ฆ operator>> โ manipulator via __istream_type &(*) (__istream_type &)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (__istream_type
&(*)(__istream_type &) __pf) [inline], [inherited]
Same deal, the interface for manipulators. Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws, and for more information you should see the iomanip header. ๐
๐ operator>> โ extracting into another streambuf
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::operator>> (__streambuf_type
* __sb) [inherited]
Extracting into another streambuf โ it's giving relay race. ๐โโ๏ธ
- Parameters
- _sb โ a pointer to a
streambuf.
- _sb โ a pointer to a
This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.
If__sbisNULL, the stream will setfailbitin its error state. ๐จ
Characters are extracted from this stream and inserted into the __sb streambuf until one of these things happens:
- the input stream reaches end-of-file,
- insertion into the output buffer fails (and in this case, the character that would have been inserted is not extracted), or
- an exception occurs (and in this case it is caught).
If the function inserts no characters, failbit is set. ๐ญ
References std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ operator>> โ bool & extractor
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (bool & __n) [inline],
[inherited]
Integer arithmetic extractors, the reading-in version. ๐
- Parameters
- _n โ a variable of builtin integral type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. ๐
๐ operator>> โ double & extractor
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (double & __f) [inline],
[inherited]
Floating point arithmetic extractors! ๐ฆ
- Parameters
- _f โ a variable of builtin floating point type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. Slay. โจ
๐ operator>> โ float & extractor
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (float & __f) [inline],
[inherited]
Floating point arithmetic extractors, float-sized. ๐ธ
- Parameters
- _f โ a variable of builtin floating point type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. Ngl, that facet is carrying the whole team. ๐
๐ง operator>> โ int & extractor
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::operator>> (int & __n)
[inherited]
Integer arithmetic extractors. ๐
- Parameters
- _n โ a variable of builtin integral type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. ๐
๐ง operator>> โ manipulator via ios_base &(*) (ios_base &)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (ios_base
&(*)(ios_base &) __pf) [inline], [inherited]
Interface for manipulators โ yes, again, iconic behaviour. Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header. โญ
๐ง operator>> โ long & extractor
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long & __n) [inline],
[inherited]
Integer arithmetic extractors, long edition. ๐
- Parameters
- _n โ a variable of builtin integral type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. ๐ซถ
๐ง operator>> โ long double & extractor
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long double & __f)
[inline], [inherited]
Floating point arithmetic extractors, extra precision energy. ๐ฅ
- Parameters
- _f โ a variable of builtin floating point type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. ๐
๐ง operator>> โ long long & extractor
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long long & __n)
[inline], [inherited]
Integer arithmetic extractors โ long long, so you know it's serious. ๐
- Parameters
- _n โ a variable of builtin integral type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. ๐
๐ operator>> โ short & extractor
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::operator>> (short & __n)
[inherited]
Integer arithmetic extractors, short and sweet. ๐
- Parameters
- _n โ a variable of builtin integral type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
References std::ios_base::badbit, std::ios_base::failbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate(). ๐จ
๐ operator>> โ unsigned int & extractor
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned int & __n)
[inline], [inherited]
Integer arithmetic extractors. ๐
- Parameters
- _n โ a variable of builtin integral type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. โจ
๐ operator>> โ unsigned long & extractor
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned long & __n)
[inline], [inherited]
Integer arithmetic extractors. ๐
- Parameters
- _n โ a variable of builtin integral type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. ๐ธ
๐ operator>> โ unsigned long long & extractor
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned long long &
__n) [inline], [inherited]
Integer arithmetic extractors, the biggest unsigned vibe. ๐
- Parameters
- _n โ a variable of builtin integral type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. ๐ฆ
๐ operator>> โ unsigned short & extractor
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned short & __n)
[inline], [inherited]
Integer arithmetic extractors. ๐ง
- Parameters
- _n โ a variable of builtin integral type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. ๐
โญ operator>> โ void *& extractor
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (void *& __p) [inline],
[inherited]
Basic arithmetic extractors โ pointer flavour. ๐ซถ
- Parameters
- _p โ a variable of pointer type.
- Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. ๐
๐ peek โ looking ahead in the stream
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
>::int_type std::basic_istream< _CharT, _Traits >::peek (void) [inherited]
Looking ahead in the stream, like subtly checking the group chat before you reply. ๐
- Returns โ the next character, or
eof().
If, after constructing the sentry object, good() is false, it returns traits::eof(). Otherwise it reads but does not extract the next input character. Yes โ looks but doesn't touch. โจ
References std::basic_istream< _CharT, _Traits >::_M_gcount.
๐๏ธ precision() โ flags access (read it)
streamsize std::ios_base::precision () const [inline], [inherited]
Flags access. ๐
- Returns โ the precision to generate on certain output operations.
Be careful if you try to give a definition of precision here; see DR 189. ๐ญ
Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), and std::chrono::operator<<().
๐๏ธ precision() โ changing flags (set it)
streamsize std::ios_base::precision (streamsize __prec) [inline],
[inherited]
Changing flags. ๐ง
- Parameters
- _prec โ the new precision value.
- Returns โ the previous value of
precision(). So you get the receipts, cute. ๐
โ๏ธ put โ simple insertion
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> & std::basic_ostream< _CharT, _Traits >::put (char_type __c) [inherited]
Simple insertion, main character energy. ๐
- Parameters
- _c โ the character to insert.
- Returns โ
*this
It tries to insert __c.
Note: this function is not overloaded onsigned charandunsigned char. So don't come for it. ๐
References std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by std::endl(), and std::ends(). ๐
โฉ๏ธ putback โ unextracting a single character
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::putback (char_type __c)
[inherited]
Unextracting a single character โ literally the undo button of streams. ๐ญ
- Parameters
- _c โ the character to push back into the input stream.
- Returns โ
*this
If rdbuf() is not null, it calls rdbuf()->sputbackc(c). โจ
If rdbuf() is null, or if sputbackc() fails, it sets badbit in the error state.
Note ๐ซถ โ this function first 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::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_streambuf< _CharT, _Traits >::sputbackc().
Referenced by std::operator<<().
๐ void *& std::ios_base::pword (int __ix) [inline], [inherited]
Okay so this one is literally your all-access pass to the void pointer array ๐ โ access to void pointer array, that's the whole vibe.
Parameters
__ixโ Index into the array.
Returns
A reference to a void* associated with the index.
The pword function provides access to an array of pointers that can be used for any purpose. The array grows as required to hold the supplied index. All pointers in the array are initialized to 0.
The implementation reserves several indices. You should use xalloc to obtain an index that is safe to use. Also note that since the array can grow dynamically, it is not safe to hold onto the reference ๐ญ โ like, bestie, grab the value and let the reference go, fr fr.
๐ฆ template<typename _CharT , typename _Traits , typename _Alloc > __stringbuf_type * std::basic_stringstream< _CharT, _Traits, _Alloc >::rdbuf () const [inline]
Accessing the underlying buffer. The main character returns ๐
Returns
The current basic_stringbuf buffer.
Heads up ๐ โ this hides both signatures of std::basic_ios::rdbuf().
๐ธ template<typename _CharT , typename _Traits > basic_streambuf< _CharT, _Traits > * std::basic_ios< _CharT, _Traits >::rdbuf (basic_streambuf< _CharT, _Traits > * __sb) [inherited]
Changing the underlying buffer โ glow-up edition ๐
Parameters
__sbโ The new stream buffer.
Returns
The previous stream buffer.
Associates a new buffer with the current stream, and clears the error state.
So here's the drama ๐ โ due to historical accidents which the LWG refuses to correct, the I/O library suffers from a design error: this function is hidden in derived classes by overrides of the zero-argument rdbuf(), which is non-virtual for hysterical raisins. As a result, you must use explicit qualifications to access this function via any derived class. For example:
std::fstream foo; // or some other derived type
std::streambuf* p = .....;
foo.ios::rdbuf(p); // ios == basic_ios<char>
Like, that's not a suggestion, that's the whole requirement ๐ค
โญ template<typename _CharT , typename _Traits > iostate std::basic_ios< _CharT, _Traits >::rdstate () const [inline], [inherited]
Returns the error state of the stream buffer. The vibe check of the whole stream, honestly ๐
Returns
A bit pattern (well, isn't everything?)
See std::ios_base::iostate for the possible bit values. Most users will call one of the interpreting wrappers, e.g., good().
Referenced by std::basic_ios< _CharT, _Traits >::bad(), std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::fail(), std::basic_ios< _CharT, _Traits >::good(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_istream< _CharT, _Traits >::unget().
๐ฅ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::read (char_type * __s, streamsize __n) [inherited]
Extraction without delimiters. No separators, no chill, just raw characters ๐คโจ
Parameters
__sโ A character array.__nโ Maximum number of characters to store.
Returns
*this
If the stream state is good(), extracts characters and stores them into __s until one of the following happens:
__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.
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ง template<typename _CharT , typename _Traits > streamsize std::basic_istream< _CharT, _Traits >::readsome (char_type * __s, streamsize __n) [inherited]
Extraction until the buffer is exhausted, but no more. It's giving "take what's on the plate, don't ask the kitchen for extra" ๐
Parameters
__sโ A character array.__nโ Maximum number of characters to store.
Returns
The number of characters extracted.
Extracts characters and stores them into __s depending on the number of characters remaining in the streambuf's buffer, rdbuf()->in_avail(), called A here:
- if
A == -1, 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. Very "clean up your own room" energy ๐
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::min(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ void std::ios_base::register_callback (event_callback __fn, int __index) [inherited]
Add the callback __fn with parameter __index. Like adding someone to the group chat, but for events ๐
Parameters
__fnโ The function to add.__indexโ The integer to pass to the function when invoked.
Registers a function as an event callback with an integer parameter to be passed to the function when invoked. Multiple copies of the function are allowed. If there are multiple callbacks, they are invoked in the order they were registered. First come, first served, no cutting the line ๐ โโ๏ธ
๐ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::seekg (off_type __off, ios_base::seekdir __dir) [inherited]
Changing the current read position. Cue the map app voice ๐บ๏ธโจ
Parameters
__offโ A file offset object.__dirโ The direction in which to seek.
Returns
*this
If fail() is not true, calls rdbuf()->pubseekoff(__off,__dir). If that function fails, sets failbit.
Note ๐ซถ โ this function first clearseofbit. It does not count the number of characters extracted, if any, and therefore does not affect the next call togcount().
References: std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::seekg (pos_type __pos) [inherited]
Changing the current read position โ the absolute-coordinates version ๐ฆ
Parameters
__posโ A file position object.
Returns
*this
If fail() is not true, calls rdbuf()->pubseekpos(__pos). If that function fails, sets failbit.
Note ๐ซถ โ this function first clearseofbit. It does not count the number of characters extracted, if any, and therefore does not affect the next call togcount().
References: std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::seekp (off_type __off, ios_base::seekdir __dir) [inherited]
Changing the current write position โ the output side finally gets a turn ๐
Parameters
__offโ A file offset object.__dirโ The direction in which to seek.
Returns
*this
If fail() is not true, calls rdbuf()->pubseekoff(off,dir). If that function fails, sets failbit.
References: std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::out, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::seekp (pos_type __pos) [inherited]
Changing the current write position โ exact address only, no directions needed โญ
Parameters
__posโ A file position object.
Returns
*this
If fail() is not true, calls rdbuf()->pubseekpos(pos). If that function fails, sets failbit.
References: std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::out, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ผ fmtflags std::ios_base::setf (fmtflags __fmtfl) [inline], [inherited]
Setting new format flags. Putting on accessories, but for your stream ๐โจ
Parameters
__fmtflโ Additional flags to set.
Returns
The previous format control flags.
This function sets additional flags in format control. Flags that were previously set remain set. Nothing gets removed, everything just gets added, love that for us ๐
Referenced by std::__detail::operator>>().
๐ซ fmtflags std::ios_base::setf (fmtflags __fmtfl, fmtflags __mask) [inline], [inherited]
Setting new format flags, but make it surgical ๐
Parameters
__fmtflโ Additional flags to set.__maskโ The flags mask forfmtfl.
Returns
The previous format control flags.
This function clears mask in the format flags, then sets fmtfl & mask. An example mask is ios_base::adjustfield.
๐ template<typename _CharT , typename _Traits > void std::basic_ios< _CharT, _Traits >::setstate (iostate __state) [inline], [inherited]
Sets additional flags in the error state. Adding to the situation, not replacing it ๐ซถ
Parameters
__stateโ The additional state flag(s) to set.
See std::ios_base::iostate for the possible bit values.
References: std::basic_ios< _CharT, _Traits >::clear(), and std::basic_ios< _CharT, _Traits >::rdstate().
And the Referenced by list for that one is literally the whole group chat โ every single one, no cuts:
std::basic_istream< _CharT, _Traits >::sentry::sentry()std::basic_ostream< _CharT, _Traits >::sentry::sentry()std::basic_ostream< _CharT, _Traits >::sentry::~sentry()std::basic_ifstream< _CharT, _Traits >::close()std::basic_ofstream< _CharT, _Traits >::close()std::basic_fstream< _CharT, _Traits >::close()std::basic_ostream< _CharT, _Traits >::flush()std::basic_istream< _CharT, _Traits >::get()std::basic_istream< _CharT, _Traits >::get()std::getline()std::getline()std::basic_ifstream< _CharT, _Traits >::open()std::basic_fstream< _CharT, _Traits >::open()std::basic_ofstream< _CharT, _Traits >::open()std::basic_ifstream< _CharT, _Traits >::open()std::basic_fstream< _CharT, _Traits >::open()std::basic_ofstream< _CharT, _Traits >::open()std::operator<<()std::basic_ostream< _CharT, _Traits >::operator<<()std::operator<<()std::basic_istream< _CharT, _Traits >::operator>>()std::operator>>()std::operator>>()std::operator>>()std::basic_istream< _CharT, _Traits >::operator>>()std::tr2::operator>>()std::basic_ostream< _CharT, _Traits >::put()std::basic_istream< _CharT, _Traits >::putback()std::basic_istream< _CharT, _Traits >::read()std::basic_istream< _CharT, _Traits >::readsome()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::seekg()std::basic_ostream< _CharT, _Traits >::seekp()std::basic_ostream< _CharT, _Traits >::seekp()std::basic_istream< _CharT, _Traits >::sync()std::ws()
๐ค str () const โ copying out the string buffer
template<typename _CharT , typename _Traits , typename _Alloc >
__string_type std::basic_stringstream< _CharT, _Traits, _Alloc >::str () const [inline]
Bestie, this is the โgimme the bufferโ moment. Itโs copying out the string buffer.
Returns: rdbuf()->str()
๐ฅ str (const __string_type & __s) โ setting a new buffer
template<typename _CharT , typename _Traits , typename _Alloc > void
std::basic_stringstream< _CharT, _Traits, _Alloc >::str (const
__string_type & __s) [inline]
This one is the โnew buffer just droppedโ energy. Itโs setting a new buffer.
Parameters:
__sโ the string to use as a new sequence.
Calls rdbuf()->str(s).
๐ sync (void) โ synchronizing the stream buffer
template<typename _CharT , typename _Traits > int std::basic_istream<
_CharT, _Traits >::sync (void) [inherited]
Okay so this is the synchronizing the stream buffer situation.
Returns: 0 on success, -1 on failure.
If rdbuf() is a null pointer, returns -1.
Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit and returns -1.
Otherwise, returns 0.
Note: This function does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount().
References: std::ios_base::badbit, std::ios_base::goodbit, std::basic_streambuf< _CharT, _Traits >::pubsync(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ sync_with_stdio โ standard C I/O, but make it C++
static bool std::ios_base::sync_with_stdio (bool __sync = true) [static],
[inherited]
Interaction with the standard C I/O objects โ yes, the classic crossover episode.
Parameters:
__syncโ whether to synchronize or not.
Returns: True if the standard streams were previously synchronized.
The synchronization referred to is only that between the standard C facilities (e.g., stdout) and the standard C++ objects (e.g., cout). User-declared streams are unaffected. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary
๐ tellg (void) โ getting the current read position
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
>::pos_type std::basic_istream< _CharT, _Traits >::tellg (void)
[inherited]
This is the getting the current read position vibe.
Returns: a file position object.
If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,in).
Note: This function does not count the number of characters extracted, if any, and therefore does not affect the next call 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]
Same energy, but for writing: getting the current write position.
Returns: a file position object.
If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,out).
References: std::ios_base::cur, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::out, and std::basic_ios< _CharT, _Traits >::rdbuf().
๐ tie () const โ fetching the current tied stream
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> * std::basic_ios< _CharT, _Traits >::tie () const [inline],
[inherited]
Fetches the current tied stream โ like checking who your stream is linked to in the group chat.
Returns: a pointer to the tied stream, or NULL if the stream is not tied.
A stream may be tied (or synchronized) to a second output stream. When this stream performs any I/O, the tied stream is first flushed. For example, std::cin is tied to std::cout.
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and std::basic_ios< _CharT, _Traits >::copyfmt().
๐ชข tie (basic_ostream< _CharT, _Traits > * __tiestr) โ tying to an output stream
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> * std::basic_ios< _CharT, _Traits >::tie (basic_ostream< _CharT,
_Traits > * __tiestr) [inline], [inherited]
Ties this stream to an output stream. New link unlocked.
Parameters:
__tiestrโ the output stream.
Returns: the previously tied output stream, or NULL if the stream was not tied.
This sets up a new tie; see tie() for more.
โฉ๏ธ unget (void) โ unextracting the previous character
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::unget (void) [inherited]
The unextracting the previous character move. Putting it back, bestie.
Returns: *this
If rdbuf() is not null, calls rdbuf()->sungetc(c).
If rdbuf() is null or if sungetc() fails, sets badbit in the error state.
Note: This function first 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]
Clearing format flags. Wiping the mask, not the whole personality.
Parameters:
__maskโ the flags to unset.
This function clears __mask in the format flags.
๐ง widen (char __c) const โ widens characters
template<typename _CharT , typename _Traits > char_type std::basic_ios<
_CharT, _Traits >::widen (char __c) const [inline], [inherited]
Widens characters โ glow-up for a single char.
Parameters:
__cโ the character to widen.
Returns: the widened character.
Maps a character of char to a character of char_type.
Returns the result of
std::use_facet<ctype<char_type> >(getloc()).widen(c)
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
Referenced by std::endl(), std::basic_ios< _CharT, _Traits >::fill(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::getline(), std::getline(), std::basic_istream< _CharT, _Traits >::getline(), std::operator<<(), std::operator<<(), and std::tr2::operator>>().
๐ width () const โ flags access
streamsize std::ios_base::width () const [inline], [inherited]
Flags access, but make it width.
Returns: the minimum field width to generate on output operations.
Minimum field width refers to the number of characters.
Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_put< _CharT, _OutIter >::do_put(), std::operator>>(), and std::operator>>().
๐ width (streamsize __wide) โ changing flags
streamsize std::ios_base::width (streamsize __wide) [inline], [inherited]
Changing flags โ new width, who dis?
Parameters:
__wideโ the new width value.
Returns: the previous value of width().
โ๏ธ write (const char_type * __s, streamsize __n) โ character string insertion
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> & std::basic_ostream< _CharT, _Traits >::write (const char_type * __s,
streamsize __n) [inherited]
<orange>Character string insertion</orange> โ writing a whole chunk, not just one little char.
Parameters:
__sโ the array to insert.__nโ maximum number of characters to insert.
Returns: *this
Characters are copied from __s and inserted into the stream until one of the following happens:
__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]
Access to unique indices โ the โeveryone gets their own lockerโ function.
Returns: an integer different from all previous calls.
This function returns a unique integer every time it is called. It can be used for any purpose, but is primarily intended to be a unique index for the iword and pword functions. The expectation is that an application calls xalloc in order to obtain an index in the iword and pword arrays that can be used without fear of conflict.
The implementation maintains a static variable that is incremented and returned on each invocation. xalloc is guaranteed to return an index that is safe to use in the iword and pword arrays.
๐พ Member Data Documentation ๐พ
๐งฎ _M_gcount โ the extraction counter
template<typename _CharT , typename _Traits > streamsize std::basic_istream<
_CharT, _Traits >::_M_gcount [protected], [inherited]
The number of characters extracted in the previous unformatted function; see gcount().
Referenced by std::basic_istream< _CharT, _Traits >::~basic_istream(), std::basic_istream< _CharT, _Traits >::gcount(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< char >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< char >::operator>>(), std::basic_istream< _CharT, _Traits >::peek(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< char >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< char >::readsome(), std::basic_istream< char >::sync(), and std::basic_istream< _CharT, _Traits >::unget().
๐งฉ adjustfield โ the alignment mask
const fmtflags std::ios_base::adjustfield [static], [inherited]
A mask of left|right|internal. Useful for the 2-arg form of setf.
Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::internal(), std::left(), and std::right().
๐ app โ append mode
const openmode std::ios_base::app [static], [inherited]
Seek to end before each write.
(picking up the reference list from the entry right above โ no cap, we're mid-sentence ๐ )
โฆand she's also referenced by std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), std::basic_filebuf< _CharT, _Traits >::overflow(), and std::basic_filebuf< _CharT, _Traits >::xsputn().
๐ const openmode std::ios_base::ate [static], [inherited]
Opens the thing and then immediately seeks to the end. Like walking into a party and heading straight to the back of the room. Obsessed.
Referenced by std::basic_filebuf< _CharT, _Traits >::open().
๐ญ const iostate std::ios_base::badbit [static], [inherited]
The drama queen of the iostate family. This one literally means a loss of integrity in an input or output sequence โ think irrecoverable read error from a file. It's giving "we're so done." When badbit shows up, bestie, it is not a vibe.
Referenced by:
std::basic_istream< _CharT, _Traits >::sentry::sentry()std::basic_ostream< _CharT, _Traits >::sentry::~sentry()std::basic_ios< _CharT, _Traits >::bad()std::basic_ios< _CharT, _Traits >::fail()std::basic_ostream< _CharT, _Traits >::flush()std::basic_istream< _CharT, _Traits >::get()std::basic_istream< char >::get()std::basic_istream< _CharT, _Traits >::get()std::basic_ostream< _CharT, _Traits >::operator<<()std::operator>>()std::basic_istream< _CharT, _Traits >::operator>>()std::basic_ostream< _CharT, _Traits >::put()std::basic_istream< _CharT, _Traits >::putback()std::basic_istream< _CharT, _Traits >::read()std::basic_istream< _CharT, _Traits >::readsome()std::basic_istream< char >::seekg()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::sync()std::basic_istream< char >::tellg()std::basic_istream< _CharT, _Traits >::tellg()std::ws()
๐ const fmtflags std::ios_base::basefield [static], [inherited]
A mask of dec|oct|hex. Super handy for the 2-arg form of setf. That's it, that's the whole personality.
Referenced by std::dec(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), std::hex(), and std::oct().
โญ const seekdir std::ios_base::beg [static], [inherited]
Requests a seek relative to the beginning of the stream. Main character position: the start. ๐ซถ
Referenced by std::basic_filebuf< _CharT, _Traits >::seekpos().
๐ฆ const openmode std::ios_base::binary [static], [inherited]
Performs input and output in binary mode โ as opposed to text mode. And listen, this is probably not what you think it is; the docs literally say so. Go read https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary before you @ me. ๐
Referenced by std::basic_filebuf< _CharT, _Traits >::showmanyc().
๐ธ const fmtflags std::ios_base::boolalpha [static], [inherited]
Inserts/extracts bool in alphabetic rather than numeric format. So true/false instead of 1/0. Slay, honestly.
Referenced by std::boolalpha(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), and std::noboolalpha().
๐
const seekdir std::ios_base::cur [static], [inherited]
Requests a seek relative to the current position within the sequence. Right here, right now, no cap.
Referenced by:
std::basic_filebuf< _CharT, _Traits >::imbue()std::basic_filebuf< _CharT, _Traits >::overflow()std::basic_filebuf< _CharT, _Traits >::pbackfail()std::basic_filebuf< _CharT, _Traits >::seekoff()std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff()std::basic_istream< _CharT, _Traits >::tellg()std::basic_ostream< _CharT, _Traits >::tellp()
๐ฅ const fmtflags std::ios_base::dec [static], [inherited]
Converts integer input, or generates integer output, in base ten. The normal one. The default one. The one everyone forgets to appreciate. ๐ฅฒ
Referenced by std::dec().
๐ const seekdir std::ios_base::end [static], [inherited]
Requests a seek relative to the current end of the sequence. The finale, the curtain call, the last slide of the presentation.
Referenced by std::basic_filebuf< _CharT, _Traits >::open(), and std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff().
๐ const iostate std::ios_base::eofbit [static], [inherited]
Means an input operation reached the end of an input sequence. Yes bestie, EOF is a whole state flag and she has a huge friend group. Buckle up:
std::basic_istream< _CharT, _Traits >::sentry::sentry()std::time_get< _CharT, _InIter >::do_get()std::num_get< _CharT, _InIter >::do_get()std::num_get< _CharT, _InIter >::do_get()std::num_get< _CharT, _InIter >::do_get()std::num_get< _CharT, _InIter >::do_get()std::time_get< _CharT, _InIter >::do_get_date()std::time_get< _CharT, _InIter >::do_get_monthname()std::time_get< _CharT, _InIter >::do_get_time()std::time_get< _CharT, _InIter >::do_get_weekday()std::time_get< _CharT, _InIter >::do_get_year()std::basic_ios< _CharT, _Traits >::eof()std::basic_istream< _CharT, _Traits >::get()std::basic_istream< _CharT, _Traits >::get()std::basic_istream< char >::get()std::time_get< _CharT, _InIter >::get()std::basic_istream< _CharT, _Traits >::ignore()std::basic_istream< _CharT, _Traits >::operator>>()std::operator>>()std::basic_istream< _CharT, _Traits >::putback()std::basic_istream< _CharT, _Traits >::read()std::basic_istream< _CharT, _Traits >::readsome()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< char >::sync()std::basic_istream< _CharT, _Traits >::unget()std::ws()
๐ const iostate std::ios_base::failbit [static], [inherited]
The "you had ONE job" flag. It means an input operation failed to read the expected characters, or an output operation failed to generate the desired characters. Not the end of the world (that's badbit), but definitely a moment. ๐ญ
Referenced by:
std::basic_istream< _CharT, _Traits >::sentry::sentry()std::basic_ostream< _CharT, _Traits >::sentry::sentry()std::basic_ifstream< _CharT, _Traits >::close()std::basic_ofstream< _CharT, _Traits >::close()std::basic_fstream< _CharT, _Traits >::close()std::num_get< _CharT, _InIter >::do_get()std::time_get< _CharT, _InIter >::do_get_monthname()std::time_get< _CharT, _InIter >::do_get_weekday()std::time_get< _CharT, _InIter >::do_get_year()std::basic_ios< _CharT, _Traits >::fail()std::basic_istream< _CharT, _Traits >::get()std::basic_istream< _CharT, _Traits >::get()std::basic_istream< char >::get()std::time_get< _CharT, _InIter >::get()std::basic_ifstream< _CharT, _Traits >::open()std::basic_fstream< _CharT, _Traits >::open()std::basic_ofstream< _CharT, _Traits >::open()std::basic_ifstream< _CharT, _Traits >::open()std::basic_fstream< _CharT, _Traits >::open()std::basic_ofstream< _CharT, _Traits >::open()std::operator<<()std::basic_istream< _CharT, _Traits >::operator>>()std::operator>>()std::basic_istream< _CharT, _Traits >::operator>>()std::basic_istream< _CharT, _Traits >::read()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::seekg()std::basic_ostream< _CharT, _Traits >::seekp()std::basic_ostream< _CharT, _Traits >::seekp()
๐ const fmtflags std::ios_base::fixed [static], [inherited]
Generates floating-point output in fixed-point notation. Like 3.140000 instead of 3.14e+00. She's precise, she's committed, she's showing all her digits. โจ
Referenced by std::fixed(), and std::hexfloat().
๐ง const fmtflags std::ios_base::floatfield [static], [inherited]
A mask of scientific|fixed. Useful for the 2-arg form of setf. The picker-outer for how your floats get dressed. ๐
Referenced by std::defaultfloat(), std::fixed(), std::hexfloat(), and std::scientific().
๐ const iostate std::ios_base::goodbit [static], [inherited]
Indicates all is well. ๐ The "no thoughts, head empty, everything's fine" flag. She's referenced everywhere because everyone wants to get back to her:
std::basic_istream< _CharT, _Traits >::sentry::sentry()std::time_get< _CharT, _InIter >::do_get()std::num_get< _CharT, _InIter >::do_get()std::time_get< _CharT, _InIter >::do_get_monthname()std::time_get< _CharT, _InIter >::do_get_weekday()std::time_get< _CharT, _InIter >::do_get_year()std::basic_ostream< _CharT, _Traits >::flush()std::basic_istream< _CharT, _Traits >::get()std::basic_istream< _CharT, _Traits >::get()std::basic_istream< _CharT, _Traits >::get()std::basic_istream< char >::get()std::basic_istream< _CharT, _Traits >::get()std::time_get< _CharT, _InIter >::get()std::basic_istream< _CharT, _Traits >::ignore()std::basic_istream< _CharT, _Traits >::ignore()std::basic_ostream< _CharT, _Traits >::operator<<()std::basic_istream< _CharT, _Traits >::operator>>()std::operator>>()std::basic_istream< _CharT, _Traits >::operator>>()std::basic_ostream< _CharT, _Traits >::put()std::basic_istream< _CharT, _Traits >::putback()std::basic_istream< _CharT, _Traits >::read()std::basic_istream< _CharT, _Traits >::readsome()std::basic_istream< char >::readsome()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::sync()std::basic_istream< _CharT, _Traits >::unget()std::ws()
๐ธ const fmtflags std::ios_base::hex [static], [inherited]
Converts integer input, or generates integer output, in hexadecimal base. Base 16 bestie, 0x girlies rise. ๐ฅ
Referenced by std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), and std::hex().
๐ const openmode std::ios_base::in [static], [inherited]
Open for input. This is the default for ifstream and fstream. The reading era. ๐
Referenced by:
std::basic_filebuf< _CharT, _Traits >::_M_set_buffer()std::basic_ifstream< _CharT, _Traits >::open()std::basic_ifstream< _CharT, _Traits >::open()std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow()std::basic_filebuf< _CharT, _Traits >::pbackfail()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::seekg()std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff()std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos()std::basic_filebuf< _CharT, _Traits >::showmanyc()std::basic_stringbuf< _CharT, _Traits, _Alloc >::showmanyc()std::basic_istream< _CharT, _Traits >::tellg()std::basic_filebuf< _CharT, _Traits >::underflow()std::basic_stringbuf< _CharT, _Traits, _Alloc >::underflow()std::basic_filebuf< _CharT, _Traits >::xsgetn()
โญ const fmtflags std::ios_base::internal [static], [inherited]
Adds fill characters at a designated internal point in certain generated output โ or it's identical to right if no such point is designated. The "put the padding in the middle, she's quirky" option. ๐
Referenced by std::internal().
๐ฆ const fmtflags std::ios_base::left [static], [inherited]
Adds fill characters on the right (final positions) of certain generated output. I.e., the thing you print is flush left. Left-aligned and thriving. ๐
Referenced by std::num_put< _CharT, _OutIter >::do_put(), and std::left().
๐ const fmtflags std::ios_base::oct [static], [inherited]
Converts integer input, or generates integer output, in octal base. Base 8! Rare, mysterious, kind of iconic ngl. ๐
Referenced by std::oct().
๐ซถ const openmode std::ios_base::out [static], [inherited]
Open for output. This is the default for ofstream and fstream. The writing era. โ๏ธ
Referenced by:
std::basic_filebuf< _CharT, _Traits >::_M_set_buffer()std::basic_ofstream< _CharT, _Traits >::open()std::basic_ofstream< _CharT, _Traits >::open()std::basic_filebuf< _CharT, _Traits >::overflow()std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow()std::basic_stringbuf< _CharT, _Traits, _Alloc >::pbackfail()std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff()std::basic_ostream< _CharT, _Traits >::seekp()std::basic_ostream< _CharT, _Traits >::seekp()std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos()std::basic_ostream< _CharT, _Traits >::tellp()std::basic_filebuf< _CharT, _Traits >::xsputn()const fmtflags std::ios_base::right[static],[inherited]โ bestie this one pads with fill characters on the left (the initial positions) of certain generated output. Translation? The thing you print gets flushed all the way to the right. iconic alignment behavior ngl ๐
Referenced by std::right().
const fmtflags std::ios_base::scientific[static],[inherited]โ generates floating-point output in scientific notation. science slay ๐ฌโจ
Referenced by std::hexfloat(), and std::scientific().
const fmtflags std::ios_base::showbase[static],[inherited]โ generates a prefix that indicates the numeric base of the generated integer output. basically it tells you what base you're looking at, no cap ๐งฎ
Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::noshowbase(), and std::showbase().
const fmtflags std::ios_base::showpoint[static],[inherited]โ generates a decimal-point character unconditionally in generated floating-point output. yes girl show that point, even when you didn't have to ๐
Referenced by std::noshowpoint(), and std::showpoint().
const fmtflags std::ios_base::showpos[static],[inherited]โ generates a+sign in non-negative generated numeric output. positivity era fr fr โ๐
Referenced by std::noshowpos(), and std::showpos().
const fmtflags std::ios_base::skipws[static],[inherited]โ skips leading white space before certain input operations. it's giving "read the room, ignore the empty space" โจ
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::noskipws(), std::__detail::operator>>(), and std::skipws().
const openmode std::ios_base::trunc[static],[inherited]โ truncates an existing stream when opening. and heads up bestie: it's the default forofstream, so likeโฆ it will absolutely wipe your file, that's the whole vibe ๐ญ๐const fmtflags std::ios_base::unitbuf[static],[inherited]โ flushes output after each output operation. no batching, no waiting, immediate main character energy ๐ซถ
Referenced by std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::nounitbuf(), and std::unitbuf().
const fmtflags std::ios_base::uppercase[static],[inherited]โ replaces certain lowercase letters with their uppercase equivalents in generated output. LOUDER. ๐ฃ๐
Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::nouppercase(), and std::uppercase().
๐ธ Author ๐ธ
Generated automatically by Doxygen for libstdc++ from the source code. not a human, not a friend, just Doxygen doing its little robot thing ๐คโจ
okay that's the whole page bestie, we literally made it to the end ๐๐ฆ the footer moment: this page is the std::basic_stri...raits, _Alloc >(3cxx) one (yes the title got cutely truncated, iykyk), coming at you from libstdc++, and the date lives down there in that footer line too โ go peek at it in the source if you need the exact stamp ๐ periodt, go write some streams ๐ซถ๐
๐ฆ where this page comes from
- 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