X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvalue.h;h=f809c8fe4d3001cfba4660f45b9e9556a15d3ab8;hb=3e2ee845788985e552d2a09f4c524e08fada1fdf;hp=be6a7a483f7768849f845051dbe563e9cea97ac9;hpb=98f563736e0837a429714b98656215503c607710;p=libs%2Fdatafile.git diff --git a/source/value.h b/source/value.h index be6a7a4..f809c8f 100644 --- a/source/value.h +++ b/source/value.h @@ -1,17 +1,19 @@ -/* -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 #include #include +#include "error.h" namespace Msp { -namespace Parser { +namespace DataFile { class Value { @@ -34,7 +36,7 @@ private: }; typedef std::vector ValueArray; -template struct TypeResolver { }; +template struct TypeResolver { static const Value::Type type=Value::ENUM; }; template<> struct TypeResolver { static const Value::Type type=Value::INTEGER; }; template<> struct TypeResolver { static const Value::Type type=Value::INTEGER; }; @@ -64,7 +66,8 @@ inline T Value::get() const T result; ss>>result; if(ss.fail()) - throw ValueError("Invalid value"); + //XXX + throw Exception("Invalid value"); return result; } @@ -85,7 +88,7 @@ inline const std::string &Value::get() const return data; } -} // namespace Parser +} // namespace DataFile } // namespace Msp #endif