Files
cppdraft_translate/cppdraft/ios/fmtflags.md
2025-10-25 03:02:53 +03:00

59 lines
3.5 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[ios.fmtflags]
# 31 Input/output library [[input.output]](./#input.output)
## 31.5 Iostreams base classes [[iostreams.base]](iostreams.base#ios.fmtflags)
### 31.5.2 Class ios_base [[ios.base]](ios.base#ios.fmtflags)
#### 31.5.2.2 Types [[ios.types]](ios.types#ios.fmtflags)
#### 31.5.2.2.2 Type ios_base::fmtflags [ios.fmtflags]
[🔗](#lib:fmtflags,ios_base)
`using fmtflags = T1;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L976)
The typefmtflags is a bitmask type ([[bitmask.types]](bitmask.types "16.3.3.3.3Bitmask types"))[.](#1.sentence-1)
Setting its elements has the effects indicated in Table [136](#tab:ios.fmtflags "Table 136: fmtflags effects")[.](#1.sentence-2)
Table [136](#tab:ios.fmtflags) — fmtflags effects [[tab:ios.fmtflags]](./tab:ios.fmtflags)
| [🔗](#tab:ios.fmtflags-row-1)<br>**Element** | **Effect(s) if set** |
| --- | --- |
| [🔗](#tab:ios.fmtflags-row-2)<br>boolalpha | insert and extract bool type in alphabetic format |
| [🔗](#tab:ios.fmtflags-row-3)<br>dec | converts integer input or generates integer output in decimal base |
| [🔗](#tab:ios.fmtflags-row-4)<br>fixed | generate floating-point output in fixed-point notation |
| [🔗](#tab:ios.fmtflags-row-5)<br>hex | converts integer input or generates integer output in hexadecimal base |
| [🔗](#tab:ios.fmtflags-row-6)<br>internal | adds fill characters at a designated internal point in certain generated output, or identical to right if no such point is designated |
| [🔗](#tab:ios.fmtflags-row-7)<br>left | adds fill characters on the right (final positions) of certain generated output |
| [🔗](#tab:ios.fmtflags-row-8)<br>oct | converts integer input or generates integer output in octal base |
| [🔗](#tab:ios.fmtflags-row-9)<br>right | adds fill characters on the left (initial positions) of certain generated output |
| [🔗](#tab:ios.fmtflags-row-10)<br>scientific | generates floating-point output in scientific notation |
| [🔗](#tab:ios.fmtflags-row-11)<br>showbase | generates a prefix indicating the numeric base of generated integer output |
| [🔗](#tab:ios.fmtflags-row-12)<br>showpoint | generates a decimal-point character unconditionally in generated floating-point output |
| [🔗](#tab:ios.fmtflags-row-13)<br>showpos | generates a + sign in non-negative generated numeric output |
| [🔗](#tab:ios.fmtflags-row-14)<br>skipws | skips leading whitespace before certain input operations |
| [🔗](#tab:ios.fmtflags-row-15)<br>unitbuf | flushes output after each output operation |
| [🔗](#tab:ios.fmtflags-row-16)<br>uppercase | replaces certain lowercase letters with their uppercase equivalents in generated output |
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L1016)
Typefmtflags also defines the constants indicated in Table [137](#tab:ios.fmtflags.const "Table 137: fmtflags constants")[.](#2.sentence-1)
Table [137](#tab:ios.fmtflags.const) — fmtflags constants [[tab:ios.fmtflags.const]](./tab:ios.fmtflags.const)
| [🔗](#tab:ios.fmtflags.const-row-1)<br>**Constant** | **Allowable values** |
| --- | --- |
| [🔗](#tab:ios.fmtflags.const-row-2)<br>adjustfield | left | right | internal |
| [🔗](#tab:ios.fmtflags.const-row-3)<br>basefield | dec | oct | hex |
| [🔗](#tab:ios.fmtflags.const-row-4)<br>floatfield | scientific | fixed |