// Represent // // Douglas Thrift // // $Id$ #include "InputType.hpp" const ext::Vector& InputType::enumerate() { if (enumeration.IsEmpty()) { _for (unsigned, type, INPUT_Normal, INPUT_Hexadecimal + 1) enumeration.InsertLast(Type(type)); } return enumeration; } ext::Vector InputType::enumeration; InputType& InputType::operator=(const ext::String& string) { if (enumeration.IsEmpty()) enumerate(); ext::Vector::ConstIterator found(ext::FindFirstAll(enumeration, string)); if (found != enumeration.End()) type = *found; return *this; } InputType::operator ext::String() const { switch (type) { default: return "Normal"; case INPUT_Binary: return "Binary"; case INPUT_Hexadecimal: return "Hexadecimal"; } }