Stream format options.
More...
#include <axcel.h>
List of all members.
Public Member Functions |
virtual string | type () |
| Get type of object.
|
virtual | operator string () |
| Convert to string.
|
| iofmt () |
bool | bin (int i=-1) |
| Write as raw binary.
|
bool | btoa (int i=-1) |
| Boolean to string.
|
bool | base (int i=-1) |
| Show numeric base.
|
bool | zpad (int i=-1) |
| Zero pad numbers.
|
bool | sign (int i=-1) |
| Display number sign.
|
bool | deaf (int i=-1) |
| Discard io::input.
|
bool | dec (int i=-1) |
| Decimal.
|
bool | hex (int i=-1) |
| Hexadecimal.
|
bool | oct (int i=-1) |
| Octal.
|
bool | ltrim (int i=-1) |
| Discard initial whitespace.
|
bool | endnl (int i=-1) |
| Read full line.
|
bool | left (int i=-1) |
| Left adjust.
|
bool | right (int i=-1) |
| Right adjust.
|
bool | fix (int i=-1) |
| Fixed decimal notation.
|
bool | sci (int i=-1) |
| Scientific notation.
|
Public Attributes |
size_t | width |
size_t | precis |
Detailed Description
Stream format options.
Definition at line 279 of file axcel.h.
Constructor & Destructor Documentation
axcel::io::iofmt::iofmt |
( |
| ) |
|
Member Function Documentation
bool axcel::io::iofmt::base |
( |
int |
i = -1 | ) |
|
Show numeric base.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, all integer values are converted to an "alternate form" when using operator<<(). For octal conversions, the first character of the output string is made zero (by prefixing a 0 if it was not a zero already). For hexadecimal conversions, a nonzero result has the string "0x" prepended to it. For floating point conversions, the result will always contain a decimal point, even if no digits follow it (normally, a decimal point appears in the results of those conversions only if a digit follows). For other conversions, the result is undefined.
Definition at line 376 of file axcel.cpp.
bool axcel::io::iofmt::bin |
( |
int |
i = -1 | ) |
|
Write as raw binary.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, data written or read from this stream using << or >> operators are taken in their raw binary forms instead of being converted to strings.
Definition at line 351 of file axcel.cpp.
bool axcel::io::iofmt::btoa |
( |
int |
i = -1 | ) |
|
Boolean to string.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, all boolean values inserted to the stream through the << operator are output as "true" or "false".
Definition at line 361 of file axcel.cpp.
bool axcel::io::iofmt::deaf |
( |
int |
i = -1 | ) |
|
Discard io::input.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, all input with the >> operator is read but is discarded. Ergo, any variable supplied as an argument to the operator>> method remains unaffected.
Definition at line 411 of file axcel.cpp.
bool axcel::io::iofmt::dec |
( |
int |
i = -1 | ) |
|
Decimal.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, numbers written to this stream using operator<<() are output as a signed or unsigned decimal number.
Definition at line 421 of file axcel.cpp.
bool axcel::io::iofmt::endnl |
( |
int |
i = -1 | ) |
|
Read full line.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, any input using operator>>() will be read until a newline ('\n') character is detected before converting.
Definition at line 461 of file axcel.cpp.
bool axcel::io::iofmt::fix |
( |
int |
i = -1 | ) |
|
Fixed decimal notation.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, floating point values inserted into this stream are rounded in the style [-]ddd.ddd, where the number of digits after the decimal-point character is equal to the precision specification. If the precision is missing, it is taken as 6.
Definition at line 498 of file axcel.cpp.
bool axcel::io::iofmt::hex |
( |
int |
i = -1 | ) |
|
Hexadecimal.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, numbers written to this stream using operator<<() are output as an unsigned hexadecimal number.
Definition at line 431 of file axcel.cpp.
bool axcel::io::iofmt::left |
( |
int |
i = -1 | ) |
|
Left adjust.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, values inserted into the stream are to be left adjusted on the field boundary. (The default is right justification.) The converted value is padded on the right with blanks, rather than on the left with blanks or zeros. This method overrides zpad() if both are set.
Definition at line 474 of file axcel.cpp.
bool axcel::io::iofmt::ltrim |
( |
int |
i = -1 | ) |
|
Discard initial whitespace.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, any input using operator>>() will have its initial whitespace discarded before converting.
Definition at line 451 of file axcel.cpp.
bool axcel::io::iofmt::oct |
( |
int |
i = -1 | ) |
|
Octal.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, numbers written to this stream using operator<<() are output as an unsigned octal number.
Definition at line 441 of file axcel.cpp.
axcel::io::iofmt::operator string |
( |
| ) |
[virtual] |
Convert to string.
- Returns:
- Suitable string representation of object's data
Implements axcel::object.
Definition at line 269 of file axcel.cpp.
bool axcel::io::iofmt::right |
( |
int |
i = -1 | ) |
|
Right adjust.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, values inserted into the stream are to be right adjusted on the field boundary. (The default is already right justification.) The converted value is padded on the left with blanks, rather than on the right with blanks.
Definition at line 486 of file axcel.cpp.
bool axcel::io::iofmt::sci |
( |
int |
i = -1 | ) |
|
Scientific notation.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, floating point values inserted into this stream are rounded in the style [-]d.ddde±dd where there is one digit before the decimal-point character and the number of digits after it is equal to the precision; if the precision is missing, it is taken as 6. The exponent always contains at least two digits; if the values is zero, the exponent is 00.
Definition at line 512 of file axcel.cpp.
bool axcel::io::iofmt::sign |
( |
int |
i = -1 | ) |
|
Display number sign.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, a sign (+ or -) should always be placed before a number produced by a signed conversion using operator<<(). By default a sign is used only for negative numbers.
A + overrides a space if both are used.
Definition at line 400 of file axcel.cpp.
string axcel::io::iofmt::type |
( |
| ) |
[virtual] |
Get type of object.
- Returns:
- string containing name of object's class.
Implements axcel::object.
Definition at line 253 of file axcel.cpp.
bool axcel::io::iofmt::zpad |
( |
int |
i = -1 | ) |
|
Zero pad numbers.
- Parameters:
-
- Returns:
- Value of this flag
Sets this flag if i = 1, or unsets it if i = 0. When this flag is set, numeric values are padded on the left with zeros rather than blanks when using operator<<(). If left() is set, this flag is ignored. If a precision is given with a numeric conversions, this flag is ignored. For other conversions, the behavior is undefined.
Definition at line 388 of file axcel.cpp.
Member Data Documentation
The documentation for this class was generated from the following files: