1*fce4895dSRene Gollent /* 2*fce4895dSRene Gollent * Copyright 2015, Rene Gollent, rene@gollent.com. 3*fce4895dSRene Gollent * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 4*fce4895dSRene Gollent * Distributed under the terms of the MIT License. 5*fce4895dSRene Gollent */ 6*fce4895dSRene Gollent #include "BoolValueFormatter.h" 7*fce4895dSRene Gollent 8*fce4895dSRene Gollent #include "BoolValue.h" 9*fce4895dSRene Gollent 10*fce4895dSRene Gollent BoolValueFormatter()11*fce4895dSRene GollentBoolValueFormatter::BoolValueFormatter() 12*fce4895dSRene Gollent : 13*fce4895dSRene Gollent ValueFormatter() 14*fce4895dSRene Gollent { 15*fce4895dSRene Gollent } 16*fce4895dSRene Gollent 17*fce4895dSRene Gollent ~BoolValueFormatter()18*fce4895dSRene GollentBoolValueFormatter::~BoolValueFormatter() 19*fce4895dSRene Gollent { 20*fce4895dSRene Gollent } 21*fce4895dSRene Gollent 22*fce4895dSRene Gollent 23*fce4895dSRene Gollent status_t FormatValue(Value * _value,BString & _output)24*fce4895dSRene GollentBoolValueFormatter::FormatValue(Value* _value, BString& _output) 25*fce4895dSRene Gollent { 26*fce4895dSRene Gollent BoolValue* value = dynamic_cast<BoolValue*>(_value); 27*fce4895dSRene Gollent if (value == NULL) 28*fce4895dSRene Gollent return B_BAD_VALUE; 29*fce4895dSRene Gollent 30*fce4895dSRene Gollent _output.SetTo(value->GetValue() ? "true" : "false"); 31*fce4895dSRene Gollent 32*fce4895dSRene Gollent return B_OK; 33*fce4895dSRene Gollent } 34