1 #ifndef MSP_DATAFILE_TYPE_H_
2 #define MSP_DATAFILE_TYPE_H_
4 #include <msp/strings/lexicalcast.h>
14 Symbol(const T &n): name(lexical_cast(n)) { }
16 template<typename T> operator T() const { return lexical_cast<T>(name); }
21 static const char signature = 'i';
22 typedef long long int Store;
27 static const char signature = 'f';
33 static const char signature = 'b';
39 static const char signature = 's';
40 typedef std::string Store;
45 // For backward compatibility
46 static const char signature = 'e';
51 struct TypeInfo: SymbolType { };
54 struct TypeInfo<short int>: IntType { };
57 struct TypeInfo<unsigned short int>: IntType { };
60 struct TypeInfo<int>: IntType { };
63 struct TypeInfo<unsigned int>: IntType { };
66 struct TypeInfo<long int>: IntType { };
69 struct TypeInfo<unsigned long int>: IntType { };
72 struct TypeInfo<long long int>: IntType { };
75 struct TypeInfo<unsigned long long int>: IntType { };
78 struct TypeInfo<float>: FloatType { };
81 struct TypeInfo<double>: FloatType { };
84 struct TypeInfo<bool>: BoolType { };
87 struct TypeInfo<std::string>: StringType { };
90 struct TypeInfo<const T>: TypeInfo<T> { };
93 struct TypeInfo<T &>: TypeInfo<T> { };
95 } // namespace DataFile