3.5 KiB
3.5 KiB
[ios.fmtflags]
31 Input/output library [input.output]
31.5 Iostreams base classes [iostreams.base]
31.5.2 Class ios_base [ios.base]
31.5.2.2 Types [ios.types]
31.5.2.2.2 Type ios_base::fmtflags [ios.fmtflags]
using fmtflags = T1;
The typefmtflags is a bitmask type ([bitmask.types]).
Setting its elements has the effects indicated in Table 136.
Table 136 — fmtflags effects [tab:ios.fmtflags]
| ð Element |
Effect(s) if set |
|---|---|
| ð boolalpha |
insert and extract bool type in alphabetic format |
| ð dec |
converts integer input or generates integer output in decimal base |
| ð fixed |
generate floating-point output in fixed-point notation |
| ð hex |
converts integer input or generates integer output in hexadecimal base |
| ð internal |
adds fill characters at a designated internal point in certain generated output, or identical to right if no such point is designated |
| ð left |
adds fill characters on the right (final positions) of certain generated output |
| ð oct |
converts integer input or generates integer output in octal base |
| ð right |
adds fill characters on the left (initial positions) of certain generated output |
| ð scientific |
generates floating-point output in scientific notation |
| ð showbase |
generates a prefix indicating the numeric base of generated integer output |
| ð showpoint |
generates a decimal-point character unconditionally in generated floating-point output |
| ð showpos |
generates a + sign in non-negative generated numeric output |
| ð skipws |
skips leading whitespace before certain input operations |
| ð unitbuf |
flushes output after each output operation |
| ð uppercase |
replaces certain lowercase letters with their uppercase equivalents in generated output |
Typefmtflags also defines the constants indicated in Table 137.
Table 137 — fmtflags constants [tab:ios.fmtflags.const]
| ð Constant |
Allowable values |
|---|---|
| ð adjustfield |
left |
| ð basefield |
dec |
| ð floatfield |
scientific |