Native/C++

ios (Base class for both input and output streams)

aucd29 2013. 10. 2. 19:01
Base class for both input and output streams

Standard hierarchy

ios_base
--->
ios
--->
istream
    --->
ostream

Public member functions:

ios members:
(constructor) Construct an object.
operator void * Convert stream to pointer.
operator ! Evaluate stream object.
bad Check if an unrecoverable error has occurred.
clear Set control states.
copyfmt Copy formatting information.
eof Check if End-Of-File has been reached.
exceptions Get/set the exception mask.
fail Check if failure has occurred.
fill Get/set the fill character.
good Check if stream is good for i/o operations.
imbue Imbue locale.
narrow Narrow character.
rdbuf Get/set the associated streambuf object.
rdstate Get control state.
setstate Set control state.
tie Get/set the tied stream.
widen Widen character.
(destructor) No-op [virtual]
members inherited from ios_base:
flags Get/set format flags.
getloc Get current locale.
imbue Imbue locale.
iword Get reference to a long element of the internal extensible array.
precision Get/set floating-point decimal presision.
pword Get reference to a void* element of the internal extensible array.
register_callback Register event callback function.
setf Set some format flags.
sync_with_stdio Activates / Deactivates synchronization with cstdio functions. [static]
unsetf Clear format flag.
width Get/set field width.
xalloc Return a new index for the internal extensible array. [static]

Protected member functions:

ios members:
(constructor) Construct an object
init Initialize internal values

Description

  This is a base class for all the hierarchy of stream classes, both input and output classes.
  Both the ios class and its parent ios_base class define the members of every stream that are independent of wether the stream object is an input or an output stream. ios_base describes the members that are template-independent while ios describes the members that are template-dependent (i.e. the part that depends on the type of character used by the stream).

  The ios class mantains internally the following information of a stream:

  • fill character: caracter used to pad a field up to the field width. It can be obtained/modified by calling member fill..
  • pointer to tied stream: pointer to the output stream tied to this object. It can be obtained/modified by calling to tie.
  • pointer to stream buffer: pointer to the associated streambuf object. It can be obtained/modified by calling to rdbuf.