STD::BASIC_FSTREAM(3cxx)
๐
std::basic_fstream< _CharT, _Traits > โ the 3cxx manual page ๐
okay so bestie, welcome to the group chat for std::basic_fstream< _CharT, _Traits >, the cxx manual page. This is your file-stream bestie: controlling input and output for files, periodt. ๐
๐ธ NAME ๐ธ
std::basic_fstream< _CharT, _Traits > โ literally controlling input and output for files. That's the whole assignment. ๐
โจ SYNOPSIS โจ
#include <fstream>
It inherits std::basic_iostream< _CharT, _Traits >. Yes ma'am, that's the family tree. ๐ฆ
๐ฆ Public Types ๐ฆ
okay so these are the public typedefs and enum vibes, all listed with their exact signatures because we do not skip the boring parts in this house. ๐
typedef ctype< _CharT > __ctype_typetypedef ctype< _CharT > __ctype_typeโ yes bestie, it appears twice in the manual, and we're keeping both. No erasure. ๐typedef basic_filebuf< char_type, traits_type > __filebuf_typetypedef basic_ios< char_type, traits_type > __ios_typetypedef basic_iostream< char_type, traits_type > __iostream_typetypedef basic_istream< _CharT, _Traits > __istream_typetypedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_typetypedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_typetypedef basic_ostream< _CharT, _Traits > __ostream_typetypedef basic_streambuf< _CharT, _Traits > __streambuf_typetypedef basic_streambuf< _CharT, _Traits > __streambuf_typeโ another repeat, another crumb kept. ๐ซถtypedef _CharT char_typeenum event { erase_event, imbue_event, copyfmt_event }โ the set of events that may be passed to an event callback.typedef void(* event_callback) (event __e, ios_base &__b, int __i)โ the type of an event callback function.typedef _Ios_Fmtflags fmtflagsโ this is a bitmask type.typedef traits_type::int_type int_typetypedef _Ios_Iostate iostateโ this is a bitmask type.typedef traits_type::off_type off_typetypedef _Ios_Openmode openmodeโ this is a bitmask type.typedef traits_type::pos_type pos_typetypedef _Ios_Seekdir seekdirโ this is an enumerated type.typedef _Traits traits_type
and then there's this lil repeat hanging out at the bottom:
typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type
๐ฅ Public Member Functions ๐ฅ
deep breath bestie, because this is the big list. Every single one is here, no skips, no "oops I forgot one." ๐
basic_fstream ()โ default constructor.basic_fstream (basic_fstream &&__rhs)template<typename _Path , typename _Require = _If_fs_path<_Path>> basic_fstream (const _Path &__s, ios_base::openmode __mode=ios_base::in|ios_base::out)โ create an input/output file stream.basic_fstream (const basic_fstream &)=deletebasic_fstream (const char *__s, ios_base::openmode __mode=ios_base::in|ios_base::out)โ create an input/output file stream.basic_fstream (const std::string &__s, ios_base::openmode __mode=ios_base::in|ios_base::out)โ create an input/output file stream.~basic_fstream ()โ the destructor does nothing. she's literally just vibing. ๐template<typename _ValueT > basic_istream< _CharT, _Traits > & _M_extract (_ValueT &__v)const locale & _M_getloc () constโ locale access.template<typename _ValueT > basic_ostream< _CharT, _Traits > & _M_insert (_ValueT __v)void _M_setstate (iostate __state)bool bad () constโ fast error checking.void clear (iostate __state=goodbit)โ [Re]sets the error state.void close ()โ close the file.basic_ios & copyfmt (const basic_ios &__rhs)โ copies fields of__rhsintothis.bool eof () constโ fast error checking.iostate exceptions () constโ throwing exceptions on errors.void exceptions (iostate __except)โ throwing exceptions on errors.bool fail () constโ fast error checking.char_type fill () constโ retrieves the empty character.char_type fill (char_type __ch)โ sets a new empty character.fmtflags flags () constโ access to format flags.fmtflags flags (fmtflags __fmtfl)โ setting new format flags all at once.__ostream_type & flush ()โ synchronizing the stream buffer.streamsize gcount () constโ character counting.basic_istream< char > & getline (char_type *__s, streamsize __n, char_type __delim)โ explicit specialization declarations, defined insrc/istream.cc.basic_istream< wchar_t > & getline (char_type *__s, streamsize __n, char_type __delim)locale getloc () constโ locale access.bool good () constโ fast error checking.basic_istream< char > & ignore (streamsize __n)basic_istream< wchar_t > & ignore (streamsize __n)basic_istream< char > & ignore (streamsize __n, int_type __delim)basic_istream< wchar_t > & ignore (streamsize __n, int_type __delim)locale imbue (const locale &__loc)โ moves to a new locale.bool is_open ()โ wrapper to test for an open file.bool is_open () constlong & iword (int __ix)โ access to integer array.char narrow (char_type __c, char __dfault) constโ squeezes characters.template<typename _Path > _If_fs_path< _Path, void > open (const _Path &__s, ios_base::openmode __mode=ios_base::in|ios_base::out)โ opens an external file.void open (const char *__s, ios_base::openmode __mode=ios_base::in|ios_base::out)โ opens an external file.void open (const std::string &__s, ios_base::openmode __mode=ios_base::in|ios_base::out)โ opens an external file.__ostream_type & operator<< (__streambuf_type *__sb)โ extracting from another streambuf.__ostream_type & operator<< (const void *__p)โ pointer arithmetic inserters.__ostream_type & operator<< (nullptr_t)basic_fstream & operator= (basic_fstream &&__rhs)basic_fstream & operator= (const basic_fstream &)=delete__istream_type & operator>> (__streambuf_type *__sb)โ extracting into another streambuf.__istream_type & operator>> (void *&__p)โ basic arithmetic extractors.streamsize precision () constโ flags access.streamsize precision (streamsize __prec)โ changing flags.void *& pword (int __ix)โ access to void pointer array.__filebuf_type * rdbuf () constโ accessing the underlying buffer.basic_streambuf< _CharT, _Traits > * rdbuf (basic_streambuf< _CharT, _Traits > *__sb)โ changing the underlying buffer.iostate rdstate () constโ returns the error state of the stream buffer.void register_callback (event_callback __fn, int __index)โ add the callback__fnwith parameter__index.__ostream_type & seekp (off_type, ios_base::seekdir)โ changing the current write position.__ostream_type & seekp (pos_type)โ changing the current write position.fmtflags setf (fmtflags __fmtfl)โ setting new format flags.fmtflags setf (fmtflags __fmtfl, fmtflags __mask)โ setting new format flags.void setstate (iostate __state)โ sets additional flags in the error state.void swap (basic_fstream &__rhs)pos_type tellp ()โ getting the current write position.basic_ostream< _CharT, _Traits > * tie () constโ fetches the current tied stream.basic_ostream< _CharT, _Traits > * tie (basic_ostream< _CharT, _Traits > *__tiestr)โ ties this stream to an output stream.void unsetf (fmtflags __mask)โ clearing format flags.char_type widen (char __c) constโ widens characters.streamsize width () constโ flags access.streamsize width (streamsize __wide)โ changing flags.
and there's also these manipulator-interface girlies:
__istream_type & operator>> (__istream_type &(*__pf)(__istream_type &))โ interface for manipulators.__istream_type & operator>> (__ios_type &(*__pf)(__ios_type &))โ interface for manipulators.__istream_type & operator>> (ios_base &(*__pf)(ios_base &))โ interface for manipulators.
๐ Extractors ๐
okay so all the operator>> functions โ aka formatted input functions โ have some common behavior. Each one starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to false. 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. simple as that, bestie. โจ
no cap: if an exception is thrown during extraction,ios_base::badbitwill be turned on in the stream's error state โ without causing anios_base::failureto be thrown โ and the original exception will be rethrown ifbadbitis set in theexceptionsmask. keep that in your notes. ๐ญ
__istream_type & operator>> (bool &__n)โ integer arithmetic extractors.__istream_type & operator>> (short &__n)โ integer arithmetic extractors.__istream_type & operator>> (unsigned short &__n)โ integer arithmetic extractors.__istream_type & operator>> (int &__n)โ integer arithmetic extractors.__istream_type & operator>> (unsigned int &__n)โ integer arithmetic extractors.__istream_type & operator>> (long &__n)โ integer arithmetic extractors.__istream_type & operator>> (unsigned long &__n)โ integer arithmetic extractors.__istream_type & operator>> (long long &__n)โ integer arithmetic extractors.__istream_type & operator>> (unsigned long long &__n)โ integer arithmetic extractors.__istream_type & operator>> (float &__f)โ floating point arithmetic extractors.__istream_type & operator>> (double &__f)โ floating point arithmetic extractors.__istream_type & operator>> (long double &__f)โ floating point arithmetic extractors.
๐ Unformatted Input Functions ๐
all the unformatted input functions have some common behavior too, bestie. each one 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(). she's counting, okay? ๐
and again, for real: if an exception is thrown during extraction,ios_base::badbitwill be turned on in the stream's error state โ without causing anios_base::failureto be thrown โ and the original exception will be rethrown ifbadbitis set in theexceptionsmask. ๐ธ
int_type get ()โ the simplest little grab there is: one character, straight out of the stream โจ__istream_type & get (char_type &__c)โ also simple extraction, except this one drops the character into__cfor you ๐__istream_type & get (char_type *__s, streamsize __n, char_type __delim)โ simple multiple-character extraction, with a delimiter in the mix ๐__istream_type & get (char_type *__s, streamsize __n)โ same multiple-character extraction energy, no delimiter argument ๐ฆ__istream_type & get (__streambuf_type &__sb, char_type __delim)โ extraction into another streambuf, delimiter included ๐__istream_type & get (__streambuf_type &__sb)โ extraction into another streambuf, plain and simple ๐__istream_type & getline (char_type *__s, streamsize __n, char_type __delim)โ string extraction, bestie ๐ธ__istream_type & getline (char_type *__s, streamsize __n)โ string extraction, the two-arg version ๐ซถ__istream_type & ignore (streamsize __n, int_type __delim)โ literally just discarding characters ๐__istream_type & ignore (streamsize __n)โ simple extraction (yep, that's what the page calls it) ๐__istream_type & ignore ()โ simple extraction again, no args at all โจint_type peek ()โ looking ahead in the stream, no committing, just vibes ๐__istream_type & read (char_type *__s, streamsize __n)โ extraction without delimiters, raw and unfiltered ๐ฅstreamsize readsome (char_type *__s, streamsize __n)โ extraction until the buffer is exhausted, but no more โ lowkey the most honest function here ๐ญ__istream_type & putback (char_type __c)โ unextracting a single character, putting it right back where it came from ๐ง__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)โ also changing the current read position, just with the offset + seekdir flavour ๐operator bool () constโ the quick-and-easy status check, our fave ๐ซถbool operator! () constโ the quick-and-easy status check, but negated ๐__ostream_type & operator<< (__ostream_type &(*__pf)(__ostream_type &))โ interface for manipulators โจ__ostream_type & operator<< (__ios_type &(*__pf)(__ios_type &))โ interface for manipulators,__ios_typeedition ๐ฆ__ostream_type & operator<< (ios_base &(*__pf)(ios_base &))โ interface for manipulators,ios_baseedition ๐ธ
๐ฅ Inserters ๐ฅ
okay so all the operator<< functions (aka the formatted output functions, iykyk) share some common behavior, and you need to know this part ๐
Each one starts by constructing a temporary object of type std::basic_ostream::sentry. This can have several effects, and it concludes with the setting of a status flag โ see the sentry documentation for more, bestie.
If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument ๐
If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state without causing an ios_base::failure to be thrown. The original exception will then be rethrown. Not me warning you twice ๐ญ
that rethrow behaviour is not a drill โ the badbit gets set and your original exception comes right back at you ๐
__ostream_type & operator<< (long __n)โ integer arithmetic inserter ๐ข__ostream_type & operator<< (unsigned long __n)โ integer arithmetic inserter ๐ข__ostream_type & operator<< (bool __n)โ integer arithmetic inserter ๐ข__ostream_type & operator<< (short __n)โ integer arithmetic inserter ๐ข__ostream_type & operator<< (unsigned short __n)โ integer arithmetic inserter ๐ข__ostream_type & operator<< (int __n)โ integer arithmetic inserter ๐ข__ostream_type & operator<< (unsigned int __n)โ integer arithmetic inserter ๐ข__ostream_type & operator<< (long long __n)โ integer arithmetic inserter ๐ข__ostream_type & operator<< (unsigned long long __n)โ integer arithmetic inserter ๐ข__ostream_type & operator<< (double __f)โ floating point arithmetic inserter ๐__ostream_type & operator<< (float __f)โ floating point arithmetic inserter ๐__ostream_type & operator<< (long double __f)โ floating point arithmetic inserter ๐
๐ Unformatted Output Functions ๐
same deal as the inserters, but unformatted this time โ and the details lowkey differ, so pay attention ๐
All the unformatted output functions have some common behavior. Each starts by constructing a temporary object of type std::basic_ostream::sentry. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more.
If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument โจ
If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state. If badbit is on in the stream's exceptions mask, the exception will be rethrown without completing its actions. ๐จ
like bestie, if badbit is sitting in the exceptions mask, your operation does not get to finish. It rethrows mid-action. That's the whole rule ๐
__ostream_type & put (char_type __c)โ simple insertion ๐__ostream_type & write (const char_type *__s, streamsize __n)โ character string insertion ๐
๐ 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โ the page just lists it with zero explanation, so I'm not gonna invent one, bestie ๐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 }โ that's the whole entry, no notes attached ๐
๐ Protected Member Functions ๐
void _M_cache_locale (const locale &__loc)void _M_call_callbacks (event __ev) throw ()void _M_dispose_callbacks (void) throw ()template<typename _ValueT > __istream_type & _M_extract (_ValueT &__v)_Words & _M_grow_words (int __index, bool __iword)void _M_init () throw ()template<typename _ValueT > __ostream_type & _M_insert (_ValueT __v)void _M_move (ios_base &) noexceptvoid _M_swap (ios_base &__rhs) noexceptvoid init (basic_streambuf< _CharT, _Traits > *__sb)โ all setup is performed here ๐ ๏ธvoid move (basic_ios &&__rhs)void move (basic_ios &__rhs)void set_rdbuf (basic_streambuf< _CharT, _Traits > *__sb)void swap (basic_ios &__rhs) noexceptvoid swap (basic_iostream &__rhs)void swap (basic_istream &__rhs)void swap (basic_ostream &__rhs)
๐ Protected Attributes ๐
_Callback_list * _M_callbacksconst __ctype_type * _M_ctypeiostate _M_exceptionchar_type _M_fillbool _M_fill_initfmtflags _M_flagsstreamsize _M_gcountlocale _M_ios_locale_Words _M_local_word [_S_local_word_size]const __num_get_type * _M_num_getconst __num_put_type * _M_num_putstreamsize _M_precisionbasic_streambuf< _CharT, _Traits > * _M_streambufiostate _M_streambuf_statebasic_ostream< _CharT, _Traits > * _M_tiestreamsize _M_width_Words * _M_wordint _M_word_size_Words _M_word_zero
๐ Detailed Description ๐
template<typename _CharT, typename _Traits>
class std::basic_fstream< _CharT, _Traits >
Controlling input and output for files. periodt ๐
๐ Template Parameters ๐
_CharTโ type of character stream ๐ค_Traitsโ traits for character type, defaults tochar_traits<_CharT>๐งฌ
This class supports reading from and writing to named files, using the inherited functions from std::basic_iostream. To control the associated sequence, an instance of std::basic_filebuf is used โ and this page refers to that instance as sb ๐ซถ
๐งฌ Member Typedef Documentation
โจ __num_put_type โ inherited, and very much a "non-standard" girlie
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. That's it, that's the whole note โ they're not part of the standard, so don't go assuming anything extra about them ๐
๐ event_callback โ inherited
typedef void(* std::ios_base::event_callback) (event __e, ios_base &__b, int
__i) [inherited]
It's the type of an event callback function. Iconic little function pointer, lowkey.
Parameters
__eโ one of the members of theeventenum.__bโ a reference to theios_baseobject.__iโ the integer that was provided when the callback got registered.
So here's the vibe check: event callbacks are user-defined functions that get called during several ios_base and basic_ios functions โ specifically imbue(), copyfmt(), and ~ios().
๐ฆ fmtflags โ inherited, bitmask royalty
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, fr fr.
Defined objects of type fmtflags are:
boolalphadecfixedhexinternalleftoctrightscientificshowbaseshowpointshowposskipwsunitbufuppercaseadjustfieldbasefieldfloatfield
๐ธ iostate โ inherited
typedef _Ios_Iostate std::ios_base::iostate [inherited]
Also a bitmask type. _Ios_Iostate is implementation-defined, but yeah โ bitwise ops on these values, Right Thing, you know the drill โจ
Defined objects of type iostate are:
badbiteofbitfailbitgoodbit
๐ openmode โ inherited
typedef _Ios_Openmode std::ios_base::openmode [inherited]
Bitmask type again, bestie. _Ios_Openmode is implementation-defined, and 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 โ inherited
typedef _Ios_Seekdir std::ios_base::seekdir [inherited]
This one's 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
It's the set of events that may be passed to an event callback. Let's break it down:
erase_eventis used during~ios()andcopyfmt().imbue_eventis used duringimbue().copyfmt_eventis used duringcopyfmt().
Periodt. Three events, three places they show up ๐
๐ ๏ธ Constructor & Destructor Documentation
basic_fstream() โ the default one
template<typename _CharT , typename _Traits > std::basic_fstream< _CharT,
_Traits >::basic_fstream () [inline]
Default constructor, bestie. It initializes sb using its own default constructor, and then passes &sb to the base class initializer. Does it open any files? Nope โ you haven't given it a filename to open, so there's literally nothing to open ๐
References: std::basic_ios< _CharT, _Traits >::init().
basic_fstream(const char* __s, ...) โ the C-string one
template<typename _CharT , typename _Traits > std::basic_fstream< _CharT,
_Traits >::basic_fstream (const char * __s, ios_base::openmode __mode =
ios_base::in | ios_base::out) [inline], [explicit]
Create an input/output file stream. Two-for-one, we love to see it ๐ซถ
Parameters
__sโ null terminated string specifying the filename.__modeโ open file in specified mode (seestd::ios_base).
References: std::basic_ios< _CharT, _Traits >::init(), and std::basic_fstream< _CharT, _Traits >::open().
basic_fstream(const std::string& __s, ...) โ the std::string one
template<typename _CharT , typename _Traits > std::basic_fstream< _CharT,
_Traits >::basic_fstream (const std::string & __s, ios_base::openmode
__mode = ios_base::in | ios_base::out) [inline], [explicit]
Create an input/output file stream. Same energy, but now with a std::string filename, which is honestly so much nicer than raw C strings, no cap.
Parameters
__sโ null terminated string specifying the filename.__modeโ open file in specified mode (seestd::ios_base).
References: std::basic_ios< _CharT, _Traits >::init(), and std::basic_fstream< _CharT, _Traits >::open().
basic_fstream(const _Path& __s, ...) โ the filesystem::path one
template<typename _CharT , typename _Traits > template<typename _Path ,
typename _Require = _If_fs_path<_Path>> std::basic_fstream< _CharT,
_Traits >::basic_fstream (const _Path & __s, ios_base::openmode __mode =
ios_base::in | ios_base::out) [inline]
Create an input/output file stream. Yes, there's a template-on-template situation happening here, and yes, it's fine โจ
Parameters
__sโfilesystem::pathspecifying the filename.__modeโ open file in specified mode (seestd::ios_base).
~basic_fstream() โ the destructor
template<typename _CharT , typename _Traits > std::basic_fstream< _CharT,
_Traits >::~basic_fstream () [inline]
Plot twist: the destructor does nothing ๐ The file is closed by the filebuf object, not the formatting stream. So don't be out here crediting the wrong object, iykyk.
๐ Member Function Documentation
_M_getloc() โ inherited, the locale access one
const locale & std::ios_base::_M_getloc () const [inline], [inherited]
Locale access, in all its underscored glory.
Returns: a reference to the current locale.
Like getloc above, but returns a reference instead of generating a copy. Efficient icon behavior ๐
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()std::time_put< _CharT, _OutIter >::put()
bad() โ inherited, fast error checking
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
_Traits >::bad () const [inline], [inherited]
Fast error checking. Snappy little bool, we stan.
Returns: true if the badbit is set.
Small caveat though โ note that other iostate flags may also be set. So don't read this as "everything is fine," okay? ๐
References: std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by: std::basic_ostream< _CharT, _Traits >::sentry::sentry().
clear() โ inherited, the [re]setter
template<typename _CharT , typename _Traits > void std::basic_ios< _CharT,
_Traits >::clear (iostate __state = goodbit) [inherited]
[Re]sets the error state. The brackets are doing so much work there and honestly? Slay.
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. (Like, most of y'all can just call it and move on ๐
)
Referenced by: okay bestie, buckle up, and yes โ several of these are literally listed twice in the docs, that's just how it is ๐
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()
close() โ shut it down ๐ช
template<typename _CharT , typename _Traits > void std::basic_fstream<
_CharT, _Traits >::close () [inline]
Close the file. It calls std::basic_filebuf::close(). And if that function fails? failbit gets set in the stream's error state. So like, always check, bestie.
References: std::basic_filebuf< _CharT, _Traits >::close(), std::ios_base::failbit, and std::basic_ios< _CharT, _Traits >::setstate().
copyfmt() โ inherited, the copy-everything one
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 object. The way this one has rules, though ๐
Parameters
__rhsโ the source values for the copies.
Returns: a reference to this object.
So here's what actually happens: 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 too. Before copying, each callback is invoked with erase_event. After copying, each (new) callback is invoked with copyfmt_event. And the final step? Copy exceptions().
References: std::__addressof(), std::basic_ios< _CharT, _Traits >::exceptions(), std::basic_ios< _CharT, _Traits >::fill(), std::ios_base::flags(), std::ios_base::getloc(), std::ios_base::precision(), std::basic_ios< _CharT, _Traits >::tie(), std::tie(), and std::ios_base::width().
eof() โ inherited, fast error checking
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
_Traits >::eof () const [inline], [inherited]
Fast error checking, part two.
Returns: true if the eofbit is set.
And again โ note that other iostate flags may also be set. One flag being set does not mean the others aren't lurking ๐
References: std::ios_base::eofbit, and std::basic_ios< _CharT, _Traits >::rdstate().
exceptions() โ inherited, the read-only one
template<typename _CharT , typename _Traits > iostate std::basic_ios<
_CharT, _Traits >::exceptions () const [inline], [inherited]
Throwing exceptions on errors โ well, reading about them right now.
Returns: the current exceptions mask.
This changes nothing in the stream. It's purely a read, bestie. See the one-argument version of exceptions(iostate) for the meaning of the return value.
Referenced by: std::basic_ios< _CharT, _Traits >::copyfmt().
exceptions(iostate) โ inherited, the one that actually throws ๐ญ
template<typename _CharT , typename _Traits > void std::basic_ios< _CharT,
_Traits >::exceptions (iostate __except) [inline], [inherited]
Throwing exceptions on errors. This is the spicy one.
Parameters
__exceptโ the new exceptions mask.
By default, error flags are set silently. Very demure, very mindful. But you can set an exceptions mask for each stream: if a bit in the mask becomes set in the error flags, then an exception of type std::ios_base::failure is thrown.
And here's the part that gets people: 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().
fail() โ inherited, fast error checking (the third one)
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT,
_Traits >::fail () const [inline], [inherited]
Fast error checking, back again.
Returns: true if either the badbit or the failbit is set.
Checking the badbit in fail() is historical practice โ that's just the lore, don't question it. And note that other iostate flags may also be set.
References: std::ios_base::badbit, std::ios_base::failbit, and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by:
std::basic_ios< _CharT, _Traits >::operator bool()std::basic_ios< _CharT, _Traits >::operator!()std::basic_istream< _CharT, _Traits >::seekg()std::basic_istream< _CharT, _Traits >::seekg()std::basic_ostream< _CharT, _Traits >::seekp()std::basic_ostream< _CharT, _Traits >::seekp()std::basic_istream< _CharT, _Traits >::tellg()std::basic_ostream< _CharT, _Traits >::tellp()std::regex_traits< _Ch_type >::value()
fill() โ inherited, the empty-character girlie
template<typename _CharT , typename _Traits > char_type std::basic_ios<
_CharT, _Traits >::fill () const [inline], [inherited]
Retrieves the empty character. Cute little getter, does exactly what it says ๐
Returns: the current fill character.
It defaults to a space (' ') in the current locale, periodt. That's just the vibe.
References std::basic_ios< _CharT, _Traits >::widen().
Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), and std::basic_ios< _CharT, _Traits >::fill().
๐ template<typename _CharT , typename _Traits > char_type std::basic_ios< _CharT, _Traits >::fill (char_type __ch) [inline], [inherited]
Sets a new empty character. Bestie, you're literally choosing what fills the gaps. <sparkle>โจ</sparkle>
Parameters
__chโ the new character. That's the one, mwah.
Returns
- The previous fill character. The one it was before โ like, the ex-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().
๐ธ fmtflags std::ios_base::flags () const [inline], [inherited]
Access to format flags. Reading the whole format-control fit check ๐
Returns
- The format control flags for both input and output.
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>>(). No cap, that's the whole list, not me editing it down fr fr.
๐ฆ fmtflags std::ios_base::flags (fmtflags __fmtfl) [inline], [inherited]
Setting new format flags all at once. Glow-up for the whole flag set, one call โ
Parameters
__fmtflโ the new flags to set.
Returns
- The previous format control flags.
This function overwrites all the format flags with __fmtfl. Like, every single one. It's not a merge, it's a takeover.
๐ template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::flush () [inherited]
Synchronizing the stream buffer. Making sure everything's actually made it out the door ๐โโ๏ธ
Returns
*this
If rdbuf() is a null pointer, changes nothing. Nothing happened, and that's fine.
Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit.
References std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by std::flush().
๐ template<typename _CharT , typename _Traits > streamsize std::basic_istream< _CharT, _Traits >::gcount () const [inline], [inherited]
Character counting. Keeping score of how many chars actually got extracted ๐ข
Returns
- The number of characters extracted by the previous unformatted input function dispatched for this stream.
References std::basic_istream< _CharT, _Traits >::_M_gcount.
๐ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits >::int_type std::basic_istream< _CharT, _Traits >::get (void) [inherited]
Simple extraction. One char, no thoughts, just vibes โจ
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::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by std::basic_istream< _CharT, _Traits >::get(), and std::basic_istream< _CharT, _Traits >::get().
๐ง template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb) [inline], [inherited]
Extraction into another streambuf. Handing your chars off to a different buffer, cute ๐
Parameters
__sbโ a streambuf in which to store data.
Returns
*this
Returns get(__sb,widen('\n')).
References std::basic_istream< _CharT, _Traits >::get(), and std::basic_ios< _CharT, _Traits >::widen().
๐ซ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb, char_type __delim) [inherited]
Extraction into another streambuf โ but with a stop character this time, iykyk ๐
Parameters
__sbโ a streambuf in which to store data.__delimโ a 'stop' character.
Returns
*this
Characters are extracted and inserted into __sb until one of the following happens:
- the input sequence reaches EOF
- insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted)
- the next character equals
__delim(in this case, the character is not extracted) - an exception occurs (and in this case is caught)
If no characters are stored, failbit is set in the stream's error state.
References std::basic_istream< _CharT, _Traits >::_M_gcount, and std::ios_base::goodbit.
๐ธ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (char_type & __c) [inherited]
Simple extraction, but storing into a reference this time ๐
Parameters
__cโ the character in which to store data.
Returns
*this
Tries to extract a character and store it in __c. If none are available, sets failbit and returns traits::eof().
Note: this function is not overloaded onsigned charandunsigned char. So don't come at it with those, it will not hear you.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
๐ template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::get (char_type * __s, streamsize __n) [inline], [inherited]
Simple multiple-character extraction. Array time bestie ๐
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(), and std::basic_ios< _CharT, _Traits >::widen().
๐ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (char_type * __s, streamsize __n, char_type __delim) [inherited]
Simple multiple-character extraction, now with a delim. The full package deal ๐
Parameters
__sโ pointer to an array.__nโ maximum number of characters to store in__s.__delimโ a 'stop' character.
Returns
*this
Characters are extracted and stored into __s until one of the following happens:
__n-1characters are stored- the input sequence reaches EOF
- the next character equals
__delim, in which case the character is not extracted
If no characters are stored, failbit is set in the stream's error state.
In any case, a null character is stored into the next location in the array.
Note: this function is not overloaded onsigned charandunsigned char. Same energy as before โ it simply does not do that.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().
๐ฆ template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::getline (char_type * __s, streamsize __n) [inline], [inherited]
String extraction. Reading a whole line like the main character you are ๐
Parameters
__sโ a character array in which to store the data.__nโ maximum number of characters to extract.
Returns
*this
Returns getline(__s,__n,widen('\n')).
References std::basic_istream< _CharT, _Traits >::getline(), and std::basic_ios< _CharT, _Traits >::widen().
๐ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::getline (char_type * __s, streamsize __n, char_type __delim) [inherited]
String extraction with a stop character. This is the one with the actual rules, so listen up ๐
Parameters
__sโ a character array in which to store the data.__nโ maximum number of characters to extract.__delimโ a 'stop' character.
Returns
*this
Extracts and stores characters into __s until one of the following happens. Note that these criteria are required to be tested in the order listed here, to allow an input line to exactly fill the __s array without setting failbit. Order matters, bestie, don't rearrange them.
- 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.) Empty line? Valid. Iconic even.
In any case, a null character is stored in the next location in the array.
Referenced by std::basic_istream< _CharT, _Traits >::getline().
๐ basic_istream< char > & std::basic_istream< char >::getline (char_type * __s, streamsize __n, char_type __delim) [inherited]
Explicit specialization declarations, defined in src/istream.cc. Special-cased for char, bestie โ that's the whole note.
๐ locale std::ios_base::getloc () const [inline], [inherited]
Locale access. Peeking at which locale is currently loaded ๐
Returns
- A copy of the current locale.
If imbue(loc) has previously been called, then this function returns loc. Otherwise, it returns a copy of std::locale(), the global C++ locale.
Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), std::money_put< _CharT, _OutIter >::do_put(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), and std::ws().
โญ template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT, _Traits >::good () const [inline], [inherited]
Fast error checking. The quick vibe check of the stream world โ
Returns
Trueif no error flags are set.
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>>().
๐ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (void) [inherited]
Simple extraction. Yeah the doc says "extraction" here, we're just rolling with it, don't @ me ๐
Returns
- A character, or
eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sbumpc().
๐ฅ template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n) [inherited]
Simple extraction, with a count. Yes, same description as above โ the docs said what they said ๐
Returns
- A character, or
eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n, int_type __delim) [inherited]โ bestie this one is literally the "trash it" button, aka Discarding characters.
Parameters
__nโ Number of characters to discard.__delimโ A 'stop' character.
Returns *this
So it extracts characters and just throws them away (no cap, we don't want them) until ONE of these things happens:
- if
__n != std::numeric_limits<int>::max(),__ncharacters are extracted - the input sequence reaches end-of-file
- the next character equals
__delim(and in this case, the character is extracted) โ but heads up, 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, honestly. โจ
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().
template<typename _CharT , typename _Traits > locale std::basic_ios< _CharT, _Traits >::imbue (const locale & __loc) [inherited]โ Moves to a new locale. it's giving โจglow-upโจ but for language settings.
Parameters
__locโ The new locale.
Returns The previous locale. (yes, it remembers the old one, iconic behaviour)
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<<().
template<typename _CharT , typename _Traits > void std::basic_ios< _CharT, _Traits >::init (basic_streambuf< _CharT, _Traits > * __sb) [protected], [inherited]โ All setup is performed here. literally the backstage crew of the stream ๐ This is called from the public constructor. It is not virtual and cannot be redefined. no take-backs, no overrides, periodt.
Referenced by std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ifstream< _CharT, _Traits >::basic_ifstream(), std::basic_ios< _CharT, _Traits >::basic_ios(), std::basic_istream< _CharT, _Traits >::basic_istream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_istringstream< _CharT, _Traits, _Alloc >::basic_istringstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ofstream< _CharT, _Traits >::basic_ofstream(), std::basic_ostream< _CharT, _Traits >::basic_ostream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_ostringstream< _CharT, _Traits, _Alloc >::basic_ostringstream(), std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream(), std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream(), and std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream(). (that's a lot of names, we love a supportive cast ๐)
template<typename _CharT , typename _Traits > bool std::basic_fstream< _CharT, _Traits >::is_open () [inline]โ Wrapper to test for an open file. tiny little vibe check: is the file open or not ๐ฆ
Returns rdbuf()->is_open()
References std::basic_filebuf< _CharT, _Traits >::is_open().
long & std::ios_base::iword (int __ix) [inline], [inherited]โ Access to integer array. your personal little integer storage cubby ๐ฅ
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. bestie please do not cling, the array is a main character who changes ๐
template<typename _CharT , typename _Traits > char std::basic_ios< _CharT, _Traits >::narrow (char_type __c, char __dfault) const [inline], [inherited]โ Squeezes characters. not me making your wide chars fit into a regularchar๐ญ
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
template<typename _CharT , typename _Traits > template<typename _Path > _If_fs_path< _Path, void > std::basic_fstream< _CharT, _Traits >::open (const _Path & __s, ios_base::openmode __mode = ios_base::in | ios_base::out) [inline]โ Opens an external file. thefilesystem::pathflavour, fancy โจ
Parameters
__sโ The name of the file, as afilesystem::path.__modeโ The open mode flags.
Calls std::basic_filebuf::open(__s,__mode). If that function fails, failbit is set in the stream's error state.
References std::basic_fstream< _CharT, _Traits >::open().
template<typename _CharT , typename _Traits > void std::basic_fstream< _CharT, _Traits >::open (const char * __s, ios_base::openmode __mode = ios_base::in | ios_base::out) [inline]โ Opens an external file. the classic C-string version, old money ๐
Parameters
__sโ The name of the file.__modeโ The open mode flags.
Calls std::basic_filebuf::open(__s,__mode). If that function fails, failbit is set in the stream's error state.
References std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::failbit, std::basic_filebuf< _CharT, _Traits >::open(), and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by std::basic_fstream< _CharT, _Traits >::basic_fstream(), std::basic_fstream< _CharT, _Traits >::basic_fstream(), and std::basic_fstream< _CharT, _Traits >::open().
template<typename _CharT , typename _Traits > void std::basic_fstream< _CharT, _Traits >::open (const std::string & __s, ios_base::openmode __mode = ios_base::in | ios_base::out) [inline]โ Opens an external file. and this one takes astd::stringbecause we're not always out here with raw pointers bestie ๐
Parameters
__sโ The name of the file.__modeโ The open mode flags.
Calls std::basic_filebuf::open(__s,__mode). If that function fails, failbit is set in the stream's error state.
References std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::failbit, std::basic_filebuf< _CharT, _Traits >::open(), and std::basic_ios< _CharT, _Traits >::setstate().
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 asif (!a_stream) ...andwhile (a_stream) ...โ the[explicit]is doing so much work here, no accidental conversions, we stan a careful icon ๐
References std::basic_ios< _CharT, _Traits >::fail().
template<typename _CharT , typename _Traits > bool std::basic_ios< _CharT, _Traits >::operator! () const [inline], [inherited]โ The quick-and-easy status check. This allows you to write constructs such asif (!a_stream) ...andwhile (a_stream) ...โ same energy, just with the little bang operator ๐ซถ
References std::basic_ios< _CharT, _Traits >::fail().
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (__ios_type &(*)(__ios_type &) __pf) [inline], [inherited]โ Interface for manipulators. Manipulators such asstd::endlandstd::hexuse these functions in constructs like'std::cout << std::endl'. For more information, see theiomanipheader. function-pointer-to-function-pointer, we love a glow-up pipeline โจtemplate<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (__ostream_type &(*)(__ostream_type &) __pf) [inline], [inherited]โ Interface for manipulators. Manipulators such asstd::endlandstd::hexuse these functions in constructs like'std::cout << std::endl'. For more information, see theiomanipheader. this overload takes the__ostream_typeflavour, same vibe, different signature ๐ธtemplate<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (__streambuf_type * __sb) [inherited]โ Extracting from another streambuf. wait no, it's<<so we're inserting โ the title says extracting because that's what's happening to__sb's contents, keep up bestie ๐ญ
Parameters
__sbโ A pointer to a streambuf
This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.
If __sb is NULL, the stream will set failbit in its error state. (so like, don't do that ๐)
Characters are extracted from __sb and inserted into *this until one of the following occurs:
- the input stream reaches end-of-file,
- insertion into the output sequence fails (in this case, the character that would have been inserted is not extracted), or
- an exception occurs while getting a character from
__sb, which setsfailbitin the error state
If the function inserts no characters, failbit is set. brutal but fair ๐
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (bool __n) [inline], [inherited]โ Integer arithmetic inserters.
Parameters
__nโ A variable of builtin integral type.
Returns *this if successful
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting. yes the bool one lives in the integer squad, don't question the grouping bestie ๐
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (const void * __p) [inline], [inherited]โ Pointer arithmetic inserters.
Parameters
__pโ A variable of pointer type.
Returns *this if successful
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (double __f) [inline], [inherited]โ Floating point arithmetic inserters.
Parameters
__fโ A variable of builtin floating point type.
Returns *this if successful
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting. double precision excellence ๐ฅ
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (float __f) [inline], [inherited]โ Floating point arithmetic inserters.
Parameters
__fโ A variable of builtin floating point type.
Returns *this if successful
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting. the float twin, equally valid, equally iconic ๐
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (int __n) [inherited]โ Integer arithmetic inserters.
Parameters
__nโ A variable of builtin integral type.
Returns *this if successful
(and yeah, it also uses the stream's current locale โ specifically the num_get facet โ to perform numeric formatting, same as the rest of the squad ๐ง)
okay so these functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting. locale-aware number slay โจ
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (ios_base &(*)(ios_base &) __pf)โ[inline],[inherited]. Interface for manipulators ๐. Manipulators such asstd::endlandstd::hexuse these functions in constructs likestd::cout << std::endl. For more information, see theiomanipheader.template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long __n)โ[inline],[inherited]. Integer arithmetic inserters ๐ฅ.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to perform numeric formatting.
- Parameters:
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long double __f)โ[inline],[inherited]. Floating point arithmetic inserters ๐ธ.- Parameters:
__fโ a variable of builtin floating point type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to perform numeric formatting.
- Parameters:
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (long long __n)โ[inline],[inherited]. Integer arithmetic inserters ๐ .- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to perform numeric formatting.
- Parameters:
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::operator<< (short __n)โ[inherited]. Integer arithmetic inserters ๐.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to perform numeric formatting. - References:
std::ios_base::badbit,std::ios_base::goodbit, andstd::basic_ios< _CharT, _Traits >::setstate().
- Parameters:
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned int __n)โ[inline],[inherited]. Integer arithmetic inserters ๐ฆ.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to perform numeric formatting.
- Parameters:
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned long __n)โ[inline],[inherited]. Integer arithmetic inserters ๐.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to perform numeric formatting.
- Parameters:
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned long long __n)โ[inline],[inherited]. Integer arithmetic inserters โจ.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to perform numeric formatting.
- Parameters:
template<typename _CharT , typename _Traits > __ostream_type & std::basic_ostream< _CharT, _Traits >::operator<< (unsigned short __n)โ[inline],[inherited]. Integer arithmetic inserters ๐.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to perform numeric formatting.
- Parameters:
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (__ios_type &(*)(__ios_type &) __pf)โ[inline],[inherited]. Interface for manipulators ๐. Manipulators such asstd::wsandstd::decuse these functions in constructs likestd::cin >> std::ws. For more information, see theiomanipheader.template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (__istream_type &(*)(__istream_type &) __pf)โ[inline],[inherited]. Interface for manipulators ๐ฅ. Manipulators such asstd::wsandstd::decuse these functions in constructs likestd::cin >> std::ws. For more information, see theiomanipheader.template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> (__streambuf_type * __sb)โ[inherited]. Extracting into another streambuf ๐ซถ.- 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
__sbstreambuf 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,
failbitis set. - References:
std::ios_base::eofbit,std::ios_base::failbit,std::ios_base::goodbit,std::basic_ios< _CharT, _Traits >::rdbuf(), andstd::basic_ios< _CharT, _Traits >::setstate().
- Parameters:
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (bool & __n)โ[inline],[inherited]. Integer arithmetic extractors ๐.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to parse the input data.
- Parameters:
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (double & __f)โ[inline],[inherited]. Floating point arithmetic extractors ๐ธ.- Parameters:
__fโ a variable of builtin floating point type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to parse the input data.
- Parameters:
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (float & __f)โ[inline],[inherited]. Floating point arithmetic extractors ๐ฆ.- Parameters:
__fโ a variable of builtin floating point type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to parse the input data.
- Parameters:
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> (int & __n)โ[inherited]. Integer arithmetic extractors ๐ .- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to parse the input data.
- Parameters:
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (ios_base &(*)(ios_base &) __pf)โ[inline],[inherited]. Interface for manipulators โจ. Manipulators such asstd::wsandstd::decuse these functions in constructs likestd::cin >> std::ws. For more information, see theiomanipheader.template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (long & __n)โ[inline],[inherited]. Integer arithmetic extractors ๐.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to parse the input data.
- Parameters:
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (long double & __f)โ[inline],[inherited]. Floating point arithmetic extractors ๐.- Parameters:
__fโ a variable of builtin floating point type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to parse the input data.
- Parameters:
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (long long & __n)โ[inline],[inherited]. Integer arithmetic extractors ๐ฅ.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to parse the input data.
- Parameters:
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> (short & __n)โ[inherited]. Integer arithmetic extractors ๐.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to parse the input data. - References:
std::ios_base::badbit,std::ios_base::failbit,std::ios_base::goodbit, andstd::basic_ios< _CharT, _Traits >::setstate().
- Parameters:
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (unsigned int & __n)โ[inline],[inherited]. Integer arithmetic extractors ๐.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to parse the input data.
- Parameters:
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (unsigned long & __n)โ[inline],[inherited]. Integer arithmetic extractors ๐.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to parse the input data.
- Parameters:
template<typename _CharT , typename _Traits > __istream_type & std::basic_istream< _CharT, _Traits >::operator>> (unsigned long long & __n)โ[inline],[inherited]. Integer arithmetic extractors ๐ง.- Parameters:
__nโ a variable of builtin integral type. - Returns:
*thisif successful. - These functions use the stream's current locale (specifically, the
num_getfacet) to parse the input data.
- Parameters:
operator>> for unsigned short & ๐
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned short & __n)
[inline], [inherited]
Integer arithmetic extractors. Periodt.
Parameters
__nโ a variable of builtin integral type.
Returns โ *this if successful
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
operator>> for void *& ๐ง
template<typename _CharT , typename _Traits > __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (void *& __p)
[inline], [inherited]
Basic arithmetic extractors. iykyk.
Parameters
__pโ a variable of pointer type.
Returns โ *this if successful
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
peek โ looking ahead, no touching ๐
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
>::int_type std::basic_istream< _CharT, _Traits >::peek (void)
[inherited]
Looking ahead in the stream. Main character energy, but make it non-destructive.
Returns โ the next character, or eof().
If, after constructing the sentry object, good() is false, returns traits::eof(). Otherwise reads but does not extract the next input character.
References: std::basic_istream< _CharT, _Traits >::_M_gcount.
precision() โ flags access, const flavor ๐
streamsize std::ios_base::precision () const
[inline], [inherited]
Flags access.
Returns โ the precision to generate on certain output operations.
Be careful if you try to give a definition of precision here; see DR 189.
Referenced by: std::basic_ios< _CharT, _Traits >::copyfmt(), and std::chrono::operator<<().
precision(streamsize) โ changing flags ๐
streamsize std::ios_base::precision (streamsize __prec)
[inline], [inherited]
Changing flags.
Parameters
__precโ the new precision value.
Returns โ the previous value of precision().
put โ simple insertion โจ
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> & std::basic_ostream< _CharT, _Traits >::put (char_type __c)
[inherited]
Simple insertion. Just one little character, bestie.
Parameters
__cโ the character to insert.
Returns โ *this
Tries to insert __c.
Note: This function is not overloaded onsigned charandunsigned char.
References: std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by: std::endl(), and std::ends().
putback โ unextracting a single character ๐ซถ
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::putback (char_type __c)
[inherited]
Unextracting a single character. Put it back, it's not ready to leave yet.
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 return 0, as required by DR 60.
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_streambuf< _CharT, _Traits >::sputbackc().
Referenced by: std::operator<<().
pword โ access to the void pointer array ๐
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.
basic_fstream::rdbuf() โ underlying buffer, const edition ๐ฆ
template<typename _CharT , typename _Traits > __filebuf_type *
std::basic_fstream< _CharT, _Traits >::rdbuf () const
[inline]
Accessing the underlying buffer.
Returns โ the current basic_filebuf buffer.
This hides both signatures of std::basic_ios::rdbuf().
basic_ios::rdbuf(__sb) โ changing the underlying buffer ๐
template<typename _CharT , typename _Traits > basic_streambuf< _CharT,
_Traits > * std::basic_ios< _CharT, _Traits >::rdbuf (basic_streambuf<
_CharT, _Traits > * __sb)
[inherited]
Changing the underlying buffer.
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>
rdstate() โ error state check-in ๐ฉบ
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().
Referenced by: std::basic_ios< _CharT, _Traits >::bad(), std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::fail(), std::basic_ios< _CharT, _Traits >::good(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_istream< _CharT, _Traits >::unget().
read โ extraction without delimiters ๐ฅ
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits
> & std::basic_istream< _CharT, _Traits >::read (char_type * __s,
streamsize __n)
[inherited]
Extraction without delimiters. No separators, no drama.
Parameters
__sโ a character array.__nโ maximum number of characters to store.
Returns โ *this
If the stream state is good(), extracts characters and stores them into __s until one of the following happens:
__ncharacters are stored- the input sequence reaches end-of-file, in which case the error state is set to
failbit|eofbit.
Note: This function is not overloaded onsigned charandunsigned char.
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
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)
[inherited]
Extraction until the buffer is exhausted, but no more. Respect the buffer's boundaries, bestie.
Parameters
__sโ a character array.__nโ maximum number of characters to store.
Returns โ the number of characters extracted.
Extracts characters and stores them into __s depending on the number of characters remaining in the streambuf's buffer, rdbuf()->in_avail(), called A here:
- if
A == -1, setseofbitand extracts no characters - if
A == 0, extracts no characters - if
A > 0, extractsmin(A,n)
The goal is to empty the current buffer, and to not request any more from the external input sequence controlled by the streambuf.
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]
Add the callback __fn with parameter __index.
Parameters
__fnโ the function to add.__indexโ the integer to pass to the function when invoked.
Registers a function as an event callback with an integer parameter to be passed to the function when invoked. Multiple copies of the function are allowed. If there are multiple callbacks, they are invoked in the order they were registered.
seekg(off_type, seekdir) โ 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)
[inherited]
Changing the current read position.
Parameters
__offโ a file offset object.__dirโ the direction in which to seek.
Returns โ *this
If fail() is not true, calls rdbuf()->pubseekoff(__off,__dir). If that function fails, sets failbit.
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(pos_type) โ 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)
[inherited]
Changing the current read position.
Parameters
__posโ a file position object.
Returns โ *this
If fail() is not true, calls rdbuf()->pubseekpos(__pos). If that function fails, sets failbit.
Note: 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().
seekp โ changing the current write position โ๏ธ
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits
> & std::basic_ostream< _CharT, _Traits >::seekp (off_type __off,
ios_base::seekdir __dir)
[inherited]
Changing the current write position.
Parameters
__offโ a file offset object.__dirโ the direction in which to seek.
Returns โ *this
If fail() is not true, calls rdbuf()->pubseekoff(off,dir). If that function fails, sets failbit.
Okay so the references for that last overload: std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::out, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
seekp โ changing the current write position
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::seekp (pos_type __pos) [inherited]
Parameters
__posโ a file position object.
Returns โ *this
If fail() is not true, calls rdbuf()->pubseekpos(pos). If that function fails, sets failbit.
References: std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::out, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
setf โ setting new format flags, one-flag edition
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. Periodt, they stay put.
Referenced by std::__detail::operator>>().
setf โ setting new format flags, mask edition
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, mask off, set the bits, slay ๐
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().
sync โ synchronizing the stream buffer
template<typename _CharT , typename _Traits > int std::basic_istream< _CharT, _Traits >::sync (void) [inherited]
Returns โ 0 on success, -1 on failure
If rdbuf() is a null pointer, returns -1.
Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit and returns -1.
Otherwise, returns 0.
Note โ This function does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount().
References: std::ios_base::badbit, std::ios_base::goodbit, std::basic_streambuf< _CharT, _Traits >::pubsync(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
sync_with_stdio โ interaction with the standard C I/O objects
static bool std::ios_base::sync_with_stdio (bool __sync = true) [static], [inherited]
Parameters
__syncโ whether to synchronize or not.
Returns โ True if the standard streams were previously synchronized.
The synchronization referred to is only that between the standard C facilities (e.g., stdout) and the standard C++ objects (e.g., cout). User-declared streams are unaffected. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary.
tellg โ getting the current read position
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits >::pos_type std::basic_istream< _CharT, _Traits >::tellg (void) [inherited]
Returns โ a file position object.
If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,in).
Note โ This function does not count the number of characters extracted, if any, and therefore does not affect the next call togcount(). At variance withputback,ungetandseekg,eofbitis not cleared first.
References: std::ios_base::badbit, std::ios_base::cur, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::in, and std::basic_ios< _CharT, _Traits >::rdbuf().
tellp โ getting the current write position
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits >::pos_type std::basic_ostream< _CharT, _Traits >::tellp () [inherited]
Returns โ a file position object.
If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,out).
References: std::ios_base::cur, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::out, and std::basic_ios< _CharT, _Traits >::rdbuf().
tie โ 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.
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.
unget โ unextracting the previous character
template<typename _CharT , typename _Traits > basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::unget (void) [inherited]
Returns โ *this
If rdbuf() is not null, calls rdbuf()->sungetc(c).
If rdbuf() is null or if sungetc() fails, sets badbit in the error state.
Note โ This function first clearseofbit. Since no characters are extracted, the next call togcount()will return0, as required by DR 60.
References: std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by std::__detail::operator>>().
unsetf โ clearing format flags
void std::ios_base::unsetf (fmtflags __mask) [inline], [inherited]
Parameters
__maskโ the flags to unset.
This function clears __mask in the format flags.
widen โ widens characters
template<typename _CharT , typename _Traits > char_type std::basic_ios< _CharT, _Traits >::widen (char __c) const [inline], [inherited]
Parameters
__cโ the character to widen.
Returns โ the widened character.
Maps a character of char to a character of char_type.
Returns the result of
std::use_facet<ctype<char_type> >(getloc()).widen(c)
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html.
Referenced by std::endl(), std::basic_ios< _CharT, _Traits >::fill(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::getline(), std::getline(), std::basic_istream< _CharT, _Traits >::getline(), std::operator<<(), std::operator<<(), and std::tr2::operator>>().
width โ flags access, reading the width
streamsize std::ios_base::width () const [inline], [inherited]
Returns โ the minimum field width to generate on output operations.
Minimum field width refers to the number of characters. Character count, not vibes count โจ
Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_put< _CharT, _OutIter >::do_put(), std::operator>>(), and std::operator>>().
width โ changing the width
streamsize std::ios_base::width (streamsize __wide) [inline], [inherited]
Parameters
__wideโ the new width value.
Returns โ the previous value of width().
write โ character string insertion
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::write (const char_type * __s, streamsize __n) [inherited]
Parameters
__sโ the array to insert.__nโ maximum number of characters to insert.
Returns โ *this
Characters are copied from __s and inserted into the stream until one of the following happens:
__ncharacters are inserted- inserting into the output sequence fails (in this case,
badbitwill be set in the stream's error state)
Note โ This function is not overloaded onsigned charandunsigned char.
xalloc โ access to unique indices
static int std::ios_base::xalloc () [static], [inherited]
Returns โ an integer different from all previous calls.
This function returns a unique integer every time it is called. It can be used for any purpose, but is primarily intended to be a unique index for the iword and pword functions. The expectation is that an application calls xalloc in order to obtain an index in the iword and pword arrays that can be used without fear of conflict.
The implementation maintains a static variable that is incremented and returned on each invocation. xalloc is guaranteed to return an index that is safe to use in the iword and pword arrays. Unique index unlocked, no collisions, we love to see it ๐ฆ
๐ Member Data Documentation ๐
okay bestie, this is the part where we meet the actual data members โ the little state gremlins that live inside your stream objects and make everything work ๐ซถ some are inherited from std::ios_base (the flags and state bits, the absolute icons ๐), some come from std::basic_istream, and each one has a "Referenced by" list showing every function that pokes at it. yes it's long. no we are not skipping any of it. drink some water and let's go ๐
streamsize std::basic_istream< _CharT, _Traits >::_M_gcount[protected],[inherited]โ the running tally of characters pulled out by the previous unformatted function; go look atgcount()for the receipts ๐
Referenced by: std::basic_istream< _CharT, _Traits >::~basic_istream(), std::basic_istream< _CharT, _Traits >::gcount(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< char >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< char >::operator>>(), std::basic_istream< _CharT, _Traits >::peek(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< char >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< char >::readsome(), std::basic_istream< char >::sync(), and std::basic_istream< _CharT, _Traits >::unget().
const fmtflags std::ios_base::adjustfield[static],[inherited]โ a mask made ofleft|right|internal. so useful for the 2-arg form ofsetfโจ
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 the end before every single write, no cap ๐โโ๏ธ๐จ
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 the thing, then immediately seek to the end ๐ฏ
Referenced by: std::basic_filebuf< _CharT, _Traits >::open().
const iostate std::ios_base::badbit[static],[inherited]โ flags that integrity is gone, bestie ๐ญ like an irrecoverable read error from a file. this is the bad place.
Referenced by: std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ios< _CharT, _Traits >::bad(), std::basic_ios< _CharT, _Traits >::fail(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< char >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< char >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< char >::tellg(), std::basic_istream< _CharT, _Traits >::tellg(), and std::ws().
const fmtflags std::ios_base::basefield[static],[inherited]โ a mask made ofdec|oct|hex. again: 2-argsetf's bestie ๐งฎ
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]โ please seek relative to the beginning of the stream, thank you ๐ซ
Referenced by: std::basic_filebuf< _CharT, _Traits >::seekpos().
const openmode std::ios_base::binary[static],[inherited]โ do input and output in binary mode instead of text mode. โ ๏ธ and ngl it is probably not what you think it is, so go read this before you get weird about it:https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary
Referenced by: std::basic_filebuf< _CharT, _Traits >::showmanyc().
const fmtflags std::ios_base::boolalpha[static],[inherited]โ insert/extractboolas words instead of numbers, i.e. alphabetic format not numeric ๐ ฐ๏ธ๐ ฑ๏ธ
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]โ seek relative to wherever you currently are in 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]โ reads integers / writes integers in base 10, the classic ๐
Referenced by: std::dec().
const seekdir std::ios_base::end[static],[inherited]โ seek relative to the current end of the sequence ๐
Referenced by: std::basic_filebuf< _CharT, _Traits >::open(), and std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff().
const iostate std::ios_base::eofbit[static],[inherited]โ an input operation hit the end of an input sequence ๐ that's all folks
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]โ an input operation didn't read the characters it expected, or an output operation didn't produce the characters you wanted. it's giving "close but no" ๐
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]โ floating-point output in fixed-point notation, locked in ๐
Referenced by: std::fixed(), and std::hexfloat().
const fmtflags std::ios_base::floatfield[static],[inherited]โ a mask made ofscientific|fixed. yep, 2-argsetfagain ๐ฌ
Referenced by: std::defaultfloat(), std::fixed(), std::hexfloat(), and std::scientific().
const iostate std::ios_base::goodbit[static],[inherited]โ everything is fine, all is well, we are thriving ๐ธโจ
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]โ reads integers / writes integers in base 16, the cooler 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 ๐ and it's the default forifstreamandfstream, iykyk
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 itโs identical torightif no such point is designated. Referenced bystd::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 bystd::num_put< _CharT, _OutIter >::do_put(), andstd::left().const fmtflags std::ios_base::oct [static], [inherited]โ converts integer input or generates integer output in octal base. Referenced bystd::oct().const openmode std::ios_base::out [static], [inherited]โ open for output. Default forofstreamandfstream. Referenced bystd::basic_filebuf< _CharT, _Traits >::_M_set_buffer(),std::basic_ofstream< _CharT, _Traits >::open(),std::basic_ofstream< _CharT, _Traits >::open(),std::basic_filebuf< _CharT, _Traits >::overflow(),std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(),std::basic_stringbuf< _CharT, _Traits, _Alloc >::pbackfail(),std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(),std::basic_ostream< _CharT, _Traits >::seekp(),std::basic_ostream< _CharT, _Traits >::seekp(),std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(),std::basic_ostream< _CharT, _Traits >::tellp(), andstd::basic_filebuf< _CharT, _Traits >::xsputn().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 bystd::right().const fmtflags std::ios_base::scientific [static], [inherited]โ generates floating-point output in scientific notation. Referenced bystd::hexfloat(), andstd::scientific().const fmtflags std::ios_base::showbase [static], [inherited]โ generates a prefix indicating the numeric base of generated integer output. Referenced bystd::num_put< _CharT, _OutIter >::do_put(),std::noshowbase(), andstd::showbase().const fmtflags std::ios_base::showpoint [static], [inherited]โ generates a decimal-point character unconditionally in generated floating-point output. Referenced bystd::noshowpoint(), andstd::showpoint().const fmtflags std::ios_base::showpos [static], [inherited]โ generates a+sign in non-negative generated numeric output. Referenced bystd::noshowpos(), andstd::showpos().const fmtflags std::ios_base::skipws [static], [inherited]โ skips leading white space before certain input operations. Referenced bystd::basic_istream< _CharT, _Traits >::sentry::sentry(),std::noskipws(),std::__detail::operator>>(), andstd::skipws().const openmode std::ios_base::trunc [static], [inherited]โ truncate an existing stream when opening. Default forofstream.const fmtflags std::ios_base::unitbuf [static], [inherited]โ flushes output after each output operation. Referenced bystd::basic_ostream< _CharT, _Traits >::sentry::~sentry(),std::nounitbuf(), andstd::unitbuf().const fmtflags std::ios_base::uppercase [static], [inherited]โ replaces certain lowercase letters with their uppercase equivalents in generated output. Referenced bystd::num_put< _CharT, _OutIter >::do_put(),std::nouppercase(), andstd::uppercase().
๐ Author ๐
Generated automatically by Doxygen for libstdc++ from the source code.
Source/version + date shoutout: the footerโs libstdstd::basic_fst...harT, _Traits >(3cxx) and the date that goes with it โ auto-generated by Doxygen for libstdc++ from the source code. Bye bestie, stay hydrated! ๐๐โจ
๐ฆ 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