// Represent // // Douglas Thrift // // $Id$ #ifndef _InputType_hpp_ #define _InputType_hpp_ #include "Represent.hpp" #ifndef MENES_PRAGMA_ONCE #pragma once #endif class InputType { public: enum Type { INPUT_Normal, INPUT_Binary, INPUT_Hexadecimal }; private: Type type; static ext::Vector enumeration; public: InputType(Type type = INPUT_Normal) : type(type) {} InputType(const ext::String& string) : type(INPUT_Normal) { operator=(string); } static const ext::Vector& enumerate(); InputType& operator=(Type type) { this->type = type; return *this; } InputType& operator=(const ext::String& string); bool operator==(const InputType& input) const { return type == input.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 InputType& input) const { return type != input.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 // _InputType_hpp_