Intelligent enum's in C++ Applications - 项目摘要 |
摘要
| 管理 |
论坛 文档
| 软件包 |
|
|
|
项目描述: |
On several occasions in the past I have found C++ enumerations lacking. Enums need an automatic default and Enums need string functionality along with the integer value, particularily in applications that interact with a user either on a GUI or in an error message.
I thus concieved the idea to represent Enums as C++ classes which provide all the standard functionality of an enum, by overiding the relevant operators. And then adding the extra functionality desired.
Rather than writing these classes, a utility which translates standard Enum declerations to such classes would be great. Along with the idea, I have supplied a utility EC (enum compiler) that will do the job on Microsoft platforms
过去我有时发现C++的枚举功能有些缺陷。 Enums需要一个自动的缺省值,并为整数提供一个字符串功能,尤其在一个GUI或错误消息中和用户交互时。
所以我设想用C++类来取代 Enums ,通过重载相关的操作符来提供 enum的所有功能。以后再增加额外的功能。不用写这些类,而是使用一个工具将标准的 Enum 声明转换为这样的类将是很方便的。我提供了一个EC (enum compiler) 工具来在 Microsoft 平台上完成这一功能。
来源: http://www.codeguru.com/cpp_mfc/EC.html |
类别: |
|
发布者:
cbd002
|
|
最新发布源码包 |
软件包 |
版本号 |
日期 |
本地下载 |
EC10 |
 1.0  |
2004-04-14 |
下载 |
|
|