00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _SWORD_BASE_COMMANDLINEOPTION_
00020 #define _SWORD_BASE_COMMANDLINEOPTION_
00021
00022 #include "sword/base.CommandLineOptionBase.h"
00023 #include "sword/base.CommandLineTraits.h"
00024 #include <vector>
00025
00026 namespace sword {
00027
00029
00032 template<typename T>
00033 class CommandLineOption : public CommandLineOptionBase {
00034 public:
00035 CommandLineOption(
00036 CommandLineManager &manager,
00037 char shortName, const std::string &longName, const std::string &help,
00038 bool acceptMultiple, const T &value = T());
00039 virtual ~CommandLineOption();
00040
00042 word size() const;
00043
00045 T value(word i=0) const;
00046
00047 typedef std::vector<T> Values;
00048
00050 const Values &values() const;
00051
00052 private:
00053 Values values_;
00054
00055 protected:
00056
00057 virtual void push_(const std::string &value);
00058 virtual void toggle_(bool onOff);
00059
00060 };
00061
00062 }
00063
00064 #include "sword.private/base.CommandLineOption.inl"
00065
00066 #endif // _SWORD_BASE_COMMANDLINEOPTION_