source: branch/egtra-gdiplus/system/enum.sbp@ 245

Last change on this file since 245 was 210, checked in by dai, 18 years ago

空のソースコードによって生成された実行ファイルのバイナリサイズを300KBから100KBに落とした(Enum制御に関するコードジェネレータを改良)。

File size: 1.2 KB
Line 
1Class EnumBase
2Protected
3 value As Long
4 lpszName As LPSTR
5Public
6 Sub EnumBase(value As Long,lpszName As LPSTR)
7 This.value = value
8 This.lpszName = lpszName
9 End Sub
10
11 Sub ~EnumBase()
12 End Sub
13
14 Override Function ToString() As String
15 Return New String( lpszName )
16 End Function
17
18 Sub Copy(obj As EnumBase)
19 This.value = obj.value
20 This.lpszName = obj.lpszName
21 End Sub
22
23 Function Operator() As Long
24 Return This.value
25 End Function
26
27 Function Operator == (value As Long) As Boolean
28 If This.value = value Then
29 Return True
30 Else
31 Return False
32 End If
33 End Function
34
35 Function Operator == (enumBase As EnumBase) As Boolean
36 If This.value = enumBase.value Then
37 Return True
38 Else
39 Return False
40 End If
41 End Function
42
43 Function Operator or (enumBase As EnumBase) As EnumBase
44 Return New EnumBase(This.value Or enumBase.value)
45 End Function
46
47 Function Operator and (enumBase As EnumBase) As EnumBase
48 Return New EnumBase(This.value And enumBase.value)
49 End Function
50
51 Function Operator xor (enumBase As EnumBase) As EnumBase
52 Return New EnumBase(This.value Xor enumBase.value)
53 End Function
54End Class
Note: See TracBrowser for help on using the repository browser.