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';
23 typedef __int64 Store;
25 typedef long long int Store;
32 static const char signature = 'f';
38 static const char signature = 'b';
44 static const char signature = 's';
45 typedef std::string Store;
50 // For backward compatibility
51 static const char signature = 'e';
56 struct TypeInfo: SymbolType { };
59 struct TypeInfo<short int>: IntType { };
62 struct TypeInfo<unsigned short int>: IntType { };
65 struct TypeInfo<int>: IntType { };
68 struct TypeInfo<unsigned int>: IntType { };
71 struct TypeInfo<long int>: IntType { };
74 struct TypeInfo<unsigned long int>: IntType { };
78 struct TypeInfo<__int64>: IntType { };
81 struct TypeInfo<unsigned __int64>: IntType { };
84 struct TypeInfo<long long int>: IntType { };
87 struct TypeInfo<unsigned long long int>: IntType { };
91 struct TypeInfo<float>: FloatType { };
94 struct TypeInfo<double>: FloatType { };
97 struct TypeInfo<bool>: BoolType { };
100 struct TypeInfo<std::string>: StringType { };
103 struct TypeInfo<const T>: TypeInfo<T> { };
106 struct TypeInfo<T &>: TypeInfo<T> { };
108 } // namespace DataFile