|
PSCF v1.3.3
|
Wrapper for an bool value, for formatted ostream output. More...
#include <Bool.h>
Public Member Functions | |
Constructors | |
| Bool () | |
| Default constructor. | |
| Bool (bool value) | |
| Constructor, set value. | |
| Bool (bool value, int width) | |
| Constructor, value and width. | |
Setters | |
| void | setValue (bool value) |
| Set the value. | |
| void | setWidth (int width) |
| Set the output width. | |
Accessors | |
| bool | value () |
| Return value. | |
| int | width () |
| Return default width (number of characters). | |
| std::istream & | operator>> (std::istream &in, Bool &object) |
| Input stream extractor for an Bool object. | |
| std::ostream & | operator<< (std::ostream &out, const Bool &object) |
| Output stream inserter for an Bool object. | |
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.
| Util::Bool::Bool | ( | ) |
Default constructor.
Definition at line 15 of file Bool.cpp.
Referenced by operator<<, and operator>>.
|
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 Bool(), and setWidth().
|
friend |
|
friend |