STD::STRINGSTREAM(3)
π std::basic_stringstream< _CharT, _Traits, _Alloc > π
okay bestie, real talk β this page lives in the Library Functions Manual (section 3, the C++ library shelf), and the main character today is std::basic_stringstream< _CharT, _Traits, _Alloc >. yes, the whole name. she's long, she's iconic, she contains multitudes. π
β¨ NAME β¨
std::basic_stringstream< _CharT, _Traits, _Alloc > β controlling input and output for std::string. that's it, that's the whole job description, and she ate. π
π¦ SYNOPSIS π¦
#include <sstream>
Inherits std::basic_iostream< _CharT, _Traits >. so yeah, she's a whole iostream girlie, with a string buffer underneath. no cap. β¨
πΈ Public Types πΈ
here's the whole entourage, all the typedefs she brings to the function:
typedef ctype< _CharT > __ctype_typetypedef ctype< _CharT > __ctype_typeβ yes bestie, she's listed twice. the original said it twice, so we say it twice. iconic of her honestly πtypedef basic_ios< _CharT, _Traits > __ios_typetypedef basic_ios< _CharT, _Traits > __ios_typeβ also doubled. she's just like that. π«Άtypedef 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β twice again. we love a consistent queen. πtypedef 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. little event girlies, all dressed up for the callback party πtypedef void(* event_callback) (event __e, ios_base &__b, int __i)β the type of an event callback function. that's the shape of the function you hand over. πtypedef _Ios_Fmtflags fmtflagsβ heads up: this is a bitmask type. so it's flags-you-can-mash-together, not just one lonely flag. π₯typedef traits_type::int_type int_typetypedef _Ios_Iostate iostateβ also a bitmask type, bestie. flags again. β¨typedef traits_type::off_type off_typetypedef _Ios_Openmode openmodeβ yep, bitmask type. she's a flags girl through and through. πtypedef traits_type::pos_type pos_typetypedef _Ios_Seekdir seekdirβ this one's an enumerated type, not a bitmask. different energy entirely. πtypedef _Traits traits_type
π Public Member Functions π
okay this is the big one, the whole roster, and she has range:
basic_stringstream ()β the default constructor. starts you off with an empty string buffer, a blank canvas, main character energy from day one. πbasic_stringstream (__string_type &&__str, ios_base::openmode __mode=ios_base::in|ios_base::out)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. you come with baggage, and she welcomes it. πtemplate<typename _SAlloc> basic_stringstream (const basic_string< _CharT, _Traits, _SAlloc > &__str, const allocator_type &__a)template<typename _SAlloc> basic_stringstream (const basic_string< _CharT, _Traits, _SAlloc > &__str, ios_base::openmode __mode, const allocator_type &__a)template<typename _SAlloc> basic_stringstream (const basic_string< _CharT, _Traits, _SAlloc > &__str, ios_base::openmode __mode=ios_base::in|ios_base::out)basic_stringstream (const basic_stringstream &)=deleteβ nope, copy constructor is deleted. she does not do copies. πbasic_stringstream (ios_base::openmode __m)β starts with an empty string buffer. again, blank canvas. π¦basic_stringstream (ios_base::openmode __mode, const allocator_type &__a)~basic_stringstream ()β the destructor does nothing. literally nothing. she leaves without drama. π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. bracket-and-all, that's how the original says it. π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. same deal, different direction.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. go big. π₯__ostream_type & flush ()β synchronizing the stream buffer.streamsize gcount () constβ character counting.basic_istream< wchar_t > & getline (char_type *__s, streamsize __n, char_type __delim)basic_istream< char > & getline (char_type *__s, streamsize __n, char_type __delim)β explicit specialization declarations, defined insrc/istream.cc. π that's the file, bestie, don't lose it.locale getloc () constβ locale access.bool good () constβ fast error checking.basic_istream< wchar_t > & ignore (streamsize __n)basic_istream< char > & ignore (streamsize __n)basic_istream< wchar_t > & ignore (streamsize __n, int_type __delim)basic_istream< char > & 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. as in, wide to narrow. she's compacting. π§__ostream_type & operator<< (__streambuf_type *__sb)β extracting from another streambuf.__ostream_type & operator<< (const void *__p)β pointer arithmetic inserters.__ostream_type & operator<< (const volatile void *__p)__ostream_type & operator<< (nullptr_t)basic_stringstream & operator= (basic_stringstream &&__rhs)basic_stringstream & operator= (const basic_stringstream &)=deleteβ again with the deleted copy assignment. she said NO. π__istream_type & operator>> (__streambuf_type *__sb)β extracting into another streambuf.__istream_type & operator>> (void *&__p)β basic arithmetic extractors.streamsize precision () constβ flags access.streamsize precision (streamsize __prec)β changing flags.void *& pword (int __ix)β access to void pointer array.basic_streambuf< _CharT, _Traits > * rdbuf (basic_streambuf< _CharT, _Traits > *__sb)β changing the underlying buffer. swapping the whole foundation, nbd. π__stringbuf_type * rdbuf () constβ accessing 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 () &&__string_type str () const &β copying out the string buffer. the classic move. πvoid str (__string_type &&__s)void str (const __string_type &__s)β setting a new buffer.template<__allocator_like _SAlloc> basic_string< _CharT, _Traits, _SAlloc > str (const _SAlloc &__sa) consttemplate<__allocator_like _SAlloc> void str (const basic_string< _CharT, _Traits, _SAlloc > &__s)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. besties, linked. π«Ά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.
and then, tucked in right after, these little manipulator-handlers:
__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 π
so, all the operator>> functions β aka the formatted input functions β share some common behavior, and here's the tea: β
Each one starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to false. That has several effects, and it wraps up by setting a status flag β check the sentry documentation for the full rundown. π
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. β οΈ big deal, read that twice.
__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 π§
these ones play by slightly different rules, and you need to know them:
Every unformatted input function starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to true β note that, it's the opposite of the extractors above. That has several effects, and it finishes by setting a status flag; the sentry docs have the whole story. π
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(). π’
And β same warning as before β 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. β οΈ
okay that's the types, the constructors, the entire member function roster, the extractors and the unformatted input tea β and we're literally just getting started bestie, there is so much more coming π
int_type get ()β simple extraction, bestie. Just one character, no biggie. π__istream_type & get (char_type &__c)β simple extraction, but now you're passing achar_type&. Still simple, still extraction. β¨__istream_type & get (char_type *__s, streamsize __n, char_type __delim)β simple multiple-character extraction, delimiter included. It's giving "read multiple characters, but stop at__delim." π__istream_type & get (char_type *__s, streamsize __n)β simple multiple-character extraction, no delimiter this time. Just__ncharacters, periodt. π¦__istream_type & get (__streambuf_type &__sb, char_type __delim)β extraction into another streambuf. With a delimiter. Stealing characters from one streambuf and putting them into another. Iconic. πΈ__istream_type & get (__streambuf_type &__sb)β extraction into another streambuf. No delimiter, just vibes. π__istream_type & getline (char_type *__s, streamsize __n, char_type __delim)β string extraction. Getting a whole line, or up to__nchars, or until__delim. The way thatβ¦ π«Ά__istream_type & getline (char_type *__s, streamsize __n)β string extraction. Same energy, but no delimiter. Just__nchars max. π__istream_type & ignore (streamsize __n, int_type __delim)β discarding characters. Like when you're reading a group chat and just skipping the drama. π₯__istream_type & ignore (streamsize __n)β simple extraction. Yes, ignore is also extraction, it's complicated. It extracts and throws away. π__istream_type & ignore ()β simple extraction. The no-argument version. Still ignoring, still extracting. π__istream_type & ignore (streamsize __n, char __delim)β simple extraction. With achardelimiter. Because why not. βint_type peek ()β looking ahead in the stream. Peeking without extracting. No cap. π__istream_type & read (char_type *__s, streamsize __n)β extraction without delimiters. Just raw reading, no stopping for delimiters. πstreamsize readsome (char_type *__s, streamsize __n)β extraction until the buffer is exhausted, but no more. It's giving "read what's available, don't wait." π__istream_type & putback (char_type __c)β unextracting a single character. Putting it back like you didn't see it. π§__istream_type & unget ()β unextracting the previous character. Oops, undo. πint sync ()β synchronizing the stream buffer. Getting everything in sync, slay. πpos_type tellg ()β getting the current read position. Where are we? Here. β¨__istream_type & seekg (pos_type)β changing the current read position. Moving the cursor, no big deal. π__istream_type & seekg (off_type, ios_base::seekdir)β changing the current read position. With an offset and a seek direction. Fancy. π¦operator bool () constβ the quick-and-easy status check. Is the stream good? Yes or no, bestie. πΈbool operator! () constβ the quick-and-easy status check. The opposite of the above. π__ostream_type & operator<< (__ostream_type &(*__pf)(__ostream_type &))β interface for manipulators. Letting you use things likestd::endlandstd::hexwith your stream. It's giving "manipulator magic." π«Ά__ostream_type & operator<< (__ios_type &(*__pf)(__ios_type &))β interface for manipulators. Another flavor of manipulator interface. π__ostream_type & operator<< (ios_base &(*__pf)(ios_base &))β interface for manipulators. And another. The trio is complete. π₯
Inserters β¨
Okay so all the operator<< functions (aka formatted output functions) share some common behavior. Each one starts by constructing a temporary object of type std::basic_ostream::sentry. This can have several effects, and it ends with setting a status flag. For the tea, check the sentry documentation. π
If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument. No cap. π
If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state, without causing an ios_base::failure to be thrown. The original exception will then be rethrown. So like, the stream gets marked bad, but it doesn't throw a new failure β it just rethrows the original. Periodt. π
__ostream_type & operator<< (long __n)β integer arithmetic inserters. Just dropping thatlonginto the stream. β__ostream_type & operator<< (unsigned long __n)β integer arithmetic inserters. Unsigned long version. π__ostream_type & operator<< (bool __n)β integer arithmetic inserters. Yes,boolcounts as integer arithmetic here. π__ostream_type & operator<< (short __n)β integer arithmetic inserters. Short and sweet. π__ostream_type & operator<< (unsigned short __n)β integer arithmetic inserters. Unsigned short, still sweet. π§__ostream_type & operator<< (int __n)β integer arithmetic inserters. The classicint. π__ostream_type & operator<< (unsigned int __n)β integer arithmetic inserters. Unsignedintenergy. π__ostream_type & operator<< (long long __n)β integer arithmetic inserters.long long, because sometimes you need more. β¨__ostream_type & operator<< (unsigned long long __n)β integer arithmetic inserters. Unsignedlong long, the final integer boss. π__ostream_type & operator<< (double __f)β floating point arithmetic inserters. Double precision, double the fun. π¦__ostream_type & operator<< (float __f)β floating point arithmetic inserters. Float, the smaller cousin. πΈ__ostream_type & operator<< (long double __f)β floating point arithmetic inserters.long double, for when you're extra. π
Unformatted Output Functions β¨
All the unformatted output functions have some common behavior. Each starts by constructing a temporary object of type std::basic_ostream::sentry. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more. π«Ά
If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument. π
If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state. If badbit is on in the stream's exceptions mask, the exception will be rethrown without completing its actions. So like, if you've set up exceptions, it'll throw. Otherwise, it just marks bad and moves on. π₯
__ostream_type & put (char_type __c)β simple insertion. Just one character, no formatting. π__ostream_type & write (const char_type *__s, streamsize __n)β character string insertion. Writing__ncharacters from a string. π
Static Public Member Functions β¨
static bool sync_with_stdio (bool __sync=true)β interaction with the standard C I/O objects. Keeps C and C++ I/O in sync. Default istrue. βstatic int xalloc () throw ()β access to unique indices. Gets you a unique index foriword/pword. No cap. π
Static Public Attributes β¨
static const openmode __noreplacestatic const fmtflags adjustfieldβ a mask ofleft|right|internal. Useful for the 2-arg form ofsetf. So like, you can use this to adjust the field. πstatic const openmode appβ seek to end before each write. So it always appends. Iconic. π«Άstatic const openmode ateβ open and seek to end immediately after opening. It's giving "start at the end." πstatic const iostate badbitβ indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file). Big yikes. π₯static const fmtflags basefieldβ a mask ofdec|oct|hex. Useful for the 2-arg form ofsetf. Base field energy. πstatic const seekdir begβ request a seek relative to the beginning of the stream. Start from the top, bestie. πstatic const openmode binaryβ perform input and output in binary mode (as opposed to text mode). This is probably not what you think it is; seehttps://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary. So like, don't assume, read the docs. πstatic const fmtflags boolalphaβ insert/extractboolin alphabetic rather than numeric format. Sotrue/falseinstead of1/0. Slay. πstatic const seekdir curβ request a seek relative to the current position within the sequence. Stay where you are, basically. πstatic const fmtflags decβ converts integer input or generates integer output in decimal base. Base 10, the usual. π§static const seekdir endβ request a seek relative to the current end of the sequence. Go to the end, periodt. πstatic const iostate eofbitβ indicates that an input operation reached the end of an input sequence. You've hit the end, bestie. πstatic const iostate failbitβ indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters. It's giving "failure." β¨static const fmtflags fixedβ generate floating-point output in fixed-point notation. No scientific notation, just fixed. πstatic const fmtflags floatfieldβ a mask ofscientific|fixed. Useful for the 2-arg form ofsetf. Float field vibes. πstatic const iostate goodbitβ indicates all is well. Good vibes only. π¦static const fmtflags hexβ converts integer input or generates integer output in hexadecimal base. Base 16, hex girl summer. πΈstatic const openmode inβ open for input. Default forifstreamandfstream. Reading mode. πstatic const fmtflags internalβ adds fill characters at a designated internal point in certain generated output, or identical torightif no such point is designated. Internal fill, fancy. π«Άstatic const fmtflags leftβ adds fill characters on the right (final positions) of certain generated output. (I.e., the thing you print is flush left.). Flush left, bestie. πstatic const fmtflags octβ converts integer input or generates integer output in octal base. Base 8, old school. π₯static const openmode outβ open for output. Default forofstreamandfstream. Writing mode. πstatic const fmtflags rightβ adds fill characters on the left (initial positions) of certain generated output. (I.e., the thing you print is flush right.). Flush right, slay. πstatic const fmtflags scientificβ generates floating-point output in scientific notation. Science! π§ͺstatic const fmtflags showbaseβ generates a prefix indicating the numeric base of generated integer output. Like0xfor hex,0for octal. Show it off. βstatic const fmtflags showpointβ generates a decimal-point character unconditionally in generated floating-point output. Always show the dot. πstatic const fmtflags showposβ generates a+sign in non-negative generated numeric output. Positive vibes only, literally. πstatic const fmtflags skipwsβ skips leading white space before certain input operations. No space, just skip. πstatic const openmode truncβ truncate an existing stream when opening. Default forofstream. Cut it off. π§static const fmtflags unitbufβ flushes output after each output operation. No buffering, just flush. πstatic const fmtflags uppercaseβ replaces certain lowercase letters with their uppercase equivalents in generated output. ALL CAPS ENERGY. π
Protected Types β¨
enum { _S_local_word_size }β mysterious protected enum, iykyk. β¨
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. The main character of setup. πvoid 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 vibe of this class, bestie.
πΈ Template Parameters πΈ
_CharTβ type of character stream, aka what kind of lil letters we're playing with._Traitsβ traits for character type, defaults tochar_traits<_CharT>._Allocβ allocator type, defaults toallocator<_CharT>.
So here's the tea: 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. β¨ Remember that name, sb is gonna be showing up everywhere, she's the main character fr fr.
π Member Typedef Documentation π
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(). π¦ Like little notification pings that fire off when stuff happens, iykyk.
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
typedef _Ios_Iostate std::ios_base::iostate [inherited]
Also a bitmask type, bestie. _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
typedef _Ios_Openmode std::ios_base::openmode [inherited]
Yep, another 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
typedef _Ios_Seekdir std::ios_base::seekdir [inherited]
This one is an enumerated type, not a bitmask β plot twist. _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]
The set of events that may be passed to an event callback. π
erase_eventis used during~ios()andcopyfmt().imbue_eventis used duringimbue().copyfmt_eventis used duringcopyfmt().
Three lil events, three lil moments, very demure. π
π Constructor & Destructor Documentation π
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. π No cap, the docs really said that.
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. π Same energy, same disclaimer.
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. β¨ Third time's the charm, bestie.
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. π§ She said "not my job," and honestly? Respect.
π Member Function Documentation π
const locale & std::ios_base::_M_getloc () const [inline], [inherited]
Locale access. π
Returns
A reference to the current locale.
Like getloc above, but returns a reference instead of generating a copy. Cheaper, faster, slay.
Referenced by std::money_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_date(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_time(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::num_put< _CharT, _OutIter >::do_put(), std::time_put< _CharT, _OutIter >::do_put(), std::time_get< _CharT, _InIter >::get(), and std::time_put< _CharT, _OutIter >::put().
template<typename _CharT, typename _Traits> bool std::basic_ios< _CharT, _Traits >::bad () const [inline], [nodiscard], [inherited]
Fast error checking. β‘
Returns
True if the badbit is set.
Note that other iostate flags may also be set. Don't assume it's only badbit, girl.
Referenced by std::basic_ostream< _CharT, _Traits >::sentry::sentry().
template<typename _CharT, typename _Traits> void std::basic_ios< _CharT, _Traits >::clear (iostate __state = goodbit) [inherited]
[Re]sets the error state. π
Parameters
__stateβ the new state flag(s) to set.
See std::ios_base::iostate for the possible bit values. Most users will not need to pass an argument. π«Ά
References std::ios_base::badbit, exceptions(), rdbuf(), and rdstate().
Referenced by std::basic_ios< char_type, traits_type >::exceptions(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ofstream< char >::open(), std::basic_ofstream< char >::open(), std::__detail::operator>>(), std::basic_istream< _CharT, _Traits >::putback(), rdbuf(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< char_type, traits_type >::setstate(), and std::basic_istream< _CharT, _Traits >::unget().
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
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(). Whole lil choreography, honestly.
References basic_ios(), std::__addressof(), exceptions(), fill(), std::ios_base::flags(), std::ios_base::getloc(), std::ios_base::precision(), tie(), std::tie(), and std::ios_base::width().
template<typename _CharT, typename _Traits> bool std::basic_ios< _CharT, _Traits >::eof () const [inline], [nodiscard], [inherited]
Fast error checking. β‘
Returns
True if the eofbit is set.
Note that other iostate flags may also be set. Same warning, different flag.
template<typename _CharT, typename _Traits> iostate std::basic_ios< _CharT, _Traits >::exceptions () const [inline], [nodiscard], [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 clear(), and copyfmt().
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. Like, instantly. No waiting period, bestie.
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);
}
template<typename _CharT, typename _Traits> bool std::basic_ios< _CharT, _Traits >::fail () const [inline], [nodiscard], [inherited]
Fast error checking. β‘
Returns
True if either the badbit or the failbit is set.
Checking the badbit in fail() is historical practice. It's giving "we've always done it this way." Note that other iostate flags may also be set.
Referenced by std::basic_ios< char_type, traits_type >::operator bool(), std::basic_ios< char_type, traits_type >::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(), and std::basic_ostream< _CharT, _Traits >::tellp().
template<typename _CharT, typename _Traits> char_type std::basic_ios< _CharT, _Traits >::fill () const [inline], [nodiscard], [inherited]
Retrieves the empty character. π«§
Returns
The current fill character.
It defaults to a space (' ') in the current locale. πΈ
Referenced by copyfmt(), and std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator<<.
template<typename _CharT, typename _Traits> char_type std::basic_ios< _CharT, _Traits >::fill (char_type __ch) [inline], [inherited]
Sets a new empty character. βοΈ
Parameters
__chβ the new character.
Returns
The previous fill character.
She gives you the old one back, so polite. π
Okay so the fill character? It's giving padding vibes. It gets used to fill out space when P+ characters have been requested (e.g., via setw), but only Q characters are actually used, and Q<P. It defaults to a space (' ') in the current locale. π
fmtflags std::ios_base::flags () const [inline], [nodiscard], [inherited]
Access to format flags.
Returns
- The format control flags for both input and output.
Referenced by β it's called by 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::chrono::operator<<(), std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator<<, std::__detail::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), and std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator>>.
fmtflags std::ios_base::flags (fmtflags __fmtfl) [inline], [inherited]
Setting new format flags all at once.
Parameters
__fmtflβ The new flags to set.
Returns
- The previous format control flags.
This function overwrites all the format flags with __fmtfl. Periodt. π
template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::flush () [inherited]
Synchronizing the stream buffer.
Returns
*this
If rdbuf() is a null pointer, changes nothing.
Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit.
References β std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by β std::flush().
template<typename _CharT, typename _Traits> streamsize std::basic_istream< _CharT, _Traits >::gcount () const [inline], [inherited]
Character counting.
Returns
- The number of characters extracted by the previous unformatted input function dispatched for this stream.
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits >::int_type std::basic_istream< _CharT, _Traits >::get (void ) [inherited]
Simple extraction.
Returns
- A character, or
eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
References β _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< char_type, traits_type >::get(), and std::basic_istream< char_type, traits_type >::get().
template<typename _CharT, typename _Traits> __istream_type & std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb) [inline], [inherited]
Extraction into another streambuf.
Parameters
__sbβ A streambuf in which to store data.
Returns
*this
Returns get(__sb,widen('\n')).
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb, char_type __delim) [inherited]
Extraction into another streambuf.
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 β _M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (char_type & __c) [inherited]
Simple extraction.
Parameters
__cβ The character in which to store data.
Returns
*this
Tries to extract a character and store it in __c. If none are available, sets failbit and returns traits::eof().
Note β This function is not overloaded onsigned charandunsigned char.
References β _M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
template<typename _CharT, typename _Traits> __istream_type & std::basic_istream< _CharT, _Traits >::get (char_type * __s, streamsize __n) [inline], [inherited]
Simple multiple-character extraction.
Parameters
__sβ Pointer to an array.__nβ Maximum number of characters to store ins.
Returns
*this
Returns get(__s,__n,widen('\n')).
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (char_type * __s, streamsize __n, char_type __delim) [inherited]
Simple multiple-character extraction.
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.
Note β This function is not overloaded onsigned charandunsigned char.
References β _M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().
template<typename _CharT, typename _Traits> __istream_type & std::basic_istream< _CharT, _Traits >::getline (char_type * __s, streamsize __n) [inline], [inherited]
String extraction.
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')).
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.
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::getline (char_type * __s, streamsize __n, char_type __delim) [inherited]
String extraction.
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 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.)
In any case, a null character is stored in the next location in the array.
Referenced by β std::basic_istream< char_type, traits_type >::getline().
locale std::ios_base::getloc () const [inline], [nodiscard], [inherited]
Locale access.
Returns
- A copy of the current locale.
If imbue(loc) has previously been called, then this function returns loc. Otherwise, it returns a copy of std::locale(), the global C++ locale.
Referenced by β std::basic_ios< _CharT, _Traits >::copyfmt(), std::money_put< _CharT, _OutIter >::do_put(), std::basic_ios< _CharT, _Traits >::imbue(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), and std::ws().
template<typename _CharT, typename _Traits> bool std::basic_ios< _CharT, _Traits >::good () const [inline], [nodiscard], [inherited]
Fast error checking.
Returns
- True if no error flags are set.
A wrapper around rdstate.
Referenced by β std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and std::__detail::operator>>().
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (void ) [inherited]
Simple extraction.
Returns
- A character, or
eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
References β _M_gcount, std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sbumpc().
Referenced by β std::basic_istream< char_type, traits_type >::ignore().
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n) [inherited]
Simple extraction.
Returns
- A character, or
eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
References β _M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().
template<typename _CharT, typename _Traits> __istream_type & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n, char __delim) [inline], [inherited]
Simple extraction.
Returns
- A character, or
eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n, int_type __delim) [inherited]
Discarding characters.
Parameters
__nβ Number of characters to discard.__delimβ A "stop" character.
Returns
*this
Extracts characters and throws them away until one of the following happens:
- if
__n != std::numeric_limits<int>::max(),__ncharacters are extracted - the input sequence reaches end-of-file
- the next character equals
__delim(and bestie, in this case the character is extracted π«Ά) β lowkey important: this condition will never occur if__delimequalstraits::eof().
NB: they provide four overloads, instead of the single function (with defaults) mandated by the Standard β and it's giving better performance while still conforming to the Standard. we love a compliant icon π
References: _M_gcount, and std::ios_base::goodbit.
π imbue β the move-to-a-new-locale one
template<typename _CharT, typename _Traits>
locale std::basic_ios<_CharT, _Traits>::imbue(const locale& __loc) [inherited]
okay so this one moves to a new locale, and that's the whole vibe β¨
Parameters
__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 also calls that buffer's pubimbue(loc).
Additional l10n notes are at https://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
References: std::ios_base::getloc(), std::ios_base::imbue(), and rdbuf().
Referenced by std::chrono::operator<<().
π§ init β the setup goblin
template<typename _CharT, typename _Traits>
void std::basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb) [protected], [inherited]
All the setup is performed right here, bestie. This is called from the public constructor. It is not virtual and cannot be redefined β periodt π no takesies backsies.
Referenced by std::basic_fstream< char >::basic_fstream(), std::basic_fstream< char >::basic_fstream(), std::basic_fstream< char >::basic_fstream(), std::basic_ifstream< char >::basic_ifstream(), std::basic_ifstream< char >::basic_ifstream(), std::basic_ifstream< char >::basic_ifstream(), std::basic_ios< char_type, traits_type >::basic_ios(), std::basic_istream< char_type, traits_type >::basic_istream(), std::basic_istringstream< char >::basic_istringstream(), std::basic_istringstream< char >::basic_istringstream(), std::basic_istringstream< char >::basic_istringstream(), std::basic_ofstream< char >::basic_ofstream(), std::basic_ofstream< char >::basic_ofstream(), std::basic_ofstream< char >::basic_ofstream(), std::basic_ostream< char_type, traits_type >::basic_ostream(), std::basic_ostringstream< char >::basic_ostringstream(), std::basic_ostringstream< char >::basic_ostringstream(), std::basic_ostringstream< char >::basic_ostringstream(), std::basic_stringstream< char >::basic_stringstream(), std::basic_stringstream< char >::basic_stringstream(), and std::basic_stringstream< char >::basic_stringstream().
π’ iword β access to the integer array
long& std::ios_base::iword(int __ix) [inline], [inherited]
Parameters
__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. 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 β it's giving "this reference will not last, bestie" π
References: iword().
Referenced by iword().
πͺ narrow β squeezes characters
template<typename _CharT, typename _Traits>
char std::basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const [inline], [inherited]
Parameters
__cβ the character to narrow__dfaultβ the character to narrow (yes, same wording, that's what the docs say π)
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 https://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
β
operator bool β the quick-and-easy status check
template<typename _CharT, typename _Traits>
std::basic_ios<_CharT, _Traits>::operator bool() const [inline], [explicit], [nodiscard], [inherited]
The quick-and-easy status check π This lets you write constructs such as if (!a_stream) ... and while (a_stream) ...
β operator! β also the quick-and-easy status check
template<typename _CharT, typename _Traits>
bool std::basic_ios<_CharT, _Traits>::operator!() const [inline], [nodiscard], [inherited]
The quick-and-easy status check π This lets you write constructs such as if (!a_stream) ... and while (a_stream) ...
ποΈ operator<< β interface for manipulators
template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (* __pf)(__ios_type&)) [inline], [inherited]
Interface for manipulators. Manipulators such as std::endl and std::hex use these functions in constructs like "std::cout << std::endl". For more information, see the iomanip header.
ποΈ operator<< β interface for manipulators (the other flavor)
template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (* __pf)(__ostream_type&)) [inline], [inherited]
Interface for manipulators. Manipulators such as std::endl and std::hex use these functions in constructs like "std::cout << std::endl". For more information, see the iomanip header.
π₯ operator<< β extracting from another streambuf
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type* __sb) [inherited]
Parameters
__sbβ a pointer to a streambuf
This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.
If __sb is NULL, the stream will set failbit in its error state. π¨
Characters are extracted from __sb and inserted into *this until one of the following occurs:
- the input stream reaches end-of-file,
- insertion into the output sequence fails (in this case, the character that would have been inserted is not extracted), or
- an exception occurs while getting a character from
__sb, which setsfailbitin the error state
If the function inserts no characters, failbit is set.
π’ operator<< β integer arithmetic inserters (bool)
template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool __n) [inline], [inherited]
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.
π«§ operator<< β pointer arithmetic inserters
template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void* __p) [inline], [inherited]
Parameters
__pβ a variable of pointer type
Returns
*thisif successful
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
π operator<< β floating point arithmetic inserters (double)
template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double __f) [inline], [inherited]
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 perform numeric formatting.
π operator<< β floating point arithmetic inserters (float)
template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float __f) [inline], [inherited]
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 perform numeric formatting.
π’ operator<< β integer arithmetic inserters (int)
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int __n) [inherited]
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.
ποΈ operator<< β interface for manipulators (ios_base)
template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(ios_base& (* __pf)(ios_base&)) [inline], [inherited]
Interface for manipulators. Manipulators such as std::endl and std::hex use these functions in constructs like "std::cout << std::endl". For more information, see the iomanip header.
π’ operator<< β integer arithmetic inserters (long)
template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long __n) [inline], [inherited]
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.
π operator<< β floating point arithmetic inserters (long double)
template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double __f) [inline], [inherited]
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 perform numeric formatting.
π’ operator<< β integer arithmetic inserters (long long)
template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long __n) [inline], [inherited]
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.
π’ operator<< β integer arithmetic inserters (short)
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short __n) [inherited]
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.
References: basic_ostream(), std::ios_base::badbit, std::ostreambuf_iterator< _CharT, _Traits >::failed(), std::ios_base::goodbit, std::num_put< _CharT, _OutIter >::put(), std::basic_ios< _CharT, _Traits >::setstate(), and std::use_facet().
π’ operator<< β integer arithmetic inserters (unsigned int)
template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n) [inline], [inherited]
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.
π’ operator<< β integer arithmetic inserters (unsigned long)
template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n) [inline], [inherited]
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 do all the numeric formatting. Yes, even on the output side. That's just how it is, bestie. π
πΈ operator<< (unsigned long long __n)
template<typename _CharT, typename _Traits> __ostream_type &
std::basic_ostream< _CharT, _Traits >::operator<< (unsigned long long __n)
[inline], [inherited]
Integer arithmetic inserters. That's the whole job description. π’
Parameters
__nβ a variable of builtin integral type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
π¦ operator<< (unsigned short __n)
template<typename _CharT, typename _Traits> __ostream_type &
std::basic_ostream< _CharT, _Traits >::operator<< (unsigned short __n)
[inline], [inherited]
Integer arithmetic inserters. Same energy, smaller type. β¨
Parameters
__nβ a variable of builtin integral type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
π operator>> (__ios_type &(* __pf )(__ios_type &))
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (__ios_type &(* __pf
)(__ios_type &)) [inline], [inherited]
Interface for manipulators, okay? 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. It's giving "middleware for vibes". π
π§ operator>> (__istream_type &(* __pf )(__istream_type &))
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (__istream_type &(*
__pf )(__istream_type &)) [inline], [inherited]
Interface for manipulators. Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header. Twin of the one above, different function-pointer shape, same slay. π
π₯ operator>> (__streambuf_type * __sb)
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits >
& std::basic_istream< _CharT, _Traits >::operator>> (__streambuf_type *
__sb) [inherited]
Extracting into another streambuf. Basically piping, but make it C++.
Parameters
__sbβ a pointer to a streambuf.
This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.
If __sb is NULL, the stream will set failbit in its error state.
Characters are extracted from this stream and inserted into the __sb streambuf until one of the following occurs:
- the input stream reaches end-of-file,
- insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted), or
- an exception occurs (and in this case is caught)
If the function inserts no characters, failbit is set.
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 & __n)
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (bool & __n) [inline],
[inherited]
Integer arithmetic extractors. Yes, bool is living under the integer umbrella here. That's the lore. π
Parameters
__nβ a variable of builtin integral type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
π operator>> (double & __f)
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (double & __f)
[inline], [inherited]
Floating point arithmetic extractors. Decimals, bestie. π
Parameters
__fβ a variable of builtin floating point type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
π operator>> (float & __f)
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (float & __f)
[inline], [inherited]
Floating point arithmetic extractors. Same deal, smaller footprint. β¨
Parameters
__fβ a variable of builtin floating point type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
π
operator>> (int & __n)
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits >
& std::basic_istream< _CharT, _Traits >::operator>> (int & __n)
[inherited]
Integer arithmetic extractors. The classic. The original. The main character. π
Parameters
__nβ a variable of builtin integral type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
π operator>> (ios_base &(* __pf )(ios_base &))
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (ios_base &(* __pf
)(ios_base &)) [inline], [inherited]
Interface for manipulators. Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header. Third member of the manipulator trio, no cap. π«Ά
π¦ operator>> (long & __n)
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long & __n) [inline],
[inherited]
Integer arithmetic extractors. Long. Not short. Important distinction, iykyk. π
Parameters
__nβ a variable of builtin integral type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
π§ operator>> (long double & __f)
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long double & __f)
[inline], [inherited]
Floating point arithmetic extractors. Maximum precision princess energy. π
Parameters
__fβ a variable of builtin floating point type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
β operator>> (long long & __n)
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long long & __n)
[inline], [inherited]
Integer arithmetic extractors. Big numbers, big feelings. π₯
Parameters
__nβ a variable of builtin integral type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
π operator>> (short & __n)
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits >
& std::basic_istream< _CharT, _Traits >::operator>> (short & __n)
[inherited]
Integer arithmetic extractors. And this one comes with a receipts list, so pay attention. π
Parameters
__nβ a variable of builtin integral type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
References std::ios_base::badbit, std::ios_base::failbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::setstate(), and std::use_facet().
πΈ operator>> (unsigned int & __n)
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned int & __n)
[inline], [inherited]
Integer arithmetic extractors. No negatives allowed, we're keeping it positive. β¨
Parameters
__nβ a variable of builtin integral type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
π operator>> (unsigned long & __n)
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned long & __n)
[inline], [inherited]
Integer arithmetic extractors. Still unsigned, still unbothered. π
Parameters
__nβ a variable of builtin integral type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
π«Ά operator>> (unsigned long long & __n)
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 one, and it ate. π
Parameters
__nβ a variable of builtin integral type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
π¦ operator>> (unsigned short & __n)
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned short & __n)
[inline], [inherited]
Integer arithmetic extractors. Tiny, unsigned, doing her best. π₯Ί
Parameters
__nβ a variable of builtin integral type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
π operator>> (void *& __p)
template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (void *& __p)
[inline], [inherited]
Basic arithmetic extractors. Note it says basic, not integer β pointers get their own little label. π―
Parameters
__pβ a variable of pointer type.
Returns
*this if successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
π peek (void)
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 reading the group chat before you reply. π
Returns
The next character, or eof().
If, after constructing the sentry object, good() is false, returns traits::eof(). Otherwise reads but does not extract the next input character.
References _M_gcount, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::rdbuf().
π std::ios_base::precision () const
streamsize std::ios_base::precision () const [inline], [nodiscard],
[inherited]
Flags access. Just a lil getter, living her life.
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<<().
π
std::ios_base::precision (streamsize __prec)
streamsize std::ios_base::precision (streamsize __prec) [inline],
[inherited]
Changing flags. The setter. She takes, she gives back. π
Parameters
__precβ the new precision value.
Returns
The previous value of precision().
π put (char_type __c)
template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits >
& std::basic_ostream< _CharT, _Traits >::put (char_type __c) [inherited]
Simple insertion. One character. That's it. That's the function. π
Parameters
__cβ the character to insert.
Returns
*this
Tries to insert __c.
Note: This function is not overloaded onsigned charandunsigned char.
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 (char_type __c)
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits >
& std::basic_istream< _CharT, _Traits >::putback (char_type __c)
[inherited]
Unextracting a single character. Putting it back. Un-eating the snack. π
Parameters
__cβ the character to push back into the input stream.
Returns
*this
If rdbuf() is not null, calls rdbuf()->sputbackc(c).
If rdbuf() is null or if sputbackc() fails, sets badbit in the error state.
Note: This function first clearseofbit. Since no characters are extracted, the next call togcount()will return0, as required by DR 60.
continuing from the previous part, no biggie π
References _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]
Access to the void pointer array. bestie this is the little drawer of mystery pointers β¨
Parameters
__ixβ index into the array.
Returns
A reference to a void* associated with the index.
So basically the pword function gives you access to an array of pointers that you can use for literally anything. The array grows as required to hold the supplied index. All pointers in the array are initialized to 0.
π¨ okay listen up: 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. Not me warning you twice, it's that serious π
π¦ 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 for your stream β¨
Parameters
__sbβ the new stream buffer.
Returns
The previous stream buffer.
It associates a new buffer with the current stream, and clears the error state. Clean slate energy π
π okay so, tea time: 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>
References clear().
πΈ template<typename _CharT, typename _Traits, typename _Alloc> __stringbuf_type * std::basic_stringstream< _CharT, _Traits, _Alloc >::rdbuf () const [inline], [nodiscard]
Accessing the underlying buffer. peek at what's underneath, no cap π
Returns
The current basic_stringbuf buffer.
Heads up: this hides both signatures of std::basic_ios::rdbuf(). Sneaky iconic behaviour fr fr.
π template<typename _CharT, typename _Traits> iostate std::basic_ios< _CharT, _Traits >::rdstate () const [inline], [nodiscard], [inherited]
Returns the error state of the stream buffer.
Returns
A bit pattern (well, isn't everything? π)
See std::ios_base::iostate for the possible bit values. Most users will call one of the interpreting wrappers, e.g., good(). iykyk.
Referenced by std::basic_ios< char_type, traits_type >::bad(), clear(), std::basic_ios< char_type, traits_type >::eof(), std::basic_ios< char_type, traits_type >::fail(), std::basic_ios< char_type, traits_type >::good(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< char_type, traits_type >::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. just raw grabbing, no filter β¨
Parameters
__sβ a character array.__nβ maximum number of characters to store.
Returns
*this
If the stream state is good(), it extracts characters and stores them into __s until one of the following happens:
__ncharacters are stored- the input sequence reaches end-of-file, in which case the error state is set to
failbit|eofbit.
π Note: this function is not overloaded onsigned charandunsigned char.
References _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 there and don't be greedy" π
Parameters
__sβ a character array.__nβ maximum number of characters to store.
Returns
The number of characters extracted.
It extracts characters and stores them into __s depending on the number of characters remaining in the streambuf's buffer, rdbuf()->in_avail(), called A here:
- if
A == -1, setseofbitand extracts no characters - if
A == 0, extracts no characters - if
A > 0, extractsmin(A,n)
The goal is to empty the current buffer, and to not request any more from the external input sequence controlled by the streambuf. Very "we're not asking for more, we're just clearing the vibes" πΈ
References _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.
Parameters
__fnβ the function to add.__indexβ the integer to pass to the function when invoked.
It 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, periodt π
β 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. teleporting your read cursor, iconic β¨
Parameters
__offβ a file offset object.__dirβ the direction in which to seek.
Returns
*this
If fail() is not true, it calls rdbuf()->pubseekoff(__off,__dir). If that function fails, it 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. same vibe, different arg, we love a duo π«Ά
Parameters
__posβ a file position object.
Returns
*this
If fail() is not true, it calls rdbuf()->pubseekpos(__pos). If that function fails, it 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. now we're moving the write cursor, slay β¨
Parameters
__offβ a file offset object.__dirβ the direction in which to seek.
Returns
*this
If fail() is not true, it calls rdbuf()->pubseekoff(off,dir). If that function fails, it 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. yes bestie, there's two of them π
Parameters
__posβ a file position object.
Returns
*this
If fail() is not true, it calls rdbuf()->pubseekpos(pos). If that function fails, it 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. adding to the aesthetic, not replacing it π
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. No take-backs, no clearing, we're just adding π
Referenced by std::__detail::operator>>().
β¨ fmtflags std::ios_base::setf (fmtflags __fmtfl, fmtflags __mask) [inline], [inherited]
Setting new format flags. the masked version, main character energy π
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. Clean out the old, slide in the new π
π« template<typename _CharT, typename _Traits> void std::basic_ios< _CharT, _Traits >::setstate (iostate __state) [inline], [inherited]
Sets additional flags in the error state. more flags, more drama, love that for us π
Parameters
__stateβ the additional state flag(s) to set.
See std::ios_base::iostate for the possible bit values.
okay that's the end of this chunk, keep scrolling bestie, we're not done yet π«Ά
- Referenced by
std::basic_ostream< _CharT, _Traits >::sentry::sentry(),std::basic_fstream< char >::close(),std::basic_ifstream< char >::close(),std::basic_ofstream< char >::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_fstream< char >::open(),std::basic_fstream< char >::open(),std::basic_ifstream< char >::open(),std::basic_ifstream< char >::open(),std::basic_ofstream< char >::open(),std::basic_ofstream< char >::open(),std::basic_ostream< _CharT, _Traits >::operator<<(),std::operator<<(),std::operator<<(),std::basic_istream< _CharT, _Traits >::operator>>(),std::basic_istream< _CharT, _Traits >::operator>>(),std::operator>>(),std::operator>>(),std::operator>>(),std::tr2::operator>>(),std::basic_ostream< _CharT, _Traits >::put(),std::basic_istream< _CharT, _Traits >::putback(),std::basic_istream< _CharT, _Traits >::read(),std::basic_istream< _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(), andstd::ws().
template<typename _CharT, typename _Traits, typename _Alloc> __string_type
std::basic_stringstream< _CharT, _Traits, _Alloc >::str () const &
[inline], [nodiscard]
okay so this one is literally just copying out the string buffer. that's it. that's the whole vibe. π
Returns
rdbuf()->str()
template<typename _CharT, typename _Traits, typename _Alloc> void
std::basic_stringstream< _CharT, _Traits, _Alloc >::str (const
__string_type & __s) [inline]
setting a new buffer, bestie. you're swapping in a whole new string. π
Parameters
__sβ the string to use as a new sequence.
Calls rdbuf()->str(s).
template<typename _CharT, typename _Traits> int std::basic_istream< _CharT,
_Traits >::sync (void ) [inherited]
Synchronizing the stream buffer. it's giving "make the buffer agree with reality". β¨
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(). so don't come for gcount's count, they're unrelated fr fr.
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().
bool std::ios_base::sync_with_stdio (bool __sync = true) [static],
[inherited]
Interaction with the standard C I/O objects. the C world and the C++ world, finally in the same group chat. π
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
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits
>::pos_type std::basic_istream< _CharT, _Traits >::tellg (void )
[inherited]
Getting the current read position. where are we reading rn bestie π
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. lowkey a little unhinged of it but okay π
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().
template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits
>::pos_type std::basic_ostream< _CharT, _Traits >::tellp () [inherited]
Getting the current write position. the writing twin of tellg, iconic behavior β¨
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().
template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits >
* std::basic_ios< _CharT, _Traits >::tie () const [inline],
[nodiscard], [inherited]
Fetches the current tied stream. who's holding hands with who π«Ά
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. the way that cin just flushes cout before it does anything⦠main character energy fr.
Referenced by std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and copyfmt().
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. making it official π
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.</pruple>
template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits >
& std::basic_istream< _CharT, _Traits >::unget (void ) [inherited]
Unextracting the previous character. the undo button, 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 _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(), and std::basic_streambuf< _CharT, _Traits >::sungetc().
Referenced by std::__detail::operator>>().
void std::ios_base::unsetf (fmtflags __mask) [inline], [inherited]
Clearing format flags. not me unsetting the vibe π
Parameters
__maskβ the flags to unset.
This function clears __mask in the format flags.
template<typename _CharT, typename _Traits> char_type std::basic_ios<
_CharT, _Traits >::widen (char __c) const [inline], [inherited]
Widens characters. glow-up but 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 https://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
Referenced by std::endl(), std::basic_ios< char_type, traits_type >::fill(), std::basic_istream< char_type, traits_type >::get(), std::basic_istream< char_type, traits_type >::get(), std::basic_istream< char_type, traits_type >::getline(), std::getline(), std::getline(), std::operator<<(), std::operator<<(), std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator<<, and std::tr2::operator>>().
streamsize std::ios_base::width () const [inline], [nodiscard],
[inherited]
Flags access. how wide are we printing, bestie π
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>>().
streamsize std::ios_base::width (streamsize __wide) [inline], [inherited]
Changing flags. setting the width now β¨
Parameters
__wideβ the new width value.
Returns
The previous value of width().
template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits >
& std::basic_ostream< _CharT, _Traits >::write (const char_type * __s,
streamsize __n) [inherited]
Character string insertion. shoving a whole string in, slay π
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. she said pick a lane π
int std::ios_base::xalloc () [static], [inherited]
Access to unique indices. handing out numbered seats so nobody fights ποΈ
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. no cap.
π Member Data Documentation π
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(). she's keeping receipts π
Referenced by get(), get(), get(), get(), ignore(), ignore(), ignore(), peek(), putback(), read(), readsome(), and unget().
const fmtflags std::ios_base::adjustfield [static], [inherited]
A mask of left|right|internal. useful for the 2-arg form of setf.
Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::internal(), std::left(), and std::right().
const openmode std::ios_base::app [static], [inherited]
Seek to end before each write. yes, each one, she's persistent π
Referenced by std::basic_filebuf< char_type, traits_type >::_M_set_buffer(), std::basic_filebuf< _CharT, _Traits >::overflow(), and std::basic_filebuf< _CharT, _Traits >::xsputn().
const openmode std::ios_base::ate [static], [inherited]
Open and seek to end immediately after opening. one and done, different from app, don't mix them up bestie π
Referenced by std::basic_filebuf< _CharT, _Traits >::open().
const iostate std::ios_base::badbit [static], [inherited]
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file). this one is serious. badbit means things went actually wrong, not just "oops end of file". π
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ios< _CharT, _Traits >::clear(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_iostream< char_type, traits_type >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_iostream< char_type, traits_type >::operator<<(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, char_traits< _CharT > >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_istream< _CharT, _Traits >::unget(), and std::ws().
πΈ const fmtflags std::ios_base::basefield [static], [inherited]
A mask of dec|oct|hex. Bestie, it's genuinely useful for the 2-arg form of setf. π
Referenced by std::dec(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), std::hex(), and std::oct().
π const seekdir std::ios_base::beg [static], [inherited]
Asks for a seek relative to the beginning of the stream. Head empty, cursor at zero. β¨
Referenced by std::basic_filebuf< _CharT, _Traits >::seekpos().
π¦ const openmode std::ios_base::binary [static], [inherited]
Does input and output in binary mode (as opposed to text mode). And okay so β this is probably not what you think it is; go read https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary. Do not skip this, I'm so serious. π
Referenced by std::basic_filebuf< _CharT, _Traits >::showmanyc().
π const fmtflags std::ios_base::boolalpha [static], [inherited]
Insert/extract bool in alphabetic rather than numeric format. So like true instead of 1. Iconic behaviour, no notes. π
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. Staying in the present moment, very mindful of it. π§
Referenced by std::basic_filebuf< _CharT, _Traits >::imbue(), std::basic_filebuf< _CharT, _Traits >::overflow(), std::basic_filebuf< _CharT, _Traits >::pbackfail(), std::basic_filebuf< _CharT, _Traits >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_istream< _CharT, _Traits >::tellg(), and std::basic_ostream< _CharT, _Traits >::tellp().
β const fmtflags std::ios_base::dec [static], [inherited]
Converts integer input, or generates integer output, in decimal base. The default vibe, the people's choice. π
Referenced by std::dec(), std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator<<, and std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator>>.
πΈ const seekdir std::ios_base::end [static], [inherited]
Requests a seek relative to the current end of the sequence. Going straight to the end, we love a dramatic entrance. π¬
Referenced by std::basic_filebuf< _CharT, _Traits >::open(), and std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff().
π const iostate std::ios_base::eofbit [static], [inherited]
Indicates that an input operation reached the end of an input sequence. It's giving "we've read everything, bestie, there is no more." π
Referenced by 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(), 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_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::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, char_traits< _CharT > >::peek(), 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< _CharT, char_traits< _CharT > >::seekg(), std::basic_istream< _CharT, _Traits >::unget(), std::basic_istream< _CharT, char_traits< _CharT > >::unget(), and std::ws().
π const iostate std::ios_base::failbit [static], [inherited]
Indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters. The "we tried and it did not work out" flag. We've all been there. π
Referenced by std::basic_ostream< _CharT, _Traits >::sentry::sentry(), std::basic_fstream< char >::close(), std::basic_ifstream< char >::close(), std::basic_ofstream< char >::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_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::time_get< _CharT, _InIter >::get(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ofstream< char >::open(), std::basic_ofstream< char >::open(), std::operator<<(), std::basic_iostream< char_type, traits_type >::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), and std::basic_ostream< _CharT, _Traits >::seekp().
π const fmtflags std::ios_base::fixed [static], [inherited]
Generates floating-point output in fixed-point notation. Locked in. No drifting off into exponent-land. π
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 floaty little mask that could. π«Ά
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-just-vibes state. When this is set, bestie, we are thriving. π
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::num_get< _CharT, _InIter >::do_get(), std::time_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_iostream< char_type, traits_type >::get(), 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::time_get< _CharT, _InIter >::get(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_iostream< char_type, traits_type >::operator<<(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::basic_iostream< char_type, traits_type >::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::peek(), 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_istream< _CharT, _Traits >::sync(), std::basic_istream< _CharT, _Traits >::unget(), and std::ws().
π₯ const fmtflags std::ios_base::hex [static], [inherited]
Converts integer input, or generates integer output, in hexadecimal base. 0x-core aesthetic, honestly. π
Referenced by std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), and std::hex().
π const openmode std::ios_base::in [static], [inherited]
Open for input. Default for ifstream and fstream. The moment you open a file expecting to read it, this is the one carrying the whole operation. π
Referenced by std::basic_fstream< char >::basic_fstream(), std::basic_fstream< char >::basic_fstream(), std::basic_fstream< char >::basic_fstream(), std::basic_ifstream< char >::basic_ifstream(), std::basic_ifstream< char >::basic_ifstream(), std::basic_ifstream< char >::basic_ifstream(), std::basic_istringstream< char >::basic_istringstream(), std::basic_stringbuf< char >::basic_stringbuf(), std::basic_stringstream< char >::basic_stringstream(), std::basic_filebuf< char_type, traits_type >::_M_set_buffer(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_filebuf< _CharT, _Traits >::pbackfail(), std::basic_streambuf< char_type, traits_type >::pubseekoff(), std::basic_streambuf< char_type, traits_type >::pubseekpos(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_streambuf< char_type, traits_type >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_stringbuf< char >::seekoff(), std::basic_streambuf< char_type, traits_type >::seekpos(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_stringbuf< char >::seekpos(), std::basic_filebuf< _CharT, _Traits >::showmanyc(), std::basic_stringbuf< char >::showmanyc(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_filebuf< _CharT, _Traits >::underflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::underflow(), and std::basic_filebuf< _CharT, _Traits >::xsgetn().
π¦ const fmtflags std::ios_base::internal [static], [inherited]
Adds fill characters at a designated internal point in certain generated output β or, if no such point is designated, it's identical to right. Very "I'll be specific if you let me, otherwise I'll just be right." π«Ά
Referenced by std::internal().
πΈ const fmtflags std::ios_base::left [static], [inherited]
Adds fill characters on the right (final positions) of certain generated output. I.e., the thing you print is flush left. So the padding goes after, not before. Slay. π
Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::left(), and std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator<<.
π const fmtflags std::ios_base::oct [static], [inherited]
Converts integer input, or generates integer output, in octal base. The base-eight girlies stay underrated, ngl. π
Referenced by std::oct().
const openmode std::ios_base::out [static], [inherited]β bestie this is the output flag π opens the thing for writing. It's the default forofstreamandfstream, so those two just wake up in output mode, no cap.
Referenced by std::basic_fstream< char >::basic_fstream(), std::basic_fstream< char >::basic_fstream(), std::basic_fstream< char >::basic_fstream(), std::basic_ofstream< char >::basic_ofstream(), std::basic_ofstream< char >::basic_ofstream(), std::basic_ofstream< char >::basic_ofstream(), std::basic_ostringstream< char >::basic_ostringstream(), std::basic_stringbuf< char >::basic_stringbuf(), std::basic_stringstream< char >::basic_stringstream(), std::basic_filebuf< char_type, traits_type >::_M_set_buffer(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_ofstream< char >::open(), std::basic_ofstream< char >::open(), std::basic_ofstream< char >::open(), std::basic_filebuf< _CharT, _Traits >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::pbackfail(), std::basic_streambuf< char_type, traits_type >::pubseekoff(), std::basic_streambuf< char_type, traits_type >::pubseekpos(), std::basic_streambuf< char_type, traits_type >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_stringbuf< char >::seekoff(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_streambuf< char_type, traits_type >::seekpos(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_stringbuf< char >::seekpos(), std::basic_ostream< _CharT, _Traits >::tellp(), and std::basic_filebuf< _CharT, _Traits >::xsputn().
const fmtflags std::ios_base::right [static], [inherited]β pushes the fill characters onto the left (the initial positions) of certain generated output. So like, the thing you print is flush right. it's giving justified text but make it β¨aestheticβ¨.
Referenced by std::right().
const fmtflags std::ios_base::scientific [static], [inherited]β floating-point output, but make it science π¬ notation, babe.
Referenced by std::hexfloat(), and std::scientific().
const fmtflags std::ios_base::showbase [static], [inherited]β drops a lil prefix on your integer output telling everyone which numeric base it's in.0xgirlies know π
Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::noshowbase(), and std::showbase().
const fmtflags std::ios_base::showpoint [static], [inherited]β forces a decimal-point character into your floating-point output no matter what. no skipping it, we're showing up π
Referenced by std::noshowpoint(), and std::showpoint().
const fmtflags std::ios_base::showpos [static], [inherited]β puts a+sign on non-negative numeric output. positivity era fr fr π
Referenced by std::noshowpos(), and std::showpos().
const fmtflags std::ios_base::skipws [static], [inherited]β skips the leading white space before certain input operations. lowkey the reason yourcin >>just works.
Referenced by std::noskipws(), std::__detail::operator>>(), std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator>>, and std::skipws().
const openmode std::ios_base::trunc [static], [inherited]β truncates an existing stream when opening. It's the default forofstream. So yeah bestie, if you open a file that already exists, the old contents are gone gone β this is the flag that ate πconst fmtflags std::ios_base::unitbuf [static], [inherited]β flushes output after each output operation. obsessive? yes. thorough? also yes π«Ά
Referenced by std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::nounitbuf(), and std::unitbuf().
const fmtflags std::ios_base::uppercase [static], [inherited]β swaps certain lowercase letters for their UPPERCASE equivalents in generated output. the caps lock of format flags, iconic honestly.
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 writing this one, just a robot doing its little thing π
and that's a wrap on the whole page, bestie!! πΈ thank you for reading all the way through, you're literally the main character for that. this page came to you from libstdc++, and it's the std::basic..., _Alloc >(3) manual page β that trailing (3) is just the section number, iykyk. mwah, go compile something gorgeous π
β¨π¦
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms