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 StringValue(const char * value)12StringValue::StringValue(const char* value) 13 : 14 fValue(value) 15 { 16 } 17 18 ~StringValue()19StringValue::~StringValue() 20 { 21 } 22 23 24 bool ToString(BString & _string) const25StringValue::ToString(BString& _string) const 26 { 27 _string = fValue; 28 return true; 29 } 30 31 32 bool ToVariant(BVariant & _value) const33StringValue::ToVariant(BVariant& _value) const 34 { 35 _value = fValue.String(); 36 return true; 37 } 38 39 40 bool operator ==(const Value & other) const41StringValue::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