Simpatico
v1.10
|
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.
#include <Int.h>
Public Member Functions | |
Constructors | |
Int () | |
Default constructor. More... | |
Int (int value) | |
Constructor, value only. More... | |
Int (int value, int width) | |
Constructor, value and width. More... | |
Setters | |
void | setValue (int value) |
Set the integer value. More... | |
void | setWidth (int width) |
Set the output field width. More... | |
Accessors | |
int | value () |
Get the integer value. More... | |
int | width () |
Get the minimum field width. More... | |
Friends | |
std::istream & | operator>> (std::istream &in, Int &object) |
Input stream extractor for an Int object. More... | |
std::ostream & | operator<< (std::ostream &out, const Int &object) |
Output stream inserter for an Int object. More... | |
|
explicit |
Util::Int::Int | ( | int | value, |
int | width | ||
) |
void Util::Int::setValue | ( | int | value | ) |
void Util::Int::setWidth | ( | int | width | ) |
int Util::Int::value | ( | ) |
int Util::Int::width | ( | ) |
|
friend |
|
friend |