20#ifndef _TRISTATE_TYPE_H_
21#define _TRISTATE_TYPE_H_
41static const char cancelled = 2;
46static const char dontKnow = cancelled;
114 : m_value(boolValue ? True : False)
126 : m_value(c==cancelled ? tristate::Cancelled : (c==1 ? True : False))
137 : m_value(intValue==(int)cancelled ? tristate::Cancelled : (intValue==1 ? True : False))
153 tristate& operator=( const tristate& tsValue) { m_value = tsValue.m_value; return * this; }
168 return TQString::fromLatin1( "false");
169 return m_value==True ? TQString::fromLatin1( "true") : TQString::fromLatin1( "cancelled");
198 return !( (tsValue.m_value==tristate::True && boolValue)
199 || (tsValue.m_value==tristate::False && !boolValue) );
208 return !( (tsValue.m_value==tristate::True && boolValue)
209 || (tsValue.m_value==tristate::False && !boolValue) );
221 return (tsValue.m_value==tristate::True && boolValue)
222 || (tsValue.m_value==tristate::False && !boolValue);
234 return (tsValue.m_value==tristate::True && boolValue)
235 || (tsValue.m_value==tristate::False && !boolValue);
3-state logical type with three values: true, false and cancelled and convenient operators.
bool operator~() const Special casting to bool type: true is only returned if the original tristate value is equal to cancel...
bool operator!() const Casting to bool type with negation: true is only returned if the original tristate value is equal to ...
friend bool operator==(bool boolValue, tristate tsValue) Equality operator comparing a bool value boolValue and a tristate value tsValue.
tristate(int intValue) Constructor accepting an integer value.
tristate() Default constructor, object has cancelled value set.
TQString toString() const
friend bool operator!=(bool boolValue, tristate tsValue) Inequality operator comparing a bool value boolValue and a tristate value tsValue.
tristate(char c) Constructor accepting a char value.
tristate(bool boolValue) Constructor accepting a boolean value.
|