blocxx
|
The Bool class is an abstraction for the boolean data type. More...
#include <Bool.hpp>
Public Member Functions | |
Bool () | |
Create an Bool object initialized to false. | |
Bool (bool val) | |
Create an Bool object initialized to a given boolean value. | |
Bool (const Bool &arg) | |
Copy constructor. | |
Bool & | operator= (const Bool &arg) |
Assignment operator. | |
bool | operator== (const bool arg) const |
Equality operator. | |
bool | operator== (const Bool &arg) const |
Equality operator. | |
bool | operator!= (const bool arg) const |
Inequality operator. | |
bool | operator!= (const Bool &arg) const |
Inequality operator. | |
operator bool () const | |
bool | operator! () const |
Negation operator. | |
String | toString () const |
void | writeObject (std::streambuf &ostrm) const |
Write this object to an output stream. | |
void | readObject (std::streambuf &istrm) |
Read this object from an input stream. | |
Private Member Functions | |
Bool (const void *) | |
Bool (void *) | |
Bool (volatile const void *) | |
Bool (volatile void *) | |
Private Attributes | |
bool | m_val |
Friends | |
bool | operator< (const Bool &b1, const Bool &b2) |
Less than operator (friend function) | |
bool | operator!= (bool b1, Bool b2) |
Not equal operator (friend function) | |
The Bool class is an abstraction for the boolean data type.
It's not meant to be a replacement for bool. Use it if you need a type that supports toString(), readObject(), or writeObject(). It's also useful for preventing implicit conversion of char*->bool. Using it can make overloading functions safer (ie it'll be less likely the compiler will pick the wrong overload.)
|
inline |
Create an Bool object initialized to false.
Definition at line 63 of file Bool.hpp.
References m_val.
Referenced by Bool(), operator!=, operator!=(), operator<, operator=(), and operator==().
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void BLOCXX_NAMESPACE::Bool::readObject | ( | std::streambuf & | istrm | ) |
Read this object from an input stream.
istrm | The input stream to read this object from. |
Definition at line 63 of file Bool.cpp.
References m_val, and BLOCXX_NAMESPACE::BinarySerialization::read().
Referenced by BLOCXX_NAMESPACE::BinarySerialization::readBool().
String BLOCXX_NAMESPACE::Bool::toString | ( | ) | const |
Definition at line 71 of file Bool.cpp.
References m_val.
Referenced by BLOCXX_NAMESPACE::StringBuffer::operator+=().
void BLOCXX_NAMESPACE::Bool::writeObject | ( | std::streambuf & | ostrm | ) | const |
Write this object to an output stream.
ostrm | The output stream to write this object to. |
Definition at line 56 of file Bool.cpp.
References m_val, and BLOCXX_NAMESPACE::BinarySerialization::write().
Referenced by BLOCXX_NAMESPACE::BinarySerialization::writeBool().
|
private |
Definition at line 159 of file Bool.hpp.
Referenced by Bool(), Bool(), Bool(), operator bool(), operator!(), operator!=, operator!=(), operator!=(), operator<, operator=(), operator==(), operator==(), readObject(), toString(), and writeObject().