|
PSCF v1.3.3
|
Wrapper for an int, for formatted ostream output. More...
#include <Int.h>
Public Member Functions | |
Constructors | |
| Int () | |
| Default constructor. | |
| Int (int value) | |
| Constructor, value only. | |
| Int (int value, int width) | |
| Constructor, value and width. | |
Setters | |
| void | setValue (int value) |
| Set the integer value. | |
| void | setWidth (int width) |
| Set the output field width. | |
Accessors | |
| int | value () |
| Get the integer value. | |
| int | width () |
| Get the minimum field width. | |
| std::istream & | operator>> (std::istream &in, Int &object) |
| Input stream extractor for an Int object. | |
| std::ostream & | operator<< (std::ostream &out, const Int &object) |
| Output stream inserter for an Int object. | |
Wrapper for an int, for formatted ostream output.
An Int object has a int numerical value, and a minimum output field width. The << operator for an Int uses the specified width. The numerical value and width may both be specified as parameters to a constructor. If the width is not specified as a constructor parameter, it is set within the constructor to a default value equal to Format::defaultWidth().
An Int object may be passed to an ostream as a temporary object. For example, the expression:
outputs the number 13 using the default width, followed by the number 25 in a field of minimum width 10.
| Util::Int::Int | ( | ) |
Default constructor.
Definition at line 19 of file Int.cpp.
Referenced by operator<<, and operator>>.
|
explicit |
| Util::Int::Int | ( | int | value, |
| int | width ) |
| void Util::Int::setValue | ( | int | value | ) |
| void Util::Int::setWidth | ( | int | width | ) |
| int Util::Int::value | ( | ) |
Get the integer value.
Definition at line 55 of file Int.cpp.
Referenced by Int(), Int(), and setValue().
| int Util::Int::width | ( | ) |
Get the minimum field width.
Definition at line 61 of file Int.cpp.
Referenced by Int(), and setWidth().
|
friend |
|
friend |