ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Represent/InputType.hpp
Revision: 387
Committed: 2004-12-24T03:17:21-08:00 (20 years, 5 months ago) by douglas
File size: 1212 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     #ifndef _InputType_hpp_
8     #define _InputType_hpp_
9    
10     #include "Represent.hpp"
11    
12     #ifndef MENES_PRAGMA_ONCE
13     #pragma once
14     #endif
15    
16     class InputType
17     {
18     public:
19     enum Type { INPUT_Normal, INPUT_Binary, INPUT_Hexadecimal };
20     private:
21     Type type;
22     static ext::Vector<InputType> enumeration;
23     public:
24     InputType(Type type = INPUT_Normal) : type(type) {}
25     InputType(const ext::String& string) : type(INPUT_Normal) { operator=(string); }
26     static const ext::Vector<InputType>& enumerate();
27     InputType& operator=(Type type) { this->type = type; return *this; }
28     InputType& operator=(const ext::String& string);
29     bool operator==(const InputType& input) const { return type == input.type; }
30     bool operator==(Type type) const { return this->type == type; }
31     bool operator==(const ext::String& string) const { return operator ext::String() == string; }
32     bool operator!=(const InputType& input) const { return type != input.type; }
33     bool operator!=(Type type) const { return this->type != type; }
34     bool operator!=(const ext::String& string) const { return operator ext::String() != string; }
35     operator Type() const { return type; }
36     operator ext::String() const;
37     };
38    
39     #endif // _InputType_hpp_

Properties

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