14420c1ceSMichael Pfeiffer/*
24420c1ceSMichael Pfeiffer * Copyright 2008, Haiku.
34420c1ceSMichael Pfeiffer * Distributed under the terms of the MIT license.
44420c1ceSMichael Pfeiffer *
54420c1ceSMichael Pfeiffer * Authors:
64420c1ceSMichael Pfeiffer *		Michael Pfeiffer <laplace@users.sourceforge.net>
74420c1ceSMichael Pfeiffer */
84420c1ceSMichael Pfeiffer
94420c1ceSMichael Pfeiffer#ifndef _VALUE_H
104420c1ceSMichael Pfeiffer#define _VALUE_H
114420c1ceSMichael Pfeiffer
124420c1ceSMichael Pfeiffer#include <String.h>
134420c1ceSMichael Pfeiffer
144420c1ceSMichael Pfeifferclass Value {
154420c1ceSMichael Pfeifferpublic:
164420c1ceSMichael Pfeiffer	enum Type {
174420c1ceSMichael Pfeiffer		kSymbolValue,
184420c1ceSMichael Pfeiffer		kStringValue,
194420c1ceSMichael Pfeiffer		kInvocationValue,
204420c1ceSMichael Pfeiffer		kQuotedValue,
214420c1ceSMichael Pfeiffer		kUnknownValue
224420c1ceSMichael Pfeiffer	};
234420c1ceSMichael Pfeiffer
244420c1ceSMichael Pfeifferprivate:
254420c1ceSMichael Pfeiffer	Type     fType;
264420c1ceSMichael Pfeiffer	BString* fValue;
274420c1ceSMichael Pfeiffer	BString* fTranslation;
284420c1ceSMichael Pfeiffer
294420c1ceSMichael Pfeiffer	const char* ElementForType();
304420c1ceSMichael Pfeiffer
314420c1ceSMichael Pfeifferpublic:
324420c1ceSMichael Pfeiffer	Value(BString* value = NULL, Type type = kUnknownValue);
334420c1ceSMichael Pfeiffer	virtual ~Value();
344420c1ceSMichael Pfeiffer
354420c1ceSMichael Pfeiffer	void SetType(Type type);
364420c1ceSMichael Pfeiffer	Type GetType();
374420c1ceSMichael Pfeiffer
384420c1ceSMichael Pfeiffer	// mandatory in a valid statement
394420c1ceSMichael Pfeiffer	void SetValue(BString* value);
404420c1ceSMichael Pfeiffer	BString* GetValue();
414420c1ceSMichael Pfeiffer
424420c1ceSMichael Pfeiffer	// optional
434420c1ceSMichael Pfeiffer	void SetTranslation(BString* translation);
444420c1ceSMichael Pfeiffer	BString* GetTranslation();
454420c1ceSMichael Pfeiffer
464420c1ceSMichael Pfeiffer	// convenience methods
474420c1ceSMichael Pfeiffer	const char* GetValueString();
484420c1ceSMichael Pfeiffer	const char* GetTranslationString();
494420c1ceSMichael Pfeiffer
504420c1ceSMichael Pfeiffer	void Print();
514420c1ceSMichael Pfeiffer};
524420c1ceSMichael Pfeiffer
534420c1ceSMichael Pfeiffer#endif
54