SYNOPSIS

DESCRIPTION

The class basic_ios is a base class that includes the common
functions required by all streams. It maintains state infor-
mation that reflects the integrity of the stream and stream
buffer. It also maintains the link between the stream
classes and the stream buffer classes via the rdbuf member
functions. Classes derived from basic_ios specialize opera-
tions for input and output.

TYPES

char_type
The type char_type is a synonym of type
traits::char_type.
ios
The type ios is an instantiation of basic_ios on char:
typedefbasic_ios<char> ios;
int_type
The type int_type is a synonym of type traits::in_type.
ios_type
The type ios_type is a synonym for basic_ios<charT,
traits> .
off_type
The type off_type is a synonym of type traits::off_type.
ostream_type
The type ostream_type is a synonym for
basic_ostream<charT, traits> .
pos_type
The type pos_type is a synonym of type traits::pos_type.
streambuf_type
The type streambuf_type is a synonym for
basic_streambuf<charT, traits> .
traits_type
The type traits_type is a synonym for the template param-
eter traits.
wios
The type wios is an instantiation of basic_ios on
wchar_t:
typedefbasic_ios<wchar_t> wios;

PUBLIC CONSTRUCTORS

explicit basic_ios(basic_streambuf<charT, traits>* sb);
Constructs an object of class basic_ios, assigning ini-
tial values to its member objects by calling init(sb). If
sb is a null pointer, the stream is positioned in error
state by triggering its badbit.
basic_ios();
Constructs an object of class basic_ios, leaving its
member objects uninitialized. The object must be initial-
ized by calling the init member function before using it.

PUBLIC DESTRUCTORS

virtual ~basic_ios();
Destroys an object of class basic_ios.

PUBLIC MEMBER FUNCTIONS

bool
bad() const;
Returns true if badbit is set in rdstate().
void
clear(iostate state = goodbit);
If (state & exception()) == 0, returns. Otherwise, the
function throws an object of class ios_base::failure.
After the call returns state == rdstate() ifrdbuf() !=0otherwisestate == state|ios_base::badbit.
basic_ios&
copyfmt(const basic_ios& rhs);
Assigns to the member objects of *this the corresponding
member objects of rhs, except the following:
- rdstate() and rdbuf() are left unchanged
- Calls ios_base::copyfmt
- exceptions() is altered last by calling
exceptions(rhs.exceptions()).RE
bool
eof() const;
Returns true if eofbit is set in rdstate().
iostate
exceptions() const;
Returns a mask that determines what elements set in
rdstate() cause exceptions to be thrown.
void
exceptions(iostate except);
Sets the exception mask to except, then calls
clear(rdstate()).
bool
fail() const;
Returns true if failbit or badbit is set in rdstate().
char_type
fill() const;
Returns the character used to pad (fill) an output
conversion to the specified field width.
char_type
fill(char_type fillch);
Saves the field width value, then replaces it by fillch
and returns the previously saved value.
bool
good() const;
Returns rdstate() == 0.
locale
imbue(const locale& loc);
Saves the value returned by getloc(), then assigns loc to
a private variable. If rdbuf() != 0 calls rdbuf()-
>pubimbue(loc) and returns the previously saved value.
void
init(basic_streambuf<charT,traits>* sb);
Performs the following initialization:
rdbuf() sb
tie() 0
rdstate() goodbit if sb is not null otherwise badbit
exceptions() goodbit
flags() skipws | dec
width() 0
precision() 6
fill() the space character
getloc() a copy of the locale returned by
locale::locale()
char
narrow(charT c, char dfault) const;
Uses the stream's locale to convert the wide character c
to a tiny character, and then returns it. If no conver-
sion exists, it returns the character dfault.
bool
operator!() const;
Returns fail() ? 1 : 0;
streambuf_type*
rdbuf() const;
Returns a pointer to the stream buffer associated with
the stream.
streambuf_type*
rdbuf(streambuf_type* sb);
Associates a stream buffer with the stream. All the input
and output is directed to this stream buffer. If sb is a
null pointer, the stream is positioned in error state, by
triggering its badbit.
iostate
rdstate() const;
Returns the control state of the stream.
void
setstate(iostate state);
Calls clear(rdstate() | state).
ostream_type*
tie() const;
Returns an output sequence that is tied to (synchronized
with) the sequence controlled by the stream buffer.
ostream_type*
tie(ostream_type* tiestr);
Saves the tie() value, then replaces it by tiestr and
returns the value previously saved.
operator
void*() const;
Returns fail() ? 0 : 1;
charT
widen(char c) const;
Uses the stream's locale to convert the tiny character c
to a wide character, then returns it.