O'Reilly logo

C++ In a Nutshell by Ray Lischner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

ios_base class — Root class for I/O declarations

Synopsis

class ios_base{
public:
  class failure;
  typedef  . . .  fmtflags;
  typedef  . . .  iostate;
  typedef  . . .  io_state;
  typedef  . . .  openmode;
  typedef  . . .  open_mode;
  typedef  . . .  seekdir;
  typedef  . . .  seek_dir;
  typedef  . . .  streamoff;
  typedef  . . .  streampos;
  class Init;

  // Destructor
  virtual ~ios_base(  );
  // Formatting
  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);
  // Locales
  locale imbue(const locale& loc);
  locale getloc(  ) const;
  // Storage
  static int xalloc(  );
  long& iword(int index);
  void*& pword(int index);
  // Callbacks
  enum event { erase_event, imbue_event, copyfmt_event };
  typedef void (*event_callback)(event, ios_base&, int index);
  void register_callback(event_callback fn, int index);
  static bool sync_with_stdio(bool sync = true);
protected:
  ios_base(  );
private:
  ios_base(const ios_base&);
  ios_base& operator=(const ios_base&);
};

The ios_base class is the root class for all the I/O stream classes. It declares fundamental types that are used throughout the I/O library. It also has members to keep track of formatting for input and output, storing arbitrary information for derived classes, and registering functions to be called when something interesting happens to the stream ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required