Simpatico
v1.10
|
Wrapper for a long int, for formatted ostream output.
An Lng object has a long int numerical value, and a minimum output field width. The << operator for an Lng uses the specified width. The numerical value and width may both be optionally specified as parameters to a constructor. If the width is not specified, it is is is set to a default value equal to Format::defaultWidth().
An Lng 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 <Lng.h>
Public Member Functions | |
Constructors | |
Lng () | |
Default constructor. More... | |
Lng (long int value) | |
Constructor, value only. More... | |
Lng (long int value, int width) | |
Constructor, value and width. More... | |
Setters | |
void | setValue (long int value) |
Set value of long int. More... | |
void | setWidth (int width) |
Set field width. More... | |
Accessors | |
long int | value () |
Get value of long int. More... | |
int | width () |
Get field width. More... | |
Friends | |
std::istream & | operator>> (std::istream &in, Lng &object) |
Input stream extractor for an Lng object. More... | |
std::ostream & | operator<< (std::ostream &out, const Lng &object) |
Output stream inserter for an Lng object. More... | |
|
explicit |
Util::Lng::Lng | ( | long int | value, |
int | width | ||
) |
void Util::Lng::setValue | ( | long int | value | ) |
void Util::Lng::setWidth | ( | int | width | ) |
long int Util::Lng::value | ( | ) |
int Util::Lng::width | ( | ) |
|
friend |
|
friend |