Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/io/ios base"

From cppreference.com
< cpp‎ | io
m (Text replace - "{{tdcl list end" to "{{dcl list end")
m (Text replace - "{{tdcl" to "{{dcl")
Line 47: Line 47:
  
 
{{dcl list begin}}
 
{{dcl list begin}}
{{tdcl list h1 | Member types and constants}}
+
{{dcl list h1 | Member types and constants}}
{{tdcl list hitem | Type | Explanation}}
+
{{dcl list hitem | Type | Explanation}}
{{tdcl list template | cpp/io/ios_base/tdcl list openmode}}
+
{{dcl list template | cpp/io/ios_base/tdcl list openmode}}
{{tdcl list template | cpp/io/ios_base/tdcl list fmtflags}}
+
{{dcl list template | cpp/io/ios_base/tdcl list fmtflags}}
{{tdcl list template | cpp/io/ios_base/tdcl list iostate}}
+
{{dcl list template | cpp/io/ios_base/tdcl list iostate}}
{{tdcl list template | cpp/io/ios_base/tdcl list seekdir}}
+
{{dcl list template | cpp/io/ios_base/tdcl list seekdir}}
{{tdcl list template | cpp/io/ios_base/tdcl list event}}
+
{{dcl list template | cpp/io/ios_base/tdcl list event}}
{{tdcl list template | cpp/io/ios_base/tdcl list event_callback}}
+
{{dcl list template | cpp/io/ios_base/tdcl list event_callback}}
{{tdcl list h2 | Deprecated member types }}
+
{{dcl list h2 | Deprecated member types }}
{{tdcl list hitem | Type | Explanation}}
+
{{dcl list hitem | Type | Explanation}}
{{tdcl list item | {{tt|io_state}}{{mark deprecated}} | integer type that may be used like {{tt|iostate}}}}
+
{{dcl list item | {{tt|io_state}}{{mark deprecated}} | integer type that may be used like {{tt|iostate}}}}
{{tdcl list item | {{tt|open_mode}}{{mark deprecated}} | integer type that may be used like {{tt|openmode}}}}
+
{{dcl list item | {{tt|open_mode}}{{mark deprecated}} | integer type that may be used like {{tt|openmode}}}}
{{tdcl list item | {{tt|seek_dir}}{{mark deprecated}} | integer type that may be used like {{tt|seekdir}}}}
+
{{dcl list item | {{tt|seek_dir}}{{mark deprecated}} | integer type that may be used like {{tt|seekdir}}}}
{{tdcl list item | {{tt|streamoff}}{{mark deprecated}} | unspecified type that may be used like {{tt|off_type}}, not necessarily {{c|std::streamoff}}}}
+
{{dcl list item | {{tt|streamoff}}{{mark deprecated}} | unspecified type that may be used like {{tt|off_type}}, not necessarily {{c|std::streamoff}}}}
{{tdcl list item | {{tt|streampos}}{{mark deprecated}} | unspecified type that may be used like {{tt|pos_type}}, not necessarily {{c|std::streampos}}}}
+
{{dcl list item | {{tt|streampos}}{{mark deprecated}} | unspecified type that may be used like {{tt|pos_type}}, not necessarily {{c|std::streampos}}}}
 
{{dcl list end}}
 
{{dcl list end}}

Revision as of 01:36, 12 June 2012

Template:cpp/io/ios base/sidebar

Defined in header <ios>
class ios_base;

The class ios_base is a multipurpose class that serves as the base class for all I/O stream classes. It maintains several kinds of data:

1) state information: stream status flags
2) control information: flags that control formatting of both input and output sequences and the imbued locale
3) private storage: indexed extensible data structure that allows both long and void* members, which may be implemented as two arbitrary-length arrays or a single array of two-element structs or another container.
4) callbacks: arbitrary number of user-defined functions to be called from imbue(), copyfmt(), and ~ios_base()

Typical implementation holds member constants corresponding to all values of fmtflags, iostate, openmode, and seekdir shown below, member variables to maintain current precision, width, and formatting flags, the exception mask, the buffer error state, a resizeable container holding the callbacks, the currently imbued locale, the private storage, and a static integer variable for xalloc().

Contents

Member functions

Template:cpp/io/ios base/dcl list constructorTemplate:cpp/io/ios base/dcl list destructorTemplate:cpp/io/ios base/dcl list flagsTemplate:cpp/io/ios base/dcl list setfTemplate:cpp/io/ios base/dcl list unsetfTemplate:cpp/io/ios base/dcl list precisionTemplate:cpp/io/ios base/dcl list widthTemplate:cpp/io/ios base/dcl list imbueTemplate:cpp/io/ios base/dcl list getlocTemplate:cpp/io/ios base/dcl list xallocTemplate:cpp/io/ios base/dcl list iwordTemplate:cpp/io/ios base/dcl list pwordTemplate:cpp/io/ios base/dcl list register callbackTemplate:cpp/io/ios base/dcl list sync with stdioTemplate:cpp/io/ios base/dcl list failureTemplate:cpp/io/ios base/dcl list Init
Formatting
Locales
Internal extensible array
Miscellaneous

Member classes

Template:cpp/io/ios base/tdcl list openmodeTemplate:cpp/io/ios base/tdcl list fmtflagsTemplate:cpp/io/ios base/tdcl list iostateTemplate:cpp/io/ios base/tdcl list seekdirTemplate:cpp/io/ios base/tdcl list eventTemplate:cpp/io/ios base/tdcl list event callback

Member types and constants

Type Explanation
Deprecated member types
Type Explanation
io_state(deprecated) integer type that may be used like iostate
open_mode(deprecated) integer type that may be used like openmode
seek_dir(deprecated) integer type that may be used like seekdir
streamoff(deprecated) unspecified type that may be used like off_type, not necessarily std::streamoff
streampos(deprecated) unspecified type that may be used like pos_type, not necessarily std::streampos