STD::BASIC_IOS(3cxx)
π NAME π
okay bestie, welcome to the std::basic_ios< _CharT, _Traits > manual page from section 3cxx π β this is the template class basic_ios, the virtual base class for all stream classes. π
β¨ SYNOPSIS β¨
#include <ios>
- Inherits
std::ios_base. - Inherited by:
std::basic_istream< char > [virtual]std::basic_istream< char, _Traits > [virtual]std::basic_ostream< char, _Traits > [virtual]std::basic_ostream< char > [virtual]std::basic_istream< _CharT, _Traits > [virtual]std::basic_ostream< _CharT, _Traits > [virtual]
π Public Types π
enum event { erase_event, imbue_event, copyfmt_event }β the set of events that may be passed to an event callback. ποΈtypedef void(* event_callback) (event __e, ios_base &__b, int __i)β the type of an event callback function. πtypedef _Ios_Fmtflags fmtflagsβ this is a bitmask type. π§©typedef _Ios_Iostate iostateβ this is a bitmask type. π§©typedef _Ios_Openmode openmodeβ this is a bitmask type. π§©typedef _Ios_Seekdir seekdirβ this is an enumerated type. πΊοΈtypedef _CharT char_typetypedef _Traits::int_type int_typetypedef _Traits::pos_type pos_typetypedef _Traits::off_type off_typetypedef _Traits traits_typetypedef ctype< _CharT > __ctype_typetypedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_typetypedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_type
π Public Member Functions π
basic_ios (basic_streambuf< _CharT, _Traits > *__sb)β constructor, and it performs initialization. π οΈvirtual ~basic_ios ()β empty. literally just empty. πconst locale & _M_getloc () constβ locale access. πvoid _M_setstate (iostate __state)β no description on this one, bestie. π«₯bool bad () constβ fast error checking. π¨void clear (iostate __state=goodbit)β [re]sets the error state. π§Όbasic_ios & copyfmt (const basic_ios &__rhs)β copies fields of__rhsinto this. πbool eof () constβ fast error checking. π¨iostate exceptions () constβ throwing exceptions on errors. π±void exceptions (iostate __except)β throwing exceptions on errors. π±bool fail () constβ fast error checking. π¨char_type fill () constβ retrieves the empty character. π«§char_type fill (char_type __ch)β sets a new empty character. π«§fmtflags flags () constβ access to format flags. π©fmtflags flags (fmtflags __fmtfl)β setting new format flags all at once. π©locale getloc () constβ locale access. πbool good () constβ fast error checking. π¨locale imbue (const locale &__loc)β moves to a new locale. πlong & iword (int __ix)β access to integer array. π’char narrow (char_type __c, char __dfault) constβ squeezes characters. ποΈstreamsize precision () constβ flags access. π©streamsize precision (streamsize __prec)β changing flags. π©void *& pword (int __ix)β access to void pointer array. π«³basic_streambuf< _CharT, _Traits > * rdbuf () constβ accessing the underlying buffer. π§Ίbasic_streambuf< _CharT, _Traits > * rdbuf (basic_streambuf< _CharT, _Traits > *__sb)β changing the underlying buffer. π§Ίiostate rdstate () constβ returns the error state of the stream buffer. π¦void register_callback (event_callback __fn, int __index)β add the callback__fnwith parameter__index. πfmtflags setf (fmtflags __fmtfl)β setting new format flags. π©fmtflags setf (fmtflags __fmtfl, fmtflags __mask)β setting new format flags. π©void setstate (iostate __state)β sets additional flags in the error state. π¦basic_ostream< _CharT, _Traits > * tie () constβ fetches the current tied stream. πbasic_ostream< _CharT, _Traits > * tie (basic_ostream< _CharT, _Traits > *__tiestr)β ties this stream to an output stream. πvoid unsetf (fmtflags __mask)β clearing format flags. π§½char_type widen (char __c) constβ widens characters. πͺstreamsize width () constβ flags access. π©streamsize width (streamsize __wide)β changing flags. π©operator bool () constβ the quick-and-easy status check. βbool operator! () constβ the quick-and-easy status check. β
π Static Public Member Functions π
static bool sync_with_stdio (bool __sync=true)β interaction with the standard C I/O objects. πstatic int xalloc () throw ()β access to unique indices. π’
π¦ Static Public Attributes π¦
static const openmode __noreplaceβ no description on this one. π«₯static const fmtflags adjustfieldβ a mask ofleft|right|internal. Useful for the 2-arg form ofsetf. πstatic const openmode appβ seek to end before each write. βοΈstatic const openmode ateβ open and seek to end immediately after opening. βοΈstatic const iostate badbitβ indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file). πstatic const fmtflags basefieldβ a mask ofdec|oct|hex. Useful for the 2-arg form ofsetf. πstatic const seekdir begβ request a seek relative to the beginning of the stream. πstatic const openmode binaryβ perform input and output in binary mode (as opposed to text mode). This is probably not what you think it is; seehttps://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary. π«static const fmtflags boolalphaβ insert/extractboolin alphabetic rather than numeric format. π€static const seekdir curβ request a seek relative to the current position within the sequence. πstatic const fmtflags decβ converts integer input or generates integer output in decimal base. πstatic const seekdir endβ request a seek relative to the current end of the sequence. πstatic const iostate eofbitβ indicates that an input operation reached the end of an input sequence. πstatic const iostate failbitβ indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters. πstatic const fmtflags fixedβ generate floating-point output in fixed-point notation. πstatic const fmtflags floatfieldβ a mask ofscientific|fixed. Useful for the 2-arg form ofsetf. πstatic const iostate goodbitβ indicates all is well. βstatic const fmtflags hexβ converts integer input or generates integer output in hexadecimal base. π’static const openmode inβ open for input. Default forifstreamandfstream. π₯static const fmtflags internalβ adds fill characters at a designated internal point in certain generated output, or identical torightif no such point is designated. π―static const fmtflags leftβ adds fill characters on the right (final positions) of certain generated output. (I.e., the thing you print is flush left.) β¬ οΈstatic const fmtflags octβ converts integer input or generates integer output in octal base. π’static const openmode outβ open for output. Default forofstreamandfstream. π€static const fmtflags rightβ adds fill characters on the left (initial positions) of certain generated output. (I.e., the thing you print is flush right.) β‘οΈstatic const fmtflags scientificβ generates floating-point output in scientific notation. π§ͺstatic const fmtflags showbaseβ generates a prefix indicating the numeric base of generated integer output. π·οΈstatic const fmtflags showpointβ generates a decimal-point character unconditionally in generated floating-point output. π£static const fmtflags showposβ generates a+sign in non-negative generated numeric output. βstatic const fmtflags skipwsβ skips leading white space before certain input operations. β©static const openmode truncβ truncate an existing stream when opening. Default forofstream. βοΈstatic const fmtflags unitbufβ flushes output after each output operation. π½static const fmtflags uppercaseβ replaces certain lowercase letters with their uppercase equivalents in generated output. π
π§ Protected Types π§
enum { _S_local_word_size }
π Protected Member Functions π
basic_ios ()β empty. πbasic_ios (const basic_ios &)=deletevoid _M_cache_locale (const locale &__loc)void _M_call_callbacks (event __ev) throw ()void _M_dispose_callbacks (void) throw ()_Words & _M_grow_words (int __index, bool __iword)void _M_init () throw ()void _M_move (ios_base &) noexceptvoid _M_swap (ios_base &__rhs) noexceptvoid init (basic_streambuf< _CharT, _Traits > *__sb)β all setup is performed here. π οΈvoid move (basic_ios &&__rhs)void move (basic_ios &__rhs)basic_ios & operator= (const basic_ios &)=deletevoid set_rdbuf (basic_streambuf< _CharT, _Traits > *__sb)void swap (basic_ios &__rhs) noexcept
π Protected Attributes π
_Callback_list * _M_callbacksconst __ctype_type * _M_ctypeiostate _M_exceptionchar_type _M_fillbool _M_fill_initfmtflags _M_flagslocale _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>
class std::basic_ios< _CharT, _Traits >"Template class basic_ios,
virtual base class for all stream classes.
bestie, yes, that stray " is in the source text and we are keeping it exactly π
πΈ Template Parameters πΈ
_CharTβ type of character stream. π€_Traitsβ traits for character type, defaults tochar_traits<_CharT>. π§¬
Most of the member functions called dispatched on stream objects (e.g., std::cout.foo(bar);) are consolidated in this class. π
π MEMBER TYPEDEF DOCUMENTATION π
okay bestie, typedefs are literally just nicknames for types, and this class has a whole little friend group of them. some are "standard types" (blessed, portable, iconique) and some are "non-standard" (GCC's own little extras, iykyk). let's go π«Ά
__ctype_typeβtemplate<typename _CharT, typename _Traits> typedef ctype<_CharT> std::basic_ios<_CharT, _Traits>::__ctype_typeThese are non-standard types. π__num_get_typeβtemplate<typename _CharT, typename _Traits> typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > std::basic_ios<_CharT, _Traits>::__num_get_typeThese are non-standard types. π__num_put_typeβtemplate<typename _CharT, typename _Traits> typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > std::basic_ios<_CharT, _Traits>::__num_put_typeThese are non-standard types. πchar_typeβtemplate<typename _CharT, typename _Traits> typedef _CharT std::basic_ios<_CharT, _Traits>::char_typeThese are standard types. They permit a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. slay, standardized πevent_callbackβtypedef void(* std::ios_base::event_callback) (event __e, ios_base &__b, int __i) [inherited]The type of an event callback function. β¨
Parameters:
__eβ one of the members of 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(). so like, your callback gets a little invite to the party π
fmtflagsβtypedef _Ios_Fmtflags std::ios_base::fmtflags [inherited]This is a bitmask type._Ios_Fmtflagsis implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of typefmtflagsare:boolalphadecfixedhexinternalleftoctrightscientificshowbaseshowpointshowposskipwsunitbufuppercaseadjustfieldbasefieldfloatfield
int_typeβtemplate<typename _CharT, typename _Traits> typedef _Traits::int_type std::basic_ios<_CharT, _Traits>::int_typeThese are standard types. They permit a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. πiostateβtypedef _Ios_Iostate std::ios_base::iostate [inherited]This is a bitmask type._Ios_Iostateis implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of typeiostateare:badbiteofbitfailbitgoodbit
off_typeβtemplate<typename _CharT, typename _Traits> typedef _Traits::off_type std::basic_ios<_CharT, _Traits>::off_typeThese are standard types. They permit a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. π¦openmodeβtypedef _Ios_Openmode std::ios_base::openmode [inherited]This is a bitmask type._Ios_Openmodeis implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of typeopenmodeare:appatebinaryinouttrunc
pos_typeβtemplate<typename _CharT, typename _Traits> typedef _Traits::pos_type std::basic_ios<_CharT, _Traits>::pos_typeThese are standard types. They permit a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. πΈseekdirβtypedef _Ios_Seekdir std::ios_base::seekdir [inherited]This is an enumerated type._Ios_Seekdiris implementation-defined. Defined values of typeseekdirare:begcur, equivalent toSEEK_CURin the C standard library.end, equivalent toSEEK_ENDin the C standard library.
traits_typeβtemplate<typename _CharT, typename _Traits> typedef _Traits std::basic_ios<_CharT, _Traits>::traits_typeThese are standard types. They permit a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. π
π MEMBER ENUMERATION DOCUMENTATION π
enum std::ios_base::event [inherited]β the set of events that may be passed to an event callback.erase_eventis used during~ios()andcopyfmt().imbue_eventis used duringimbue().copyfmt_eventis used duringcopyfmt(). literally the three moods of an event callback πβ¨
π CONSTRUCTOR & DESTRUCTOR DOCUMENTATION π
template<typename _CharT, typename _Traits> std::basic_ios<_CharT, _Traits>::basic_ios (basic_streambuf<_CharT, _Traits> * __sb) [inline], [explicit]Constructor performs initialization. The parameter is passed by derived streams. π«Ά
References std::basic_ios<_CharT, _Traits>::init().
template<typename _CharT, typename _Traits> virtual std::basic_ios<_CharT, _Traits>::~basic_ios () [inline], [virtual]Empty. The destructor does nothing. More specifically, it does not destroy the streambuf held byrdbuf(). not me expecting it to clean up and it's just standing there πtemplate<typename _CharT, typename _Traits> std::basic_ios<_CharT, _Traits>::basic_ios () [inline], [protected]Empty. The default constructor does nothing and is not normally accessible to users. π
π MEMBER FUNCTION DOCUMENTATION π
const locale & std::ios_base::_M_getloc () const [inline], [inherited]Locale access. π
Returns a reference to the current locale.
Like getloc above, but returns a reference instead of generating a copy. lowkey a glow-up, no cap.
Referenced by std::money_get<_CharT, _InIter>::do_get(), std::time_get<_CharT, _InIter>::do_get(), std::num_get<_CharT, _InIter>::do_get(), std::time_get<_CharT, _InIter>::do_get_date(), std::time_get<_CharT, _InIter>::do_get_monthname(), std::time_get<_CharT, _InIter>::do_get_time(), std::time_get<_CharT, _InIter>::do_get_weekday(), std::time_get<_CharT, _InIter>::do_get_year(), std::num_put<_CharT, _OutIter>::do_put(), std::time_put<_CharT, _OutIter>::do_put(), std::time_get<_CharT, _InIter>::get(), and std::time_put<_CharT, _OutIter>::put(). that's a whole friend group right there π«
template<typename _CharT, typename _Traits> bool std::basic_ios<_CharT, _Traits>::bad () const [inline]Fast error checking. β‘
Returns true if the badbit is set.
Note that other iostate flags may also be set. so like, don't assume it's only badbit, bestie.
References std::ios_base::badbit, and std::basic_ios<_CharT, _Traits>::rdstate().
Referenced by std::basic_ostream<_CharT, _Traits>::sentry::sentry().
template<typename _CharT, typename _Traits> void std::basic_ios<_CharT, _Traits>::clear (iostate __state = goodbit)[Re]sets the error state. π
Parameters:
__stateβ the new state flag(s) to set.
See std::ios_base::iostate for the possible bit values. Most users will not need to pass an argument. (fr fr, just call it empty and move on π
)
Referenced by std::basic_ios<_CharT, _Traits>::exceptions(), std::basic_ifstream<_CharT, _Traits>::open(), std::basic_fstream<_CharT, _Traits>::open(), std::basic_ofstream<_CharT, _Traits>::open(), std::basic_ifstream<_CharT, _Traits>::open(), std::basic_fstream<_CharT, _Traits>::open(), std::basic_ofstream<_CharT, _Traits>::open(), std::__detail::operator>>(), std::basic_istream<_CharT, _Traits>::putback(), std::basic_istream<_CharT, _Traits>::seekg(), std::basic_istream<_CharT, _Traits>::seekg(), std::basic_ios<_CharT, _Traits>::setstate(), and std::basic_istream<_CharT, _Traits>::unget(). (yes, the open() and seekg() entries show up twice in the original list β we don't erase, we respect the source π)
template<typename _CharT, typename _Traits> basic_ios<_CharT, _Traits> & std::basic_ios<_CharT, _Traits>::copyfmt (const basic_ios<_CharT, _Traits> & __rhs)Copies fields of__rhsinto this. πβ¨
Parameters:
__rhsβ the source values for the copies.
Returns a reference to this object.
All fields of __rhs are copied into this object except that rdbuf() and rdstate() remain unchanged. All values in the pword and iword arrays are copied. Before copying, each callback is invoked with erase_event. After copying, each (new) callback is invoked with copyfmt_event. The final step is to copy exceptions(). it's giving "makeover montage" energy π
References std::__addressof(), std::basic_ios<_CharT, _Traits>::exceptions(), std::basic_ios<_CharT, _Traits>::fill(), std::ios_base::flags(), std::ios_base::getloc(), std::ios_base::precision(), std::basic_ios<_CharT, _Traits>::tie(), std::tie(), and std::ios_base::width().
template<typename _CharT, typename _Traits> bool std::basic_ios<_CharT, _Traits>::eof () const [inline]Fast error checking. β‘
Returns true if the eofbit is set.
Note that other iostate flags may also be set. again, don't assume, bestie π«Ά
References std::ios_base::eofbit, and std::basic_ios<_CharT, _Traits>::rdstate().
template<typename _CharT, typename _Traits> iostate std::basic_ios<_CharT, _Traits>::exceptions () const [inline]Throwing exceptions on errors. π€
Returns the current exceptions mask.
This changes nothing in the stream. See the one-argument version of exceptions(iostate) for the meaning of the return value.
Referenced by std::basic_ios<_CharT, _Traits>::copyfmt().
template<typename _CharT, typename _Traits> void std::basic_ios<_CharT, _Traits>::exceptions (iostate __except) [inline]Throwing exceptions on errors. π¨
Parameters:
__exceptβ the new exceptions mask.
By default, error flags are set silently. You can set an exceptions mask for each stream; if a bit in the mask becomes set in the error flags, then an exception of type std::ios_base::failure is thrown. so like, one minute everything's chill and the next: drama π
If the error flag is already set when the exceptions mask is added, the exception is immediately thrown. Try running the following under GCC 3.1 or later:
#include <iostream>
#include <fstream>
#include <exception>
int main()
{
std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
std::ifstream f ("/etc/motd");
std::cerr << "Setting badbit\n";
f.setstate (std::ios_base::badbit);
std::cerr << "Setting exception mask\n";
f.exceptions (std::ios_base::badbit);
}
References std::basic_ios<_CharT, _Traits>::clear().
template<typename _CharT, typename _Traits> bool std::basic_ios<_CharT, _Traits>::fail () const [inline]Fast error checking. β‘
Returns true if either the badbit or the failbit is set.
Checking the badbit in fail() is historical practice. Note that other iostate flags may also be set. yes it's a little quirky, it's grandfathered in, we love her anyway π
References std::ios_base::badbit, std::ios_base::failbit, and std::basic_ios<_CharT, _Traits>::rdstate().
Referenced by std::basic_ios<_CharT, _Traits>::operator bool(), std::basic_ios<_CharT, _Traits>::operator!(), std::basic_istream<_CharT, _Traits>::seekg(), std::basic_istream<_CharT, _Traits>::seekg(), std::basic_ostream<_CharT, _Traits>::seekp(), std::basic_ostream<_CharT, _Traits>::seekp(), std::basic_istream<_CharT, _Traits>::tellg(), std::basic_ostream<_CharT, _Traits>::tellp(), and std::regex_traits<_Ch_type>::value(). iconic crossover episode honestly π
char_type fill() const β the "what's my filler character" check β¨
Grabs the current fill character for you, bestie.
Returns: the current fill character, no cap.
Heads up: it defaults to a space (' ') in the current locale. So like, if you never set anything, you're getting a space. Iconic, minimal, reliable.
References: std::basic_ios< _CharT, _Traits >::widen().
Referenced by: std::basic_ios< _CharT, _Traits >::copyfmt(), and std::basic_ios< _CharT, _Traits >::fill().
char_type fill(char_type __ch) β setting a new filler π
Sets a brand-new empty character. Like a glow-up but for padding.
Parameters:
__chβ the new character.
Returns: the previous fill character (so you can put it back, we love a reversible slay).
So here's the tea on what fill actually does: the fill character is used to fill out space when P+ characters have been requested (think setw), Q characters are actually used, and Q<P. Big padding energy. It defaults to a space (' ') in the current locale.
References: std::basic_ios< _CharT, _Traits >::fill().
fmtflags std::ios_base::flags() const β [inherited] π
Access to format flags. The format-flag vault, unlocked.
Returns: the format control flags for both input and output. Yes, both. One blob of flags, both directions.
Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), std::num_put< _CharT, _OutIter >::do_put(), std::normal_distribution< double >::operator()(), std::operator<<(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), std::__detail::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), and std::operator>>(). (Yes the duplicates are real, that's literally what it says, iykyk.)
fmtflags std::ios_base::flags(fmtflags __fmtfl) β [inherited] π¦
Setting new format flags all at once. Bold. Decisive.
Parameters:
__fmtflβ the new flags to set.
Returns: the previous format control flags.
Real talk: this function overwrites all the format flags with __fmtfl. Not a merge, not a vibe check β a full overwrite. So if you were attached to your old flags, save them first.
locale std::ios_base::getloc() const β [inherited] π
Locale access, bestie. Who are you, culturally, as a stream?
Returns: a copy of the current locale.
The deets: if imbue(loc) has previously been called, then this function returns loc. Otherwise, it returns a copy of std::locale(), the global C++ locale.
Referenced by: std::basic_ios< _CharT, _Traits >::copyfmt(), std::money_put< _CharT, _OutIter >::do_put(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), and std::ws().
bool good() const β the fast vibe check π₯
Fast error checking, literally the speedrun version.
Returns: true if no error flags are set. That's it, that's the whole mood.
It's just a wrapper around rdstate.
References: std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and std::__detail::operator>>().
locale imbue(const locale & __loc) β moving to a new locale βοΈ
Glow-up relocation arc. New locale, new you.
Parameters:
__locβ the new locale.
Returns: the previous locale. (Catch it, it's falling.)
What it does under the hood: calls ios_base::imbue(loc), and if a stream buffer is associated with this stream, it calls that buffer's pubimbue(loc). So both layers get the memo.
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
References: std::ios_base::imbue().
Referenced by: std::chrono::operator<<().
void init(basic_streambuf< _CharT, _Traits > * __sb) β [protected] π§
All setup is performed here. Like, all of it. This is called from the public constructor.
Important: it is not virtual and cannot be redefined. Don't try it, bestie, it's not that kind of function.
Referenced by: std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ios< _CharT, _Traits >::basic_ios(), std::basic_istream< _CharT, _Traits >::basic_istream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ostream< _CharT, _Traits >::basic_ostream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream(), std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream(), and std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream().
(Three of each, because constructors come in threes, apparently. Periodt.)
long & std::ios_base::iword(int __ix) β [inherited] π
Access to the integer array. It's giving "just some integers, don't ask".
Parameters:
__ixβ index into the array.
Returns: a reference to an integer associated with the index.
So the iword function provides access to an array of integers that can be used for any purpose. The array grows as required to hold the supplied index, and all integers in the array are initialized to 0.
Two things, bestie, and they matter: the implementation reserves several indices β you should use xalloc to obtain an index that's safe to use. Also, since the array can grow dynamically, it is not safe to hold onto the reference. Let it go. π
char narrow(char_type __c, char __dfault) const β squeezing characters π§½
Squishes a char_type down into a char. Compression arc.
Parameters:
__cβ the character to narrow.__dfaultβ the character to narrow.
(Yes, the manpage genuinely gives the same one-liner for both. Not me, that's the source, fr fr.)
Returns: the narrowed character.
It maps a character of char_type to a character of char, if possible. And it returns the result of:
std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
operator bool() const β [explicit] π
The quick-and-easy status check. This lets you write constructs such as if (!a_stream) ... and while (a_stream) ... β which is, lowkey, the whole reason anyone loves streams.
References: std::basic_ios< _CharT, _Traits >::fail().
bool operator!() const β the little negation that could π
Also the quick-and-easy status check. This allows you to write constructs such as if (!a_stream) ... and while (a_stream) ....
Yeah, it's the same description as operator bool β they're twins, they share a wardrobe.
References: std::basic_ios< _CharT, _Traits >::fail().
streamsize std::ios_base::precision() const β [inherited] β
Flags access, the read-only flavour.
Returns: the precision to generate on certain output operations.
Careful, bestie: be careful if you try to give a definition of precision here; see DR 189. That's a whole thing, don't @ me.
Referenced by: std::basic_ios< _CharT, _Traits >::copyfmt(), and std::chrono::operator<<().
streamsize std::ios_base::precision(streamsize __prec) β [inherited] π
Changing flags, the setter edition.
Parameters:
__precβ the new precision value.
Returns: the previous value of precision(). Always handing you back the receipts.
void *& std::ios_base::pword(int __ix) β [inherited] π«Ά
Access to the void pointer array. Chaos storage, but make it indexed.
Parameters:
__ixβ index into the array.
Returns: a reference to a void* associated with the index.
The pword function provides access to an array of pointers that can be used for any purpose. The array grows as required to hold the supplied index. All pointers in the array are initialized to 0.
Same two warnings as its sibling: the implementation reserves several indices, so use xalloc to obtain an index that's safe to use. And because the array can grow dynamically, it is not safe to hold onto the reference. Truly do not bookmark it. π
basic_streambuf< _CharT, _Traits > * rdbuf() const β peeking at the buffer π
Accessing the underlying buffer. The main character behind the scenes.
Returns: the current stream buffer.
And listen: this does not change the state of the stream. Purely a look, no touch. Respectful.
Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< _CharT, _Traits >::get(), std::getline(), std::getline(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::tr2::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< char >::readsome(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_ostream< _CharT, _Traits >::tellp(), and std::ws().
That's a lot of friends. Popular function. πΈ
basic_streambuf< _CharT, _Traits > * rdbuf(basic_streambuf< _CharT, _Traits > * __sb) β swapping the buffer π
Changing the underlying buffer. The makeover episode.
Parameters:
__sbβ the new stream buffer.
Returns: the previous stream buffer.
It associates a new buffer with the current stream, and clears the error state. Two birds, one slay.
Okay so this next bit is wild and I need you to focus. Due to historical accidents which the LWG refuses to correct, the I/O library suffers from a design error: this function is hidden in derived classes by overrides of the zero-argument rdbuf(), which is non-virtual for hysterical raisins. As a result, you must use explicit qualifications to access this function via any derived class. For example:
std::fstream foo; // or some other derived type
std::streambuf* p = .....;
foo.ios::rdbuf(p); // ios == basic_ios<char>
That's a real quote, "hysterical raisins," we simply must stan. π§
iostate rdstate() const β the error state reveal π
Returns the error state of the stream buffer. The moment of truth.
Returns: a bit pattern (well, isn't everything?)
See std::ios_base::iostate for the possible bit values. Most users will call one of the interpreting wrappers, e.g., good() β because reading raw bit patterns is a whole personality type and honestly, most of us are not that.
Referenced by: the whole squad pulled up β std::basic_ios< _CharT, _Traits >::bad(), std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::fail(), std::basic_ios< _CharT, _Traits >::good(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_istream< _CharT, _Traits >::unget(). π
void std::ios_base::register_callback (event_callback __fn, int __index) [inherited]
Okay bestie, this one adds the callback __fn and gives it the parameter __index. Like putting your friend's number in the group chat so they get pinged too.
Parameters
__fnβ The function to add. π«Ά__indexβ The integer to pass to the function when invoked.
So the vibe is: you register a function as an event callback, and it comes with an integer parameter that gets handed to the function whenever it's invoked. Multiple copies of the function are allowed β no gatekeeping π. And if there are multiple callbacks, they're invoked in the order they were registered. First come, first served. Periodt.
fmtflags std::ios_base::setf (fmtflags __fmtfl) [inline], [inherited]
Setting new format flags. β¨
Parameters
__fmtflβ Additional flags to set.
Returns
- The previous format control flags.
This function sets additional flags in format control. Flags that were previously set remain set β nothing gets unset, it's purely additive, like stacking bracelets. π
Referenced by std::__detail::operator>>().
fmtflags std::ios_base::setf (fmtflags __fmtfl, fmtflags __mask) [inline], [inherited]
Setting new format flags, but make it surgical. βοΈ
Parameters
__fmtflβ Additional flags to set.__maskβ The flags mask 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. So you're literally saying "wipe this specific zone, then drop these bits in" β very targeted, very main character. π
template<typename _CharT , typename _Traits > void std::basic_ios< _CharT, _Traits >::setstate (iostate __state) [inline]
Sets additional flags in the error state. π¨
Parameters
__stateβ The additional state flag(s) to set.
See std::ios_base::iostate for the possible bit values β that's where the whole menu of state bits lives.
References std::basic_ios< _CharT, _Traits >::clear(), and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by β grab a snack, this list is long π:
std::basic_istream< _CharT, _Traits >::sentry::sentry()std::basic_ostream< _CharT, _Traits >::sentry::sentry()std::basic_ostream< _CharT, _Traits >::sentry::~sentry()std::basic_ifstream< _CharT, _Traits >::close()std::basic_ofstream< _CharT, _Traits >::close()std::basic_fstream< _CharT, _Traits >::close()std::basic_ostream< _CharT, _Traits >::flush()std::basic_istream< _CharT, _Traits >::get()std::basic_istream< _CharT, _Traits >::get()std::getline()std::getline()std::basic_ifstream< _CharT, _Traits >::open()std::basic_fstream< _CharT, _Traits >::open()std::basic_ofstream< _CharT, _Traits >::open()std::basic_ifstream< _CharT, _Traits >::open()std::basic_fstream< _CharT, _Traits >::open()std::basic_ofstream< _CharT, _Traits >::open()std::operator<<()std::basic_ostream< _CharT, _Traits >::operator<<()std::operator<<()std::basic_istream< _CharT, _Traits >::operator>>()std::operator>>()std::operator>>()std::operator>>()std::operator>>()std::basic_istream< _CharT, _Traits >::operator>>()std::tr2::operator>>()std::basic_ostream< _CharT, _Traits >::put()std::basic_istream< _CharT, _Traits >::putback()std::basic_istream< _CharT, _Traits >::read()std::basic_istream< _CharT, _Traits >::readsome()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::seekg()std::basic_ostream< _CharT, _Traits >::seekp()std::basic_ostream< _CharT, _Traits >::seekp()std::basic_istream< _CharT, _Traits >::sync()std::ws()
static bool std::ios_base::sync_with_stdio (bool __sync = true) [static], [inherited]
Interaction with the standard C I/O objects. π€
Parameters
__syncβ Whether to synchronize or not.
Returns
- True if the standard streams were previously synchronized.
Okay so real talk: the synchronization referred to is only that between the standard C facilities (e.g., stdout) and the standard C++ objects (e.g., cout). User-declared streams are unaffected β they're off living their own life, not in this situationship. π
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > * std::basic_ios< _CharT, _Traits >::tie () const [inline]
Fetches the current tied stream. π
Returns
- A pointer to the tied stream, or
NULLif the stream is not tied.
Here's the lore: a stream may be tied (or synchronized) to a second output stream. When this stream performs any I/O, the tied stream is first flushed. For example, std::cin is tied to std::cout. So yeah β reading from cin flushes cout first, that's the whole reason your prompt shows up before it blocks. iykyk π
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and std::basic_ios< _CharT, _Traits >::copyfmt().
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > * std::basic_ios< _CharT, _Traits >::tie (basic_ostream< _CharT, _Traits > * __tiestr) [inline]
Ties this stream to an output stream. π
Parameters
__tiestrβ The output stream.
Returns
- The previously tied output stream, or
NULLif the stream was not tied.
This sets up a new tie; see tie() for more. Yes it's the same name β that's not a typo, that's overloading being iconic. β¨
void std::ios_base::unsetf (fmtflags __mask) [inline], [inherited]
Clearing format flags. π§Ή
Parameters
__maskβ The flags to unset.
This function clears __mask in the format flags. That's it, that's the function. Sometimes the simplest self-care is just unsetting a mask. π
template<typename _CharT , typename _Traits > char_type std::basic_ios< _CharT, _Traits >::widen (char __c) const [inline]
Widens characters. π¦
Parameters
__cβ The character to widen.
Returns
- The widened character.
Maps a character of char to a character of char_type.
Returns the result of
std::use_facet<ctype<char_type> >(getloc()).widen(c)
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
Referenced by std::endl(), std::basic_ios< _CharT, _Traits >::fill(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::getline(), std::getline(), std::basic_istream< _CharT, _Traits >::getline(), std::operator<<(), std::operator<<(), and std::tr2::operator>>().
streamsize std::ios_base::width () const [inline], [inherited]
Flags access. π
Returns
- The minimum field width to generate on output operations.
Minimum field width refers to the number of characters β not pixels, not vibes, characters. β¨
Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_put< _CharT, _OutIter >::do_put(), std::operator>>(), and std::operator>>().
streamsize std::ios_base::width (streamsize __wide) [inline], [inherited]
Changing flags. π
Parameters
__wideβ The new width value.
Returns
- The previous value of
width().
Set a new width, get handed back the old one like a little receipt. π§Ύ
static int std::ios_base::xalloc () [static], [inherited]
Access to unique indices. π
Returns
- An integer different from all previous calls.
This function returns a unique integer every time it is called. It can be used for any purpose, but is primarily intended to be a unique index for the iword and pword functions. The expectation is that an application calls xalloc in order to obtain an index in the iword and pword arrays that can be used without fear of conflict. No fighting over storage, we don't do that here. π«Ά
The implementation maintains a static variable that is incremented and returned on each invocation. xalloc is guaranteed to return an index that is safe to use in the iword and pword arrays. Guaranteed. No cap. π―
π Member Data Documentation π
const fmtflags std::ios_base::adjustfield [static], [inherited]
A mask of left|right|internal. Useful for the 2-arg form of setf.
Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::internal(), std::left(), and std::right().
const openmode std::ios_base::app [static], [inherited]
Seek to end before each write. π
Referenced by std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), std::basic_filebuf< _CharT, _Traits >::overflow(), and std::basic_filebuf< _CharT, _Traits >::xsputn().
const openmode std::ios_base::ate [static], [inherited]
Open and seek to end immediately after opening. π
Referenced by std::basic_filebuf< _CharT, _Traits >::open().
const iostate std::ios_base::badbit [static], [inherited]
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file). π It's giving "the file said no and meant it."
Referenced by:
std::basic_istream< _CharT, _Traits >::sentry::sentry()std::basic_ostream< _CharT, _Traits >::sentry::~sentry()std::basic_ios< _CharT, _Traits >::bad()std::basic_ios< _CharT, _Traits >::fail()std::basic_ostream< _CharT, _Traits >::flush()std::basic_istream< _CharT, _Traits >::get()std::basic_istream< char >::get()std::basic_istream< _CharT, _Traits >::get()std::basic_ostream< _CharT, _Traits >::operator<<()std::operator>>()std::basic_istream< _CharT, _Traits >::operator>>()std::basic_ostream< _CharT, _Traits >::put()std::basic_istream< _CharT, _Traits >::putback()std::basic_istream< _CharT, _Traits >::read()std::basic_istream< _CharT, _Traits >::readsome()std::basic_istream< char >::seekg()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::sync()std::basic_istream< char >::tellg()std::basic_istream< _CharT, _Traits >::tellg()std::ws()
const fmtflags std::ios_base::basefield [static], [inherited]
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
Referenced by std::dec(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), std::hex(), and std::oct().
const seekdir std::ios_base::beg [static], [inherited]
Request a seek relative to the beginning of the stream. π
Referenced by std::basic_filebuf< _CharT, _Traits >::seekpos().
const openmode std::ios_base::binary [static], [inherited]
Perform input and output in binary mode (as opposed to text mode). β οΈ
This is probably not what you think it is; see https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary
Like, genuinely, read the link before you go making assumptions bestie. π
Referenced by std::basic_filebuf< _CharT, _Traits >::showmanyc().
const fmtflags std::ios_base::boolalpha [static], [inherited]
Insert/extract bool in alphabetic rather than numeric format. So true/false instead of 1/0. Obsessed. π¦
Referenced by std::boolalpha(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), and std::noboolalpha().
const seekdir std::ios_base::cur [static], [inherited]
Request a seek relative to the current position within the sequence. π
Referenced by std::basic_filebuf< _CharT, _Traits >::imbue(), std::basic_filebuf< _CharT, _Traits >::overflow(), std::basic_filebuf< _CharT, _Traits >::pbackfail(), std::basic_filebuf< _CharT, _Traits >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_istream< _CharT, _Traits >::tellg(), and std::basic_ostream< _CharT, _Traits >::tellp().
const fmtflags std::ios_base::dec [static] [inherited]
Okay so this one converts integer input or generates integer output in decimal base. That's the boring base-10 one your math teacher loved. π
Referenced by std::dec().
const seekdir std::ios_base::end [static] [inherited]
Request a seek relative to the current end of the sequence β like, "start from the back bestie." π
Referenced by std::basic_filebuf< _CharT, _Traits >::open(), and std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff().
const iostate std::ios_base::eofbit [static] [inherited]
Indicates that an input operation reached the end of an input sequence. Basically the stream going "that's it, that's the whole thing, nothing left." π
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::time_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_date(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_time(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::basic_ios< _CharT, _Traits >::eof(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::time_get< _CharT, _InIter >::get(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< char >::sync(), std::basic_istream< _CharT, _Traits >::unget(), and std::ws().
const iostate std::ios_base::failbit [static] [inherited]
Indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters. Not a slay. π The vibe check did not pass.
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), std::basic_ifstream< _CharT, _Traits >::close(), std::basic_ofstream< _CharT, _Traits >::close(), std::basic_fstream< _CharT, _Traits >::close(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::basic_ios< _CharT, _Traits >::fail(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::time_get< _CharT, _InIter >::get(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_fstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_fstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), and std::basic_ostream< _CharT, _Traits >::seekp().
const fmtflags std::ios_base::fixed [static] [inherited]
Generate floating-point output in fixed-point notation. The "no surprises, no vibes, just digits" of the float world. π
Referenced by std::fixed(), and std::hexfloat().
const fmtflags std::ios_base::floatfield [static] [inherited]
A mask of scientific|fixed. Useful for the 2-arg form of setf. That's literally the whole thing, bestie, it's a mask. β¨
Referenced by std::defaultfloat(), std::fixed(), std::hexfloat(), and std::scientific().
const iostate std::ios_base::goodbit [static] [inherited]
Indicates all is well. The main character state. The "we're so back" of stream states. π (Also note: it's the value zero of iostate, which is why it's a "bit" that's never actually set as a flag β but the man page just says all is well, so: all is well π.)
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::time_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< _CharT, _Traits >::get(), std::time_get< _CharT, _InIter >::get(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< char >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< _CharT, _Traits >::unget(), and std::ws().
const fmtflags std::ios_base::hex [static] [inherited]
Converts integer input or generates integer output in hexadecimal base. For when you want to feel like a hacker in a movie. ππ₯
Referenced by std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), and std::hex().
const openmode std::ios_base::in [static] [inherited]
Open for input. Default for ifstream and fstream. Reading era. π
Referenced by std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_filebuf< _CharT, _Traits >::pbackfail(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_filebuf< _CharT, _Traits >::showmanyc(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::showmanyc(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_filebuf< _CharT, _Traits >::underflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::underflow(), and std::basic_filebuf< _CharT, _Traits >::xsgetn().
const fmtflags std::ios_base::internal [static] [inherited]
Adds fill characters at a designated internal point in certain generated output, or is identical to right if no such point is designated. Ngl this is the weird one and I love her for it. π¦
Referenced by std::internal().
const fmtflags std::ios_base::left [static] [inherited]
Adds fill characters on the right (final positions) of certain generated output. (I.e., the thing you print is flush left.) π
Referenced by std::num_put< _CharT, _OutIter >::do_put(), and std::left().
const fmtflags std::ios_base::oct [static] [inherited]
Converts integer input or generates integer output in octal base. Eight is great, apparently. π
Referenced by std::oct().
const openmode std::ios_base::out [static] [inherited]
Open for output. Default for ofstream and fstream. Writing era, we love to see it. βοΈ
Referenced by std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), std::basic_ofstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::basic_filebuf< _CharT, _Traits >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::pbackfail(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_ostream< _CharT, _Traits >::tellp(), and std::basic_filebuf< _CharT, _Traits >::xsputn().
const fmtflags std::ios_base::right [static] [inherited]
Adds fill characters on the left (initial positions) of certain generated output. (I.e., the thing you print is flush right.) πΈ
Referenced by std::right().
const fmtflags std::ios_base::scientific [static] [inherited]
Generates floating-point output in scientific notation. 1.23e+45 core. π¬β¨
Referenced by std::hexfloat(), and std::scientific().
const fmtflags std::ios_base::showbase [static] [inherited]
Generates a prefix indicating the numeric base of generated integer output. So like, 0x and friends show up to the party uninvited but correct. π
Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::noshowbase(), and std::showbase().
const fmtflags std::ios_base::showpoint [static] [inherited]
Generates a decimal-point character unconditionally in generated floating-point output. Even when it's unnecessary. She's extra and we respect it. π
Referenced by std::noshowpoint(), and std::showpoint().
const fmtflags std::ios_base::showpos [static] [inherited]
Generates a + sign in non-negative generated numeric output. Positivity influencer behavior fr fr. π
Referenced by std::noshowpos(), and std::showpos().
const fmtflags std::ios_base::skipws [static] [inherited]
Skips leading white space before certain input operations. Self-care for your parser: ignore the noise first. π§
Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::noskipws(), std::__detail::operator>>(), and std::skipws().
const openmode std::ios_base::trunc [static] [inherited]
Truncate an existing stream when opening. Default for ofstream. Yes it means what you think it means: the old contents are gone gone. β οΈ Handle with care bestie, this one does not do second chances.
Truncation is destructive. Opening with trunc on an existing file throws away its contents β that's the documented behavior, not a bug. π
const fmtflags std::ios_base::unitbuf [static] [inherited]
Flushes output after each output operation. Oversharer energy: nothing stays buffered, everything goes out immediately. π£οΈ
Referenced by std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::nounitbuf(), and std::unitbuf().
const fmtflags std::ios_base::uppercase [static] [inherited]
Replaces certain lowercase letters with their uppercase equivalents in generated output. LOUDER. π’
Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::nouppercase(), and std::uppercase().
π«Ά AUTHOR (who even wrote this)
Generated automatically by Doxygen for libstdc++ from the source code. No human author, just β¨ automation β¨ doing its little thing.
And that's the whole page, bestie! π Every last static constant of std::ios_base that std::basic_ios< _CharT, _Traits > inherited, all accounted for, nothing skipped, no cap. π
This whole thing comes straight out of the libstdc++ docs β auto-generated by Doxygen from the source code β and the source/version stamp plus the date are sitting right there in the footer at the bottom of the page (under that slightly cursed libststd::basic_ios< _CharT, _Traits >(3cxx) line, iykyk π). Go read your streams, drink some water, and remember: check failbit. π¦π
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms