STD::BASIC_ISTREAM(3cxx)
๐ std::basic_istream< _CharT, _Traits > ๐
hey bestie ๐ this is the (3cxx) manual page for std::basic_istream< _CharT, _Traits > โ part 1, and we're gonna get through it together, no cap โจ
๐ NAME ๐
std::basic_istream< _CharT, _Traits > โ Template class basic_istream. that's the whole name section, periodt ๐
๐ธ SYNOPSIS ๐ธ
#include <istream>
Inherits std::basic_ios< _CharT, _Traits >.
Inherited by std::basic_iostream< char >, std::basic_ifstream< _CharT,
_Traits >, std::basic_iostream< _CharT, _Traits >, and
std::basic_istringstream< _CharT, _Traits, _Alloc >.
๐ Classes ๐
class sentryโ Performs setup work for input streams. literally the little pre-show helper for input streams ๐ซถ
๐ฆ Public Types ๐ฆ
typedef ctype< _CharT > __ctype_typetypedef basic_ios< _CharT, _Traits > __ios_typetypedef basic_istream< _CharT, _Traits > __istream_typetypedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_typetypedef basic_streambuf< _CharT, _Traits > __streambuf_typetypedef _CharT char_typeenum event { erase_event, imbue_event, copyfmt_event }โ The set of events that may be passed to an event callback. event girlies, this is your list ๐ซtypedef void(* event_callback) (event __e, ios_base &__b, int __i)โ The type of an event callback function.typedef _Ios_Fmtflags fmtflagsโ This is a bitmask type.typedef _Traits::int_type int_typetypedef _Ios_Iostate iostateโ This is a bitmask type.typedef _Traits::off_type off_typetypedef _Ios_Openmode openmodeโ This is a bitmask type.typedef _Traits::pos_type pos_typetypedef _Ios_Seekdir seekdirโ This is an enumerated type.typedef _Traits traits_typetypedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type
๐ Public Member Functions ๐
basic_istream (__streambuf_type *__sb)โ Base constructor. the classic "gimme a streambuf and let's go" move ๐virtual ~basic_istream ()โ Base destructor.template<typename _ValueT > basic_istream< _CharT, _Traits > & _M_extract (_ValueT &__v)โ the extract helper signature, exactly as the page says it.const locale & _M_getloc () constโ Locale access.void _M_setstate (iostate __state)โ state-setting helper signature, no extra description attached on this page.bool bad () constโ Fast error checking. is the stream in a bad-bad mood? ๐ญ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. specifically the end-of-file check, bestie.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.streamsize gcount () constโ Character counting.basic_istream< char > & getline (char_type *__s, streamsize __n, char_type __delim)โ Explicit specialization declarations, defined insrc/istream.cc.basic_istream< wchar_t > & getline (char_type *__s, streamsize __n, char_type __delim)โ thewchar_tspecialization declaration.locale getloc () constโ Locale access.bool good () constโ Fast error checking. the "everything's chill" check โจbasic_istream< char > & ignore (streamsize __n)โ thecharspecialization declaration for ignoring input.basic_istream< wchar_t > & ignore (streamsize __n)โ thewchar_tspecialization declaration for ignoring input.basic_istream< char > & ignore (streamsize __n, int_type __delim)โ thecharspecialization declaration with a delimiter.basic_istream< wchar_t > & ignore (streamsize __n, int_type __delim)โ thewchar_tspecialization declaration with a delimiter.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.__istream_type & operator>> (__streambuf_type *__sb)โ Extracting into another streambuf.__istream_type & operator>> (void *&__p)โ Basic arithmetic extractors.streamsize precision () constโ Flags access.streamsize precision (streamsize __prec)โ Changing flags.void *& pword (int __ix)โ Access to void pointer array.basic_streambuf< _CharT, _Traits > * rdbuf () constโ Accessing the underlying buffer.basic_streambuf< _CharT, _Traits > * rdbuf (basic_streambuf< _CharT, _Traits > *__sb)โ Changing the underlying buffer.iostate rdstate () constโ Returns the error state of the stream buffer.void register_callback (event_callback __fn, int __index)โ Add the callback__fnwith parameter__index.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.__istream_type & operator>> (__istream_type &(*__pf)(__istream_type &))โ Interface for manipulators.__istream_type & operator>> (__ios_type &(*__pf)(__ios_type &))โ Interface for manipulators.__istream_type & operator>> (ios_base &(*__pf)(ios_base &))โ Interface for manipulators.
๐ฅ Extractors ๐ฅ
All the operator>> functions (aka formatted input functions) have some common behavior. Each starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to false. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more.
If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument.
If an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state (without causing an ios_base::failure to be thrown) and the original exception will be rethrown if badbit is set in the exceptions mask.
โ ๏ธ bestie, that exception note is important:badbitgets set, but that does not mean anios_base::failuregets thrown there. the original exception comes back ifbadbitis set in the exceptions mask. no cap.
__istream_type & operator>> (bool &__n)โ Integer arithmetic extractors.__istream_type & operator>> (short &__n)โ Integer arithmetic extractors.__istream_type & operator>> (unsigned short &__n)โ Integer arithmetic extractors.__istream_type & operator>> (int &__n)โ Integer arithmetic extractors.__istream_type & operator>> (unsigned int &__n)โ Integer arithmetic extractors.__istream_type & operator>> (long &__n)โ Integer arithmetic extractors.__istream_type & operator>> (unsigned long &__n)โ Integer arithmetic extractors.__istream_type & operator>> (long long &__n)โ Integer arithmetic extractors.__istream_type & operator>> (unsigned long long &__n)โ Integer arithmetic extractors.__istream_type & operator>> (float &__f)โ Floating point arithmetic extractors.__istream_type & operator>> (double &__f)โ Floating point arithmetic extractors.__istream_type & operator>> (long double &__f)โ Floating point arithmetic extractors.
๐ Unformatted Input Functions ๐
All the unformatted input functions have some common behavior. Each starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to true. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more.
If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument.
The number of characters extracted is stored for later retrieval by gcount().
If an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state (without causing an ios_base::failure to be thrown) and the original exception will be rethrown if badbit is set in the exceptions mask.
int_type get ()โ Simple extraction.__istream_type & get (char_type &__c)โ Simple extraction.__istream_type & get (char_type *__s, streamsize __n, char_type __delim)โ Simple multiple-character extraction.__istream_type & get (char_type *__s, streamsize __n)โ Simple multiple-character extraction.__istream_type & get (__streambuf_type &__sb, char_type __delim)โ Extraction into another streambuf.__istream_type & get (__streambuf_type &__sb)โ Extraction into another streambuf.__istream_type & getline (char_type *__s, streamsize __n, char_type __delim)โ String extraction.__istream_type & getline (char_type *__s, streamsize __n)โ String extraction.__istream_type & ignore (streamsize __n, int_type __delim)โ Discarding characters.__istream_type & ignore (streamsize __n)โ Simple extraction.__istream_type & ignore ()โ Simple extraction.int_type peek ()โ Looking ahead in the stream.__istream_type & read (char_type *__s, streamsize __n)โ Extraction without delimiters.streamsize readsome (char_type *__s, streamsize __n)โ Extraction until the buffer is exhausted, but no more.__istream_type & putback (char_type __c)โ Unextracting a single character.__istream_type & unget ()โ Unextracting the previous character.int sync ()โ Synchronizing the stream buffer.pos_type tellg ()โ Getting the current read position.__istream_type & seekg (pos_type)โ Changing the current read position.__istream_type & seekg (off_type, ios_base::seekdir)โ Changing the current read position.operator bool () constโ The quick-and-easy status check.bool operator! () constโ The quick-and-easy status check.
๐ 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 โจ
Okay bestie, these are the shared, class-wide constants of <ios_base> โ every single one of them is static const, so nobody in the group chat gets to edit them. Periodt. ๐
static const openmode __noreplaceโ literally no blurb in the docs for this one, she's mysterious, we move ๐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. ๐ฆ the vibe check passed, we love to see itstatic 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 }โ that's the whole thing. No description, no notes, just vibes and an internal word-size constant. ๐ธ
๐ Protected Member Functions ๐
basic_istream (basic_istream &&__rhs)basic_istream (const basic_istream &)=delete)โ nope, copying is deleted, do not attempt ๐ซ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 ()void _M_move (ios_base &) noexceptvoid _M_swap (ios_base &__rhs) noexceptvoid init (basic_streambuf< _CharT, _Traits > *__sb)โ all setup is performed here. that's it, that's the whole job description โจvoid move (basic_ios &&__rhs)void move (basic_ios &__rhs)basic_istream & operator= (basic_istream &&__rhs)basic_istream & operator= (const basic_istream &)=deleteโ again: copy assignment is deleted, bestie. it's giving "we are NOT doing that" ๐void set_rdbuf (basic_streambuf< _CharT, _Traits > *__sb)void swap (basic_ios &__rhs) noexceptvoid swap (basic_istream &__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
๐ซถ Friends ๐ซถ
class sentryโ our one and only friend. iconic. ๐
๐ Detailed Description ๐
template<typename _CharT, typename _Traits>
class std::basic_istream< _CharT, _Traits >"Template class
basic_istream.
Template Parameters
- _CharT โ type of character stream.
- _Traits โ traits for character type, defaults to
char_traits<_CharT>.
So like, this is the base class for all input streams, no cap. It provides text formatting of all builtin types, and it communicates with any class derived from basic_streambuf to do the actual input. She's the main character, the rest are supporting cast. ๐
๐ฆ Member Typedef Documentation ๐ฆ
__num_put_type
template<typename _CharT , typename _Traits > typedef num_put<_CharT,
ostreambuf_iterator<_CharT, _Traits> > std::basic_ios< _CharT, _Traits
>::__num_put_type [inherited]
These are non-standard types. (iykyk โ they're libstdc++'s own little house specials ๐)
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().
fmtflags
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
iostate
typedef _Ios_Iostate std::ios_base::iostate [inherited]
This is a bitmask type. _Ios_Iostate is implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of type iostate are:
badbiteofbitfailbitgoodbit
openmode
typedef _Ios_Openmode std::ios_base::openmode [inherited]
This is a bitmask type. _Ios_Openmode is implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of type openmode are:
appatebinaryinouttrunc
seekdir
typedef _Ios_Seekdir std::ios_base::seekdir [inherited]
This is an enumerated type. _Ios_Seekdir is implementation-defined. Defined values of type seekdir are:
begcur, equivalent toSEEK_CURin the C standard library.end, equivalent toSEEK_ENDin the C standard library.
โญ Member Enumeration Documentation โญ
enum std::ios_base::event [inherited]
The set of events that may be passed to an event callback. erase_event is used during ~ios() and copyfmt(). imbue_event is used during imbue(). copyfmt_event is used during copyfmt().
๐ธ Constructor & Destructor Documentation ๐ธ
basic_istream
template<typename _CharT , typename _Traits > std::basic_istream< _CharT,
_Traits >::basic_istream (__streambuf_type * __sb) [inline], [explicit]
Base constructor. This ctor is almost never called by the user directly โ rather from derived classes' initialization lists, which pass a pointer to their own stream buffer.
References std::basic_ios< _CharT, _Traits >::init().
~basic_istream
template<typename _CharT , typename _Traits > virtual std::basic_istream<
_CharT, _Traits >::~basic_istream () [inline], [virtual]
Base destructor. This does very little apart from providing a virtual base dtor. lowkey she's just here to exist ๐
References std::basic_istream< _CharT, _Traits >::_M_gcount.
๐ Member Function Documentation ๐
_M_getloc
const locale & std::ios_base::_M_getloc () const [inline], [inherited]
Locale access.
Returns
A reference to the current locale.
Like getloc above, but returns a reference instead of generating a copy. ๐
Referenced by std::money_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_date(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_time(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::num_put< _CharT, _OutIter >::do_put(), std::time_put< _CharT, _OutIter >::do_put(), std::time_get< _CharT, _InIter >::get(), and std::time_put< _CharT, _OutIter >::put().
bad
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
_Traits >::bad () const [inline], [inherited]
Fast error checking. โก
Returns
True if the badbit is set.
Careful bestie: note that other iostate flags may also be set. So don't go reading this as "only badbit, nothing else."
References std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by std::basic_ostream< _CharT, _Traits >::sentry::sentry().
clear
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.
Okay bestie, before we move on, this lilโ function is living rent-free in a bunch of other functionsโ heads โ itโs giving main character energy. Hereโs the full name-drop squad (yes, duplicates and all, we donโt edit the guest list):
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()std::basic_istream< _CharT, _Traits >::unget()
๐
basic_ios::copyfmt
template<typename _CharT , typename _Traits > basic_ios< _CharT, _Traits > &
std::basic_ios< _CharT, _Traits >::copyfmt (const basic_ios< _CharT, _Traits > & __rhs) [inherited]
Copies fields of __rhs into this. Itโs literally the โcopy their whole vibeโ function, no cap.
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().
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()std::ios_base::width()
๐ฆ basic_ios::eof
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
_Traits >::eof () const [inline], [inherited]
Fast error checking. Itโs giving โare we at the end?โ energy.
Returns: True if the eofbit is set.
Note that other iostate flags may also be set. So donโt assume itโs only EOF, bestie.
References:
std::ios_base::eofbitstd::basic_ios< _CharT, _Traits >::rdstate()
โจ basic_ios::exceptions (const version)
template<typename _CharT , typename _Traits > iostate std::basic_ios<
_CharT, _Traits >::exceptions () const [inline], [inherited]
Throwing exceptions on errors. This one just peeks at the mask, it doesnโt touch anything.
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()
๐ basic_ios::exceptions (mask-setting version)
template<typename _CharT , typename _Traits > void std::basic_ios< _CharT,
_Traits >::exceptions (iostate __except) [inline], [inherited]
Throwing exceptions on errors. This is the one where you actually set the mask.
Parameters:
__exceptโ The new exceptions mask.
By default, error flags are set silently. You can set an exceptions mask for each stream; if a bit in the mask becomes set in the error flags, then an exception of type std::ios_base::failure is thrown.
If the error flag is already set when the exceptions mask is added, the exception is immediately thrown. Try running the following under GCC 3.1 or later:
#include <iostream>
#include <fstream>
#include <exception>
int main()
{
std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
std::ifstream f ("/etc/motd");
std::cerr << "Setting badbit\n";
f.setstate (std::ios_base::badbit);
std::cerr << "Setting exception mask\n";
f.exceptions (std::ios_base::badbit);
}
References:
std::basic_ios< _CharT, _Traits >::clear()
๐ basic_ios::fail
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
_Traits >::fail () const [inline], [inherited]
Fast error checking. This is the โdid something go wrong?โ vibe check.
Returns: True if either the badbit or the failbit is set.
Checking the badbit in fail() is historical practice. Note that other iostate flags may also be set.
References:
std::ios_base::badbitstd::ios_base::failbitstd::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()std::regex_traits< _Ch_type >::value()
๐ธ basic_ios::fill (const)
template<typename _CharT , typename _Traits > char_type std::basic_ios<
_CharT, _Traits >::fill () const [inline], [inherited]
Retrieves the empty character. The โwhat are we padding with?โ queen.
Returns: The current fill character.
It defaults to a space (' ') in the current locale.
References:
std::basic_ios< _CharT, _Traits >::widen()
Referenced by:
std::basic_ios< _CharT, _Traits >::copyfmt()std::basic_ios< _CharT, _Traits >::fill()
๐ง basic_ios::fill (setter)
template<typename _CharT , typename _Traits > char_type std::basic_ios<
_CharT, _Traits >::fill (char_type __ch) [inline], [inherited]
Sets a new empty character. Changing the padding vibe, iconic.
Parameters:
__chโ The new character.
Returns: The previous fill character.
The fill character is used to fill out space when P+ characters have been requested (e.g., via setw), Q characters are actually used, and Q<P. It defaults to a space (' ') in the current locale.
References:
std::basic_ios< _CharT, _Traits >::fill()
โญ ios_base::flags (getter)
fmtflags std::ios_base::flags () const [inline], [inherited]
Access to format flags. Peeking at the format control settings, no biggie.
Returns: The format control flags for both input and output.
Referenced by (a whole crowd):
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>>()std::operator>>()std::operator>>()
๐ฅ ios_base::flags (setter)
fmtflags std::ios_base::flags (fmtflags __fmtfl) [inline], [inherited]
Setting new format flags all at once. Itโs a full glow-up for the flags.
Parameters:
__fmtflโ The new flags to set.
Returns: The previous format control flags.
This function overwrites all the format flags with __fmtfl. No merge, just replace, periodt.
๐ basic_istream::gcount
template<typename _CharT , typename _Traits > streamsize std::basic_istream<
_CharT, _Traits >::gcount () const [inline]
Character counting. Itโs literally counting how many characters got extracted last time.
Returns: The number of characters extracted by the previous unformatted input function dispatched for this stream.
References:
std::basic_istream< _CharT, _Traits >::_M_gcount
๐ basic_istream::get (no args)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
>::int_type std::basic_istream< _CharT, _Traits >::get (void)
Simple extraction. Grabbing one character, lowkey.
Returns: A character, or eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
References:
std::basic_istream< _CharT, _Traits >::_M_gcountstd::ios_base::badbitstd::ios_base::eofbitstd::ios_base::failbitstd::ios_base::goodbitstd::basic_ios< _CharT, _Traits >::rdbuf()std::basic_ios< _CharT, _Traits >::setstate()
Referenced by:
std::basic_istream< _CharT, _Traits >::get()std::basic_istream< _CharT, _Traits >::get()
๐ฆ basic_istream::get (streambuf)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb) [inline]
Extraction into another streambuf. Sending the characters to a different spot.
Parameters:
__sbโ A streambuf in which to store data.
Returns: *this
Returns get(__sb,widen('\n')).
References:
std::basic_istream< _CharT, _Traits >::get()std::basic_ios< _CharT, _Traits >::widen()
๐ basic_istream::get (streambuf + delim)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb,
char_type __delim)
Extraction into another streambuf. Same energy, but now with a stop character.
Parameters:
__sbโ A streambuf in which to store data.__delimโ A 'stop' character.
Returns: *this
Characters are extracted and inserted into __sb until one of the following happens:
- the input sequence reaches EOF
- insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted)
- the next character equals
__delim(in this case, the character is not extracted) - an exception occurs (and in this case is caught)
If no characters are stored, failbit is set in the stream's error state.
References:
std::basic_istream< _CharT, _Traits >::_M_gcountstd::ios_base::goodbit
๐ basic_istream::get (char ref)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::get (char_type & __c)
Simple extraction. One character, stored right into __c.
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 on signed char and unsigned char.
References:
std::basic_istream< _CharT, _Traits >::_M_gcountstd::ios_base::badbitstd::ios_base::eofbitstd::ios_base::failbitstd::ios_base::goodbitstd::basic_ios< _CharT, _Traits >::rdbuf()std::basic_ios< _CharT, _Traits >::setstate()
๐ basic_istream::get (char array)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::get (char_type * __s, streamsize
__n) [inline]
Simple multiple-character extraction. Itโs the group-chat version of get โ more than one character at a time.
Parameters:
__sโ Pointer to an array.__nโ Maximum number of characters to store ins.
Returns: *this
Returns get(__s,__n,widen('\n')).
References:
std::basic_istream< _CharT, _Traits >::get()std::basic_ios< _CharT, _Traits >::widen()
๐ basic_istream::get (char array + delim)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::get (char_type * __s,
streamsize __n, char_type __delim)
Simple multiple-character extraction. Same array vibe, but you get to pick the stop character.
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 on signed char and unsigned char.
References:
std::basic_istream< _CharT, _Traits >::_M_gcountstd::ios_base::goodbitstd::basic_ios< _CharT, _Traits >::rdbuf()std::basic_streambuf< _CharT, _Traits >::sgetc()
๐ getline โ string extraction (the short one)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::getline (char_type * __s,
streamsize __n) [inline]
okay so this one is the cutie little two-arg version of string extraction โจ
- Parameters
__sโ a character array in which to store the data ๐ซถ__nโ maximum number of characters to extract
- Returns โ
*this
Literally just returns getline(__s,__n,widen('\n')). That's the whole vibe, no cap ๐
References std::basic_istream< _CharT, _Traits >::getline(), and std::basic_ios< _CharT, _Traits >::widen().
๐ getline โ string extraction (the full version, with the delimiter)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::getline (char_type * __s,
streamsize __n, char_type __delim)
- Parameters
__sโ a character array in which to store the data ๐ธ__nโ maximum number of characters to extract__delimโ a 'stop' character
- Returns โ
*this
So it extracts and stores characters into __s until one of these things happens. And bestie, listen โ these criteria are required to be tested in the order listed here, specifically so that an input line can exactly fill the __s array without setting failbit. Order matters, iykyk ๐
- the input sequence reaches end-of-file, in which case
eofbitis set in the stream error state - the next character equals
__delim, in which case the character is extracted (and therefore counted ingcount()) but not stored __n-1characters are stored, in which casefailbitis set in the stream error state
If no characters are extracted, failbit is set. (An empty line of input should therefore not cause failbit to be set โ love that for us fr fr.)
In any case, a null character is stored in the next location in the array. periodt โจ
Referenced by std::basic_istream< _CharT, _Traits >::getline().
๐ฆ getline โ the char specialization
basic_istream< char > & std::basic_istream< char >::getline (char_type *
__s, streamsize __n, char_type __delim)
Explicit specialization declarations, defined in src/istream.cc. that's it that's the whole thing ๐
๐ง getloc โ locale access
locale std::ios_base::getloc () const [inline], [inherited]
- Returns โ a copy of the current locale ๐
If imbue(loc) has previously been called, then this function returns loc. Otherwise, it returns a copy of std::locale(), the global C++ locale. iconic behaviour honestly.
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().
โญ good โ fast error checking
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
_Traits >::good () const [inline], [inherited]
- Returns โ
Trueif no error flags are set โ
It's a wrapper around rdstate. simple, clean, no drama.
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>>().
๐
ignore โ simple extraction (no args)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::ignore (void)
- Returns โ a character, or
eof()
Tries to extract a character. If none are available, sets failbit and returns traits::eof(). ๐ญ
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sbumpc().
๐ ignore โ simple extraction (with a count)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n)
- Returns โ a character, or
eof()
Tries to extract a character. If none are available, sets failbit and returns traits::eof(). same energy, different overload ๐ซ
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().
๐ฅ ignore โ discarding characters (count + delimiter)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n,
int_type __delim)
- Parameters
__nโ number of characters to discard__delimโ a 'stop' character
- Returns โ
*this
Extracts characters and throws them away (bye bestie ๐) 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(in this case, the character is extracted); note that this condition will never occur if__delimequalstraits::eof()
NB: provide three overloads, instead of the single function (with defaults) mandated by the Standard โ this leads to a better performing implementation, while still conforming to the Standard. slay ๐
๐ธ imbue โ moving to a new locale
template<typename _CharT , typename _Traits > locale std::basic_ios< _CharT,
_Traits >::imbue (const locale & __loc) [inherited]
- Parameters
__locโ the new locale
- Returns โ the previous locale
Calls ios_base::imbue(loc), and if a stream buffer is associated with this stream, calls that buffer's pubimbue(loc).
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html ๐ฆ
References std::ios_base::imbue().
Referenced by std::chrono::operator<<().
๐ init โ all the setup, performed here
template<typename _CharT , typename _Traits > void std::basic_ios< _CharT,
_Traits >::init (basic_streambuf< _CharT, _Traits > * __sb) [protected],
[inherited]
All setup is performed here. This is called from the public constructor. It is not virtual and cannot be redefined. no notes, main character energy only โจ
Referenced by โ okay this list is lowkey a lot, but we keep every single one, no skipping:
std::basic_fstream< _CharT, _Traits >::basic_fstream()std::basic_fstream< _CharT, _Traits >::basic_fstream()std::basic_fstream< _CharT, _Traits >::basic_fstream()std::basic_ifstream< _CharT, _Traits >::basic_ifstream()std::basic_ifstream< _CharT, _Traits >::basic_ifstream()std::basic_ifstream< _CharT, _Traits >::basic_ifstream()std::basic_ios< _CharT, _Traits >::basic_ios()std::basic_istream< _CharT, _Traits >::basic_istream()std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream()std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream()std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream()std::basic_ofstream< _CharT, _Traits >::basic_ofstream()std::basic_ofstream< _CharT, _Traits >::basic_ofstream()std::basic_ofstream< _CharT, _Traits >::basic_ofstream()std::basic_ostream< _CharT, _Traits >::basic_ostream()std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream()std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream()std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream()std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream()std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream()std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream()
(yes the repeats are real, that's literally how it's listed ๐)
๐ iword โ access to 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. like, do not get attached, she moves ๐
๐ง 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
- Returns โ the narrowed character
Maps a character of char_type to a character of char, if possible.
Returns the result of
std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html ๐
๐ operator bool โ the quick-and-easy status check
template<typename _CharT , typename _Traits > std::basic_ios< _CharT,
_Traits >::operator bool () const [inline], [explicit], [inherited]
The quick-and-easy status check. This allows you to write constructs such as if (!a_stream) ... and while (a_stream) ... โ genuinely so convenient, obsessed โจ
References std::basic_ios< _CharT, _Traits >::fail().
๐ operator! โ the other quick-and-easy status check
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
_Traits >::operator! () const [inline], [inherited]
The quick-and-easy status check. This allows you to write constructs such as if (!a_stream) ... and while (a_stream) ... ๐ซถ
References std::basic_ios< _CharT, _Traits >::fail().
โญ operator>> โ interface for manipulators (the __ios_type one)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (__ios_type
&(*)(__ios_type &) __pf) [inline]
Interface for manipulators. Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header. ๐
๐ฆ operator>> โ interface for manipulators (the __istream_type one)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (__istream_type
&(*)(__istream_type &) __pf) [inline]
Interface for manipulators. Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header. ๐ธ
๐ฅ operator>> โ extracting into another streambuf
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::operator>> (__streambuf_type
* __sb)
- 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__sbisNULL, the stream will setfailbitin 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>> โ integer arithmetic extractors (bool)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (bool & __n) [inline]
- Parameters
__nโ a variable of builtin integral type
- Returns โ
*thisif successful โ
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. that's the whole tea, bestie ๐ตโจ
๐ operator>>(double& __f)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (double & __f)
[inline]
Floating point arithmetic extractors, bestie ๐
- Parameters โ
__f: a variable of builtin floating point type. - Returns โ
*thisif successful.
These functions use the stream's current locale to parse the input data (specifically, the num_get facet). iykyk โจ
๐ธ operator>>(float& __f)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (float & __f) [inline]
Floating point arithmetic extractors ๐
- Parameters โ
__f: a variable of builtin floating point type. - Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ operator>>(int& __n)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::operator>> (int & __n)
Integer arithmetic extractors ๐ฅ
- Parameters โ
__n: a variable of builtin integral type. - Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. no cap.
๐ฆ operator>>(ios_base& (*__pf)(ios_base&))
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (ios_base
&(*)(ios_base &) __pf) [inline]
Interface for manipulators, periodt โจ Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header.
๐ operator>>(long& __n)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long & __n) [inline]
Integer arithmetic extractors ๐
- Parameters โ
__n: a variable of builtin integral type. - Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ operator>>(long double& __f)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long double & __f)
[inline]
Floating point arithmetic extractors ๐
- Parameters โ
__f: a variable of builtin floating point type. - Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data. literally the same slay as before but bigger ๐
โญ operator>>(long long& __n)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long long & __n)
[inline]
Integer arithmetic extractors โจ
- Parameters โ
__n: a variable of builtin integral type. - Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ง operator>>(short& __n)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::operator>> (short & __n)
Integer arithmetic extractors ๐ซถ
- Parameters โ
__n: a variable of builtin integral type. - Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
References: std::ios_base::badbit, std::ios_base::failbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
okay this one's got the extra bit set energy โ badbit, failbit, goodbit, all of it ๐
๐บ operator>>(unsigned int& __n)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned int & __n)
[inline]
Integer arithmetic extractors ๐
- Parameters โ
__n: a variable of builtin integral type. - Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ operator>>(unsigned long& __n)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned long & __n)
[inline]
Integer arithmetic extractors โจ
- Parameters โ
__n: a variable of builtin integral type. - Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ operator>>(unsigned long long& __n)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned long long &
__n) [inline]
Integer arithmetic extractors ๐ฅ
- Parameters โ
__n: a variable of builtin integral type. - Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ฆ operator>>(unsigned short& __n)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned short & __n)
[inline]
Integer arithmetic extractors ๐
- Parameters โ
__n: a variable of builtin integral type. - Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ operator>>(void*& __p)
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (void *& __p) [inline]
Basic arithmetic extractors ๐
- Parameters โ
__p: a variable of pointer type. - Returns โ
*thisif successful.
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
๐ peek()
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
>::int_type std::basic_istream< _CharT, _Traits >::peek (void)
Looking ahead in the stream ๐ no touching, just vibes.
- Returns โ the next character, or
eof().
If, after constructing the sentry object, good() is false, returns traits::eof(). Otherwise reads but does not extract the next input character. Like window shopping for characters, bestie ๐๏ธ
References: std::basic_istream< _CharT, _Traits >::_M_gcount.
๐ std::ios_base::precision() const
streamsize std::ios_base::precision () const [inline], [inherited]
Flags access โจ
- Returns โ the precision to generate on certain output operations.
โ ๏ธ Be careful if you try to give a definition of precision here; see DR 189. (the standard committee said "not today" ๐ญ)
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 ๐
- Parameters โ
__prec: the new precision value. - Returns โ the previous value of
precision().
it's giving "here's your old one back, thanks for the trade" ๐ซถ
โฉ๏ธ putback(char_type __c)
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::putback (char_type __c)
Unextracting a single character ๐ญ yes, "unextracting" is a real word here, we love a glow-up in reverse.
- 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. periodt.
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_streambuf< _CharT, _Traits >::sputbackc().
Referenced by: std::operator<<().
๐ซง std::ios_base::pword(int __ix)
void *& std::ios_base::pword (int __ix) [inline], [inherited]
Access to void pointer array ๐ฏ
- Parameters โ
__ix: index into the array. - Returns โ a reference to a
void*associated with the index.
The pword function provides access to an array of pointers that can be used for any purpose. The array grows as required to hold the supplied index. All pointers in the array are initialized to 0.
The implementation reserves several indices. You should use xalloc to obtain an index that is safe to use. Also note that since the array can grow dynamically, it is not safe to hold onto the reference. ๐ like holding a balloon that might get relocated mid-party.
๐งบ rdbuf() const
template<typename _CharT , typename _Traits > basic_streambuf< _CharT,
_Traits > * std::basic_ios< _CharT, _Traits >::rdbuf () const [inline],
[inherited]
Accessing the underlying buffer ๐
- Returns โ the current stream buffer.
This does not change the state of the stream. zero drama, just peek at the buffer ๐
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().
like, literally everyone wants a piece of this function ๐ญ main character energy fr.
๐ rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
template<typename _CharT , typename _Traits > basic_streambuf< _CharT,
_Traits > * std::basic_ios< _CharT, _Traits >::rdbuf (basic_streambuf<
_CharT, _Traits > * __sb) [inherited]
Changing the underlying buffer ๐
- Parameters โ
__sb: the new stream buffer. - Returns โ the previous stream buffer.
Associates a new buffer with the current stream, and clears the error state.
๐ 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>
"hysterical raisins" lives in my head rent free ๐๐ญ
๐ฆ rdstate() const
template<typename _CharT , typename _Traits > iostate std::basic_ios<
_CharT, _Traits >::rdstate () const [inline], [inherited]
Returns the error state of the stream buffer.
- Returns โ a bit pattern (well, isn't everything?) โจ
See std::ios_base::iostate for the possible bit values. Most users will call one of the interpreting wrappers, e.g., good(). slay.
Referenced by std::basic_ios< _CharT, _Traits >::bad(), std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::fail(), std::basic_ios< _CharT, _Traits >::good(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_istream< _CharT, _Traits >::unget(). Thatโs the whole little guest list, bestie ๐
.
read โ extraction without delimiters โจ
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::read (char_type * __s, streamsize __n)
Okay so this one is extraction without delimiters, no cap. ๐
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 these things happens:
__ncharacters are stored- the input sequence reaches end-of-file, in which case the error state is set to
failbit|eofbit.
Note: this function is not overloaded onsigned charandunsigned char. ๐
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
readsome โ extraction until the buffer is exhausted, but no more ๐ฆ
template<typename _CharT , typename _Traits > streamsize std::basic_istream< _CharT, _Traits >::readsome (char_type * __s, streamsize __n)
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 how many characters are 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. Main character buffer energy, honestly. โจ
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::min(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
register_callback โ add the callback __fn with parameter __index ๐
void std::ios_base::register_callback (event_callback __fn, int __index)
(inherited)
Parameters
__fnโ the function to add.__indexโ the integer to pass to the function when invoked.
Registers a function as an event callback with an integer parameter to be passed to the function when invoked. Multiple copies of the function are allowed. If there are multiple callbacks, they are invoked in the order they were registered. Order matters, bestie โ the callbacks are literally queued in registration order. ๐
seekg โ changing the current read position ๐ธ
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::seekg (off_type __off, ios_base::seekdir __dir)
Parameters
__offโ a file offset object.__dirโ the direction in which to seek.
Returns
*this
If fail() is not true, calls rdbuf()->pubseekoff(__off,__dir). If that function fails, sets failbit.
Note: this function first clearseofbit. It does not count the number of characters extracted, if any, and therefore does not affect the next call togcount(). ๐
References: std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), and std::basic_ios< _CharT, _Traits >::setstate().
seekg โ changing the current read position, position-object edition ๐ฆ
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::seekg (pos_type __pos)
Parameters
__posโ a file position object.
Returns
*this
If fail() is not true, calls rdbuf()->pubseekpos(__pos). If that function fails, sets failbit.
Note: this function first clearseofbit. It does not count the number of characters extracted, if any, and therefore does not affect the next call togcount(). ๐ซถ
References: std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), and std::basic_ios< _CharT, _Traits >::setstate().
setf โ setting new format flags ๐
fmtflags std::ios_base::setf (fmtflags __fmtfl)
(inline, inherited)
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. Stack โem, donโt replace โem, basically. โจ
Referenced by: std::__detail::operator>>().
setf โ setting new format flags with a mask ๐
fmtflags std::ios_base::setf (fmtflags __fmtfl, fmtflags __mask)
(inline, inherited)
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. Mask on, flags set, previous flags returned โ sheโs organized. ๐
setstate โ sets additional flags in the error state ๐ฅ
template<typename _CharT , typename _Traits > void std::basic_ios< _CharT, _Traits >::setstate (iostate __state)
(inline, inherited)
Parameters
__stateโ the additional state flag(s) to set.
See std::ios_base::iostate for the possible bit values.
References: std::basic_ios< _CharT, _Traits >::clear(), and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ifstream< _CharT, _Traits >::close(), std::basic_ofstream< _CharT, _Traits >::close(), std::basic_fstream< _CharT, _Traits >::close(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::getline(), std::getline(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_fstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::basic_ifstream< _CharT, _Traits >::open(), std::basic_fstream< _CharT, _Traits >::open(), std::basic_ofstream< _CharT, _Traits >::open(), std::operator<<(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::tr2::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_istream< _CharT, _Traits >::sync(), and std::ws().
That is a whole crowd of references, bestie โ sheโs popular. ๐
sync โ synchronizing the stream buffer โญ
template<typename _CharT , typename _Traits > int std::basic_istream< _CharT, _Traits >::sync (void)
Returns
0 on success, -1 on failure.
If rdbuf() is a null pointer, returns -1.
Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit and returns -1.
Otherwise, returns 0.
Note: this function does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount(). ๐ญ
References: std::ios_base::badbit, std::ios_base::goodbit, std::basic_streambuf< _CharT, _Traits >::pubsync(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
sync_with_stdio โ interaction with the standard C I/O objects ๐
static bool std::ios_base::sync_with_stdio (bool __sync = true)
(static, inherited)
Parameters
__syncโ whether to synchronize or not.
Returns
True if the standard streams were previously synchronized.
The synchronization referred to is only that between the standard C facilities (e.g., stdout) and the standard C++ objects (e.g., cout). User-declared streams are unaffected. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary.
Only the standard ones, okay? Your own little streams are living their own lives. ๐ฆ
tellg โ getting the current read position ๐
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits >::pos_type std::basic_istream< _CharT, _Traits >::tellg (void)
Returns
A file position object.
If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,in).
Note: this function does not count the number of characters extracted, if any, and therefore does not affect the next call togcount(). At variance withputback,ungetandseekg,eofbitis not cleared first. ๐
References: std::ios_base::badbit, std::ios_base::cur, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::in, and std::basic_ios< _CharT, _Traits >::rdbuf().
tie โ fetches the current tied stream ๐ธ
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > * std::basic_ios< _CharT, _Traits >::tie () const
(inline, inherited)
Returns
A pointer to the tied stream, or NULL if the stream is not tied.
A stream may be tied (or synchronized) to a second output stream. When this stream performs any I/O, the tied stream is first flushed. For example, std::cin is tied to std::cout. Itโs giving โflush your bestie before you readโ energy. ๐
Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and std::basic_ios< _CharT, _Traits >::copyfmt().
tie โ ties this stream to an output stream ๐ซถ
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > * std::basic_ios< _CharT, _Traits >::tie (basic_ostream< _CharT, _Traits > * __tiestr)
(inline, inherited)
Parameters
__tiestrโ the output stream.
Returns
The previously tied output stream, or NULL if the stream was not tied.
This sets up a new tie; see tie() for more. New tie, who dis โ but it still hands back the old one. โจ
unget โ unextracting the previous character ๐
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::unget (void)
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. Put it back or catch these bad vibes, bestie. ๐ญ
Note ๐ก โ This function first clearseofbit. Since no characters are extracted, the next call togcount()will return0, as required by DR 60.
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by: std::__detail::operator>>().
๐ Member Data Documentation ๐
Okay bestie, this is the data-member section, and yes, it's giving "long but important." Every declaration, every reference list, every little inherited flag โ all here, no skips. ๐ซถ
template<typename _CharT , typename _Traits > streamsize std::basic_istream< _CharT, _Traits >::_M_gcount[protected] โ the number of characters extracted in the previous unformatted function; seegcount().- Referenced by:
std::basic_istream< _CharT, _Traits >::~basic_istream(),std::basic_istream< _CharT, _Traits >::gcount(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< char >::get(),std::basic_istream< char >::ignore(),std::basic_istream< _CharT, _Traits >::ignore(),std::basic_istream< _CharT, _Traits >::ignore(),std::basic_istream< char >::operator>>(),std::basic_istream< _CharT, _Traits >::peek(),std::basic_istream< _CharT, _Traits >::putback(),std::basic_istream< char >::putback(),std::basic_istream< _CharT, _Traits >::read(),std::basic_istream< _CharT, _Traits >::readsome(),std::basic_istream< char >::readsome(),std::basic_istream< char >::sync(), andstd::basic_istream< _CharT, _Traits >::unget().
- Referenced by:
const fmtflags std::ios_base::adjustfield[static], [inherited] โ a mask ofleft|right|internal; useful for the 2-arg form ofsetf.- Referenced by:
std::num_put< _CharT, _OutIter >::do_put(),std::internal(),std::left(), andstd::right().
- Referenced by:
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(), andstd::basic_filebuf< _CharT, _Traits >::xsputn().
- Referenced by:
const openmode std::ios_base::ate[static], [inherited] โ open and seek to end immediately after opening.- Referenced by:
std::basic_filebuf< _CharT, _Traits >::open().
- Referenced by:
const iostate std::ios_base::badbit[static], [inherited] โ indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file).- Referenced by:
std::basic_istream< _CharT, _Traits >::sentry::sentry(),std::basic_ostream< _CharT, _Traits >::sentry::~sentry(),std::basic_ios< _CharT, _Traits >::bad(),std::basic_ios< _CharT, _Traits >::fail(),std::basic_ostream< _CharT, _Traits >::flush(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< char >::get(),std::basic_istream< _CharT, _Traits >::get(),std::basic_ostream< _CharT, _Traits >::operator<<(),std::operator>>(),std::basic_istream< _CharT, _Traits >::operator>>(),std::basic_ostream< _CharT, _Traits >::put(),std::basic_istream< _CharT, _Traits >::putback(),std::basic_istream< _CharT, _Traits >::read(),std::basic_istream< _CharT, _Traits >::readsome(),std::basic_istream< char >::seekg(),std::basic_istream< _CharT, _Traits >::seekg(),std::basic_istream< _CharT, _Traits >::seekg(),std::basic_istream< _CharT, _Traits >::sync(),std::basic_istream< char >::tellg(),std::basic_istream< _CharT, _Traits >::tellg(), andstd::ws().
- Referenced by:
const fmtflags std::ios_base::basefield[static], [inherited] โ a mask ofdec|oct|hex; useful for the 2-arg form ofsetf.- Referenced by:
std::dec(),std::num_get< _CharT, _InIter >::do_get(),std::num_put< _CharT, _OutIter >::do_put(),std::hex(), andstd::oct().
- Referenced by:
const seekdir std::ios_base::beg[static], [inherited] โ request a seek relative to the beginning of the stream.- Referenced by:
std::basic_filebuf< _CharT, _Traits >::seekpos().
- Referenced by:
const openmode std::ios_base::binary[static], [inherited] โ perform input and output in binary mode (as opposed to text mode). This is probably not what you think it is; see https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary.- Referenced by:
std::basic_filebuf< _CharT, _Traits >::showmanyc().
- Referenced by:
const fmtflags std::ios_base::boolalpha[static], [inherited] โ insert/extractboolin alphabetic rather than numeric format.- Referenced by:
std::boolalpha(),std::num_get< _CharT, _InIter >::do_get(),std::num_put< _CharT, _OutIter >::do_put(), andstd::noboolalpha().
- Referenced by:
const seekdir std::ios_base::cur[static], [inherited] โ 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(), andstd::basic_ostream< _CharT, _Traits >::tellp().
- Referenced by:
const fmtflags std::ios_base::dec[static], [inherited] โ converts integer input or generates integer output in decimal base.- Referenced by:
std::dec().
- Referenced by:
const seekdir std::ios_base::end[static], [inherited] โ request a seek relative to the current end of the sequence.- Referenced by:
std::basic_filebuf< _CharT, _Traits >::open(), andstd::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff().
- Referenced by:
const iostate std::ios_base::eofbit[static], [inherited] โ indicates that an input operation reached the end of an input sequence.- Referenced by:
std::basic_istream< _CharT, _Traits >::sentry::sentry(),std::time_get< _CharT, _InIter >::do_get(),std::num_get< _CharT, _InIter >::do_get(),std::num_get< _CharT, _InIter >::do_get(),std::num_get< _CharT, _InIter >::do_get(),std::num_get< _CharT, _InIter >::do_get(),std::time_get< _CharT, _InIter >::do_get_date(),std::time_get< _CharT, _InIter >::do_get_monthname(),std::time_get< _CharT, _InIter >::do_get_time(),std::time_get< _CharT, _InIter >::do_get_weekday(),std::time_get< _CharT, _InIter >::do_get_year(),std::basic_ios< _CharT, _Traits >::eof(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< char >::get(),std::time_get< _CharT, _InIter >::get(),std::basic_istream< _CharT, _Traits >::ignore(),std::basic_istream< _CharT, _Traits >::operator>>(),std::operator>>(),std::basic_istream< _CharT, _Traits >::putback(),std::basic_istream< _CharT, _Traits >::read(),std::basic_istream< _CharT, _Traits >::readsome(),std::basic_istream< _CharT, _Traits >::seekg(),std::basic_istream< _CharT, _Traits >::seekg(),std::basic_istream< char >::sync(),std::basic_istream< _CharT, _Traits >::unget(), andstd::ws().
- Referenced by:
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.- Referenced by:
std::basic_istream< _CharT, _Traits >::sentry::sentry(),std::basic_ostream< _CharT, _Traits >::sentry::sentry(),std::basic_ifstream< _CharT, _Traits >::close(),std::basic_ofstream< _CharT, _Traits >::close(),std::basic_fstream< _CharT, _Traits >::close(),std::num_get< _CharT, _InIter >::do_get(),std::time_get< _CharT, _InIter >::do_get_monthname(),std::time_get< _CharT, _InIter >::do_get_weekday(),std::time_get< _CharT, _InIter >::do_get_year(),std::basic_ios< _CharT, _Traits >::fail(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< _CharT, _Traits >::get(),std::basic_istream< char >::get(),std::time_get< _CharT, _InIter >::get(),std::basic_ifstream< _CharT, _Traits >::open(),std::basic_fstream< _CharT, _Traits >::open(),std::basic_ofstream< _CharT, _Traits >::open(),std::basic_ifstream< _CharT, _Traits >::open(),std::basic_fstream< _CharT, _Traits >::open(),std::basic_ofstream< _CharT, _Traits >::open(),std::operator<<(),std::basic_istream< _CharT, _Traits >::operator>>(),std::operator>>(),std::basic_istream< _CharT, _Traits >::operator>>(),std::basic_istream< _CharT, _Traits >::read(),std::basic_istream< _CharT, _Traits >::seekg(),std::basic_istream< _CharT, _Traits >::seekg(),std::basic_ostream< _CharT, _Traits >::seekp(), andstd::basic_ostream< _CharT, _Traits >::seekp().
- Referenced by:
const fmtflags std::ios_base::fixed[static], [inherited] โ generate floating-point output in fixed-point notation.- Referenced by:
std::fixed(), andstd::hexfloat().
- Referenced by:
const fmtflags std::ios_base::floatfield[static], [inherited] โ a mask ofscientific|fixed; useful for the 2-arg form ofsetf.- Referenced by:
std::defaultfloat(),std::fixed(),std::hexfloat(), andstd::scientific().
- Referenced by:
const iostate std::ios_base::goodbit[static],[inherited]โ the โeverything is literally fineโ state: Indicates all is well. ๐
Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::time_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< _CharT, _Traits >::get(), std::time_get< _CharT, _InIter >::get(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< char >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< _CharT, _Traits >::unget(), and std::ws().
const fmtflags std::ios_base::hex[static],[inherited]โ hexadecimal era: Converts integer input or generates integer output in hexadecimal base. ๐งฎ
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. ๐ช
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]โ the โput the fill in the middleโ option: Adds fill characters at a designated internal point in certain generated output, or identical to right if no such point is designated. ๐ฏ
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]โ octal moment: Converts integer input or generates integer output in octal base. ๐
Referenced by: std::oct().
const openmode std::ios_base::out[static],[inherited]โ open for output. Default for ofstream and fstream. ๐ค
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]โ science-y float energy: Generates floating-point output in scientific notation. ๐ฌ
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. ๐ท๏ธ
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. ๐ง
Referenced by: std::noshowpoint(), and std::showpoint().
const fmtflags std::ios_base::showpos[static],[inherited]โ Generates a + sign in non-negative generated numeric output. โ
Referenced by: std::noshowpos(), and std::showpos().
const fmtflags std::ios_base::skipws[static],[inherited]โ Skips leading white space before certain input operations. ๐ซง
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. โ๏ธ NoReferenced bylist on this one.const fmtflags std::ios_base::unitbuf[static],[inherited]โ Flushes output after each output operation. ๐ฝโจ
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. ๐
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. ๐
Source/version tea โ: this page says it was generated automatically by Doxygen for libstdc++ from the source code, and the footer tag is libstdstd::basic_ist...harT, _Traits >(3cxx). Date slot: not printed here, so no invented date โ periodt. ๐โจ
๐ฆ 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