Debugger: Split into core library and application.
[haiku.git] / src / kits / debugger / value / values / BoolValue.cpp
blob4d2c97ed02cfc4f4369d33187775ded9aeec7f80
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
7 #include "BoolValue.h"
10 BoolValue::BoolValue(bool value)
12 fValue(value)
17 BoolValue::~BoolValue()
22 bool
23 BoolValue::ToString(BString& _string) const
25 BString string = fValue ? "true" : "false";
26 if (string.Length() == 0)
27 return false;
29 _string = string;
30 return true;
34 bool
35 BoolValue::ToVariant(BVariant& _value) const
37 _value = fValue;
38 return true;
42 bool
43 BoolValue::operator==(const Value& other) const
45 const BoolValue* otherBool = dynamic_cast<const BoolValue*>(&other);
46 return otherBool != NULL ? fValue == otherBool->fValue : false;