]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/value.h
Switch template parameters of load_sub around to allow automatic deduction
[libs/datafile.git] / source / value.h
index 5fc3540f763ee9a2a8d4de12f623d5b2f77eccb3..f809c8fe4d3001cfba4660f45b9e9556a15d3ab8 100644 (file)
@@ -1,10 +1,11 @@
-/*
-This file is part of libmspparser
+/* $Id$
+
+This file is part of libmspdatafile
 Copyright © 2006  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
-#ifndef MSP_PARSER_VALUE_H_
-#define MSP_PARSER_VALUE_H_
+#ifndef MSP_DATAFILE_VALUE_H_
+#define MSP_DATAFILE_VALUE_H_
 
 #include <sstream>
 #include <string>
@@ -12,7 +13,7 @@ Distributed under the LGPL
 #include "error.h"
 
 namespace Msp {
-namespace Parser {
+namespace DataFile {
 
 class Value
 {
@@ -35,7 +36,7 @@ private:
 };
 typedef std::vector<Value> ValueArray;
 
-template<typename T> struct TypeResolver { };
+template<typename T> struct TypeResolver { static const Value::Type type=Value::ENUM; };
 
 template<> struct TypeResolver<short>          { static const Value::Type type=Value::INTEGER; };
 template<> struct TypeResolver<unsigned short> { static const Value::Type type=Value::INTEGER; };
@@ -87,7 +88,7 @@ inline const std::string &Value::get<const std::string&>() const
        return data;
 }
 
-} // namespace Parser
+} // namespace DataFile
 } // namespace Msp
 
 #endif