00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _SWORD_BASE_COMMANDLINEOPTIONBASE_
00020 #define _SWORD_BASE_COMMANDLINEOPTIONBASE_
00021
00022 namespace sword {
00023
00025 class SWORDDECL CommandLineOptionBase {
00026 friend class CommandLineManager;
00027 public:
00029
00033 CommandLineOptionBase(
00034 CommandLineManager &manager,
00035 char shortName, const std::string &longName, const std::string &help,
00036 bool acceptValue, bool acceptMultiple);
00037
00038 virtual ~CommandLineOptionBase();
00039
00040
00041
00042
00043
00045
00048 bool isSet() const;
00049
00050 protected:
00051 char shortName_;
00052 std::string longName_;
00053 std::string help_;
00054 bool acceptValue_;
00055 bool acceptMultiple_;
00056 bool gotOne_;
00057 bool used_;
00058 CommandLineManager &manager_;
00059
00060 void print_(std::ostream &os, size_t ll) const;
00061 virtual void push_(const std::string &value) = 0;
00062 virtual void toggle_(bool onOff) = 0;
00063 };
00064
00065 }
00066
00067 #include "sword.private/base.CommandLineOptionBase.inl"
00068
00069 #endif // _SWORD_BASE_COMMANDLINEOPTIONBASE_