[ios.base.general] (original) (raw)
31 Input/output library [input.output]
31.5 Iostreams base classes [iostreams.base]
31.5.2 Class ios_base [ios.base]
31.5.2.1 General [ios.base.general]
namespace std { class ios_base { public: class failure; using fmtflags = T1;static constexpr fmtflags boolalpha = unspecified;static constexpr fmtflags dec = unspecified;static constexpr fmtflags fixed = unspecified;static constexpr fmtflags hex = unspecified;static constexpr fmtflags internal = unspecified;static constexpr fmtflags left = unspecified;static constexpr fmtflags oct = unspecified;static constexpr fmtflags right = unspecified;static constexpr fmtflags scientific = unspecified;static constexpr fmtflags showbase = unspecified;static constexpr fmtflags showpoint = unspecified;static constexpr fmtflags showpos = unspecified;static constexpr fmtflags skipws = unspecified;static constexpr fmtflags unitbuf = unspecified;static constexpr fmtflags uppercase = unspecified;static constexpr fmtflags adjustfield = see below;static constexpr fmtflags basefield = see below;static constexpr fmtflags floatfield = see below;using iostate = T2;static constexpr iostate badbit = unspecified;static constexpr iostate eofbit = unspecified;static constexpr iostate failbit = unspecified;static constexpr iostate goodbit = see below;using openmode = T3;static constexpr openmode app = unspecified;static constexpr openmode ate = unspecified;static constexpr openmode binary = unspecified;static constexpr openmode in = unspecified;static constexpr openmode noreplace = unspecified;static constexpr openmode out = unspecified;static constexpr openmode trunc = unspecified;using seekdir = T4;static constexpr seekdir beg = unspecified;static constexpr seekdir cur = unspecified;static constexpr seekdir end = unspecified;class Init; fmtflags flags() const; fmtflags flags(fmtflags fmtfl); fmtflags setf(fmtflags fmtfl); fmtflags setf(fmtflags fmtfl, fmtflags mask);void unsetf(fmtflags mask); streamsize precision() const; streamsize precision(streamsize prec); streamsize width() const; streamsize width(streamsize wide); locale imbue(const locale& loc); locale getloc() const;static int xalloc();long& iword(int idx);void*& pword(int idx);virtual ~ios_base();enum event { erase_event, imbue_event, copyfmt_event };using event_callback = void (*)(event, ios_base&, int idx);void register_callback(event_callback fn, int idx); ios_base(const ios_base&) = delete; ios_base& operator=(const ios_base&) = delete;static bool sync_with_stdio(bool sync = true);protected: ios_base();private: static int index; long* iarray; void** parray; };}
ios_basedefines several member types:
- a type failure, defined as either a class derived fromsystem_error or a synonym for a class derived from system_error;
- a class Init;
- three bitmask types, fmtflags, iostate, and openmode;
- an enumerated type, seekdir.
It maintains several kinds of data:
- state information that reflects the integrity of the stream buffer;
- control information that influences how to interpret (format) input sequences and how to generate (format) output sequences;
- additional information that is stored by the program for its private use.
[Note 1:
For the sake of exposition, the maintained data is presented here as:
- static int index, specifies the next available unique index for the integer or pointer arrays maintained for the private use of the program, initialized to an unspecified value;
- long* iarray, points to the first element of an arbitrary-lengthlongarray maintained for the private use of the program;
- void** parray, points to the first element of an arbitrary-length pointer array maintained for the private use of the program.
— _end note_]