ios_base

ios_base

event·event_callback·failure·flags·fmtflags·getloc·imbue·Init·ios_base ·iostate·iword·openmode·operator=·precision·pword·register_callback·seekdir·setf·sync_with_stdio·unsetf·width·xalloc

class ios_base {
public:
    class failure;
    typedef T1 fmtflags;
    static const fmtflags boolalpha, dec, fixed, hex, internal,
        left, oct, right, scientific, showbase, showpoint,
        showpos, skipws, unitbuf, uppercase, adjustfield,
        basefield, floatfield;
    typedef T2 iostate;
    static const iostate badbit, eofbit, failbit, goodbit;
    typedef T3 openmode;
    static const openmode app, ate, binary, in, out, trunc;
    typedef T4 seekdir;
    static const seekdir beg, cur, end;
    typedef T5 event;
    static const event copyfmt_event, erase_event,
        copyfmt_event;
    class Init;
    ios_base& operator=(const ios_base& rhs);
    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;
    stramsize width(streamsize wide);
    locale imbue(const locale& loc);
    locale getloc() const;
    static int xalloc();
    long& iword(int idx);
    void *& pword(int idx);
    typedef void *(event_callback(event ev, ios_base& ios, int idx);
    void register_callback(event_callback pfn, int idx);
    static bool sync_with_stdio(bool sync = true);
protected:
    ios_base();
    };

The class describes the storage and member functions common to both input and output streams that do not depend on the template parameters. (The template class basic_ios describes what is common and is dependent on template parameters.)

An object of class ios_base stores formatting information, which consists of:

  • Format flags in an object of type fmtflags
  • An exception mask in an object of type iostate
  • A field width in an object of type int
  • A display precision in an object of type int
  • A locale object in an object of type locale
  • Two extensible arrays, with elements of type long and void pointer

An object of class ios_base also stores stream state information, in an object of type iostate, and a callback stack.