--- /dev/null
+/*
+This file is part of libmspparser
+Copyright © 2006 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+#ifndef MSP_PARSER_VALUE_H_
+#define MSP_PARSER_VALUE_H_
+
+#include <sstream>
+#include <string>
+#include <vector>
+
+namespace Msp {
+namespace Parser {
+
+class Value
+{
+public:
+ enum Type
+ {
+ INTEGER,
+ FLOAT,
+ STRING,
+ BOOLEAN
+ };
+
+ Value(Type t, const std::string &d): type(t), data(d) { }
+ template<typename T>
+ T get() const
+ {
+ std::istringstream ss(data);
+ T result;
+ ss>>result;
+ if(ss.fail())
+ throw TypeError("Type mismatch");
+ return result;
+ }
+private:
+ Type type;
+ std::string data;
+};
+typedef std::vector<Value> ValueArray;
+
+} // namespace Parser
+} // namespace Msp
+
+#endif