2 * Copyright 2008, Haiku.
3 * Distributed under the terms of the MIT license.
6 * Michael Pfeiffer <laplace@users.sourceforge.net>
13 Value::Value(BString
* value
, Type type
)
26 void Value::SetType(Type type
)
31 Value::Type
Value::GetType()
36 void Value::SetValue(BString
* value
)
41 BString
* Value::GetValue()
46 void Value::SetTranslation(BString
* translation
)
48 fTranslation
= translation
;
51 BString
* Value::GetTranslation()
56 const char* Value::GetValueString()
59 return fValue
->String();
64 const char* Value::GetTranslationString()
66 if (fTranslation
!= NULL
) {
67 return fTranslation
->String();
72 const char* Value::ElementForType()
75 case kSymbolValue
: return "Symbol";
77 case kStringValue
: return "String";
79 case kInvocationValue
: return "Invocation";
81 case kQuotedValue
: return "Quoted";
83 case kUnknownValue
: return "Unknown";
91 printf("\t\t<%s>\n", ElementForType());
93 printf("\t\t\t<value>%s</value>\n", fValue
->String());
96 if (fTranslation
!= NULL
) {
97 printf("\t\t\t<translation>%s</translation>\n", fTranslation
->String());
99 printf("\t\t</%s>\n", ElementForType());