C++ Library - <basic_ios>



Introduction

Basic_ios define the components of streams that do not depend on whether the stream is an input or an output stream: ios_base describes the members that are independent of the template parameters (i.e. the character type and traits), while basic_ios describes the members that do depend on them.

Definition

Below is definition of basic_ios as shown below −

template <class charT, class traits = char_traits<charT> >
class ios_base;

Parameters

Parameters of basic_ios should be like this −

  • parameters − Character type.

  • traits − Character traits class that defines essential properties of the characters used by stream objects (see char_traits).

Member types

Sr.No. Member types Definition
1 event Type to indicate event type
2 event_callback Event callback function type
3 failure Base class for stream exceptions
4 fmtflags Type for stream format flags
5 Init Initialize standard stream objects
6 iostate Type for stream state flags
7 openmode Type for stream opening mode flags
8 seekdir Type for stream seeking direction flag

Public Member Functions

Sr.No. Member types Definition
1 (constructor) Construct object (public member function )
2 (destructor) Destruct object (public member function )

State flag functions

Sr.No. Member types Definition
1 good It is used to check whether state of stream is good
2 eof It is used to check whether eofbit is set
3 fail It is used to check whether either failbit or badbit is set
4 bad It is used to check whether badbit is set
5 operator! Evaluate stream
6 rdstate It is used to get error state flags
7 setstate It is used to set error state flag
8 clear It is used to set error state flag

Formatting

Sr.No. Member types Definition
1 copyfmt Copy formatting information
2 fill Get/set fill character

Others

Sr.No. Member types Definition
1 exceptions It is used to get/set exceptions mask
2 imbue Imbue locale
3 tie It is used to get/set tied stream
4 rdbuf It is used to get/set stream buffer
5 narrow Narrow character
6 widen Widen character

Protected member functions

Sr.No. Member types Definition
1 init Initialize object
2 move Move internals
3 swap Swap internals
4 set_rdbuf It is used to set stream buffer
ios.htm
Advertisements