📄 waroptionlist.h
字号:
/** */#ifndef WAR_OPTION_LIST_H#define WAR_OPTION_LIST_H/* SYSTEM INCLUDES */#ifndef WAR_MAP_INCLUDED# define WAR_MAP_INCLUDED# include <map>#endif/* PROJECT INCLUDES */#ifndef WAR_OPTION_H# include "WarOption.h"#endif#ifndef WAR_EXCEPTION_H# include "WarExeption.h"#endif/* LOCAL INCLUDES *//* FORWARD REFERENCES */#ifdef __cplusplusextern "C" {#endif/****************** BEGIN OLD STYLE C spesific ********//****************** END OLD STYLE C spesific **********/#ifdef __cplusplus }#endif/****************** BEGIN C++ spesific ****************/#ifdef __cplusplustypedef std::map<const std::string, WarOption> war_option_map_t;typedef std::pair<const std::string, WarOption> war_option_pair_t;class WarOptionList : public war_option_map_t{public: typedef struct options_def_t { war_ccstr_t mName; WarOption::OptLevelE mLevel; war_ccstr_t mDefaultValue; WarOption::WarOptionTypeE mType; war_ccstr_t mDescription; } options_r; // LIFECYCLE // OPERATORS /** Merges from with this. If from contains values * that alredy exist in this, the existing values * are kept */ WarOptionList& operator += (const WarOptionList& from); // OPERATIONS // ACCESS std::string GetOption(const std::string& name) const throw(WarException); int GetIntOption(const std::string& name) const throw(WarException); static WarOptionList& GetGlobalOptions(); // INQUIRY bool HaveOption(const std::string& name) const { war_option_map_t::const_iterator P = find(name); return P != end(); } static const options_def_t spStandardOptions[]; protected:private: static WarOptionList *mspGlobalOptions;};/* INLINE METHODS *//* EXTERNAL REFERENCES */#endif /* __cplusplus *//****************** END C++ spesific ******************/#endif /* WAR_OPTION_LIST_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -