Share via


ios_base::fmtflags

ios_base::fmtflags

typedef T1 fmtflags;
static const fmtflags boolalpha, dec, fixed, hex, internal,
    left, oct, right, scientific, showbase, showpoint,
    showpos, skipws, unitbuf, uppercase, adjustfield,
    basefield, floatfield;

The type is an enumerated type T1 that describes an object that can store format flags. The distinct flag values are:

  • boolalpha, to insert or extract objects of type bool as names (such as true and false) rather than as numeric values.
  • dec, to insert or extract integer values in decimal format.
  • fixed, to insert floating-point values in fixed-point format (with no exponent field).
  • hex, to insert or extract integer values in hexadecimal format.
  • internal, to pad to a field width as needed by inserting fill characters at a point internal to a generated numeric field.
  • left, to pad to a field width as needed by inserting fill characters at the end of a generated field (left justification).
  • oct, to insert or extract integer values in octal format.
  • right, to pad to a field width as needed by inserting fill characters at the beginning of a generated field (right justification).
  • scientific, to insert floating-point values in scientific format (with an exponent field).
  • showbase, to insert a prefix that reveals the base of a generated integer field.
  • showpoint, to insert a decimal point unconditionally in a generated floating-point field.
  • showpos, to insert a plus sign in a non-negative generated numeric field.
  • skipws, to skip leading white space before certain extractions.
  • unitbuf, to flush output after each insertion.
  • uppercase, to insert uppercase equivalents of lowercase letters in certain insertions.

In addition, several useful values are:

  • adjustfield, internal | left | right
  • basefield, dec | hex | oct
  • floatfield, fixed | scientific