// Represent // // Douglas Thrift // // $Id$ #ifndef _DataType_hpp_ #define _DataType_hpp_ #include "Represent.hpp" #ifdef MENES_PRAGMA_ONCE #pragma once #endif class DataType { public: enum Type { TYPE_bool, TYPE_char, TYPE_short, TYPE_unsigned_short, TYPE_int, TYPE_unsigned_int, TYPE_long, TYPE_unsigned_long, TYPE_float, TYPE_double, TYPE_std_string, TYPE_ext_String }; private: Type type; static ext::Vector enumeration; public: DataType(Type type = TYPE_bool) : type(type) {} DataType(const ext::String& string) : type(TYPE_bool) { operator=(string); } static const ext::Vector& enumerate(); DataType& operator=(Type type) { this->type = type; return *this; } DataType& operator=(const ext::String& string); bool operator==(const DataType& data) const { return type == data.type; } bool operator==(Type type) const { return this->type == type; } bool operator==(const ext::String& string) const { return operator ext::String() == string; } bool operator!=(const DataType& data) const { return type != data.type; } bool operator!=(Type type) const { return this->type != type; } bool operator!=(const ext::String& string) const { return operator ext::String() != string; } operator Type() const { return type; } operator ext::String() const; }; #endif // _DataType_hpp_