PSCF v1.1
|
Wrapper for an bool value, for formatted ostream output. More...
#include <Bool.h>
Public Member Functions | |
Constructors | |
Bool () | |
Default constructor. More... | |
Bool (bool value) | |
Constructor, set value. More... | |
Bool (bool value, int width) | |
Constructor, value and width. More... | |
Setters | |
void | setValue (bool value) |
Set the value. More... | |
void | setWidth (int width) |
Set the output width. More... | |
Accessors | |
bool | value () |
Return value. More... | |
int | width () |
Return default width (number of characters). More... | |
std::istream & | operator>> (std::istream &in, Bool &object) |
Input stream extractor for an Bool object. More... | |
std::ostream & | operator<< (std::ostream &out, const Bool &object) |
Output stream inserter for an Bool object. More... | |
Wrapper for an bool value, for formatted ostream output.
An Bool object has a bool value, and a minimum output field width. The << operator for a Bool uses the specified width. The 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 the default Format::defaultWidth().
An Bool object may be passed to an ostream as a temporary object. For example, the expression:
outputs the value true using the default width, followed by the false value in a field of minimum width 10.
|
explicit |
Util::Bool::Bool | ( | bool | value, |
int | width | ||
) |
void Util::Bool::setValue | ( | bool | value | ) |
void Util::Bool::setWidth | ( | int | width | ) |
bool Util::Bool::value | ( | ) |
int Util::Bool::width | ( | ) |
Return default width (number of characters).
Definition at line 41 of file Bool.cpp.
Referenced by setWidth().
|
friend |
|
friend |