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