1 /* 2 * Copyright 2010, Rene Gollent, rene@gollent.com. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "StringValue.h" 8 9 #include <stdio.h> 10 11 12 StringValue::StringValue(const char* value) 13 : 14 fValue(value) 15 { 16 } 17 18 19 StringValue::~StringValue() 20 { 21 } 22 23 24 bool 25 StringValue::ToString(BString& _string) const 26 { 27 _string = fValue; 28 return true; 29 } 30 31 32 bool 33 StringValue::ToVariant(BVariant& _value) const 34 { 35 _value = fValue.String(); 36 return true; 37 } 38 39 40 bool 41 StringValue::operator==(const Value& other) const 42 { 43 const StringValue* otherString = dynamic_cast<const StringValue*>(&other); 44 return otherString != NULL ? fValue == otherString->fValue : false; 45 } 46