ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Represent/InputType.cpp
Revision: 387
Committed: 2004-12-24T03:17:21-08:00 (20 years, 6 months ago) by douglas
File size: 791 byte(s)
Log Message:
Getting somewhere, but I've hit some weird stuff.

File Contents

# User Rev Content
1 douglas 387 // Represent
2     //
3     // Douglas Thrift
4     //
5     // $Id$
6    
7     #include "InputType.hpp"
8    
9     const ext::Vector<InputType>& InputType::enumerate()
10     {
11     if (enumeration.IsEmpty())
12     {
13     _foru (type, INPUT_Normal, INPUT_Hexadecimal + 1) enumeration.InsertLast(Type(type));
14     }
15    
16     return enumeration;
17     }
18    
19     ext::Vector<InputType> InputType::enumeration;
20    
21     InputType& InputType::operator=(const ext::String& string)
22     {
23     if (enumeration.IsEmpty()) enumerate();
24    
25     ext::Vector<InputType>::ConstIterator found(enumeration.Find(string));
26    
27     if (found != enumeration.End()) type = *found;
28    
29     return *this;
30     }
31    
32     InputType::operator ext::String() const
33     {
34     switch (type)
35     {
36     case INPUT_Normal:
37     return "Normal";
38     case INPUT_Binary:
39     return "Binary";
40     case INPUT_Hexadecimal:
41     return "Hexadecimal";
42     default:
43     return ext::String();
44     }
45     }

Properties

Name Value
svn:eol-style native
svn:keywords Id