26enum tristate_cancelled_t {
107 : m_value(Cancelled) {
114 : m_value(boolValue ? True : False) {
133 return m_value == False;
141 return m_value == Cancelled;
146 inline tristate& operator=(
bool boolValue);
148 inline tristate& operator=(tristate_cancelled_t);
166 friend inline bool operator==(tristate_cancelled_t,
bool boolValue);
168 friend inline bool operator==(
bool boolValue, tristate_cancelled_t);
170 friend inline bool operator!=(tristate_cancelled_t,
bool boolValue);
172 friend inline bool operator!=(
bool boolValue, tristate_cancelled_t);
180 if (m_value == False) {
181 return QStringLiteral(
"false");
183 return m_value == True ? QStringLiteral(
"true") : QStringLiteral(
"cancelled");
205 m_value = tsValue.m_value;
209tristate& tristate::operator=(
bool boolValue)
211 m_value = boolValue ? True : False;
215tristate& tristate::operator=(tristate_cancelled_t)
228inline bool operator!=(
bool boolValue,
tristate tsValue)
230 return !((tsValue.m_value == tristate::True && boolValue)
231 || (tsValue.m_value == tristate::False && !boolValue));
238inline bool operator!=(
tristate tsValue,
bool boolValue)
240 return !((tsValue.m_value == tristate::True && boolValue)
241 || (tsValue.m_value == tristate::False && !boolValue));
251inline bool operator==(
tristate tsValue,
bool boolValue)
253 return (tsValue.m_value == tristate::True && boolValue)
254 || (tsValue.m_value == tristate::False && !boolValue);
264inline bool operator==(
bool boolValue,
tristate tsValue)
266 return (tsValue.m_value == tristate::True && boolValue)
267 || (tsValue.m_value == tristate::False && !boolValue);
274inline bool operator==(tristate_cancelled_t,
tristate tsValue)
276 return tsValue.m_value == tristate::Cancelled;
283inline bool operator==(
tristate tsValue, tristate_cancelled_t)
285 return tsValue.m_value == tristate::Cancelled;
292inline bool operator==(tristate_cancelled_t,
bool)
301inline bool operator==(
bool, tristate_cancelled_t)
310inline bool operator!=(tristate_cancelled_t,
tristate tsValue)
312 return tsValue.m_value != tristate::Cancelled;
319inline bool operator!=(
tristate tsValue, tristate_cancelled_t)
321 return tsValue.m_value != tristate::Cancelled;
328inline bool operator!=(tristate_cancelled_t,
bool)
337inline bool operator!=(
bool, tristate_cancelled_t)
345 switch (tsValue.m_value) {
346 case tristate::True: dbg.
nospace() <<
"true";
break;
347 case tristate::False: dbg.
nospace() <<
"false";
break;
348 case tristate::Cancelled: dbg.
nospace() <<
"cancelled";
break;
353inline QDebug operator<<(
QDebug dbg, tristate_cancelled_t)
359inline bool operator~(tristate_cancelled_t)
364inline bool operator!(tristate_cancelled_t)
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 ...
tristate(tristate_cancelled_t)
Constructor accepting a char value.
friend bool operator==(bool boolValue, tristate tsValue)
Equality operator comparing a bool value boolValue and a tristate value tsValue.
tristate()
Default constructor, object has cancelled value set.
friend QDebug operator<<(QDebug dbg, tristate tsValue)
qDebug() stream operator. Writes tristate value to the debug output in a nicely formatted way.
friend bool operator!=(bool boolValue, tristate tsValue)
Inequality operator comparing a bool value boolValue and a tristate value tsValue.
tristate(bool boolValue)
Constructor accepting a boolean value.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:30 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.