00001 #ifndef HEADER_OPTIONPARAMS_H
00002 #define HEADER_OPTIONPARAMS_H
00003
00004 class Environ;
00005
00006 #include "NoCopy.h"
00007
00008 #include <map>
00009 #include <string>
00010
00011
00012
00013
00014 class OptionParams : public NoCopy {
00015 public:
00016 enum eType {
00017 TYPE_NUMBER,
00018 TYPE_BOOLEAN,
00019 TYPE_STRING,
00020 TYPE_PATH
00021 };
00022 private:
00023 struct Param {
00024 eType type;
00025 std::string help;
00026 Param(eType aType, const std::string &aHelp)
00027 : type(aType), help(aHelp) {}
00028 };
00029 typedef std::map<std::string,Param> t_params;
00030 t_params m_params;
00031 int m_maxSize;
00032 private:
00033 std::string getType(eType type) const;
00034 public:
00035 OptionParams() { m_maxSize = 0; }
00036 void addParam(const std::string &name, eType type,
00037 const std::string &help);
00038
00039 std::string getHelp(const Environ *options) const;
00040 std::string getConfig(const Environ *options) const;
00041 };
00042
00043
00044
00045 #endif