00001
00015 #ifndef _DLRUTILITIES_OPTIONDESCRIPTION_H_
00016 #define _DLRUTILITIES_OPTIONDESCRIPTION_H_
00017
00018 #include <ostream>
00019 #include <string>
00020
00021 namespace dlr {
00022
00023 namespace utilities {
00024
00028 class OptionDescription {
00029 public:
00030
00034 OptionDescription();
00035
00036
00040 OptionDescription(const std::string& name,
00041 const std::string& shortAppearance,
00042 const std::string& longAppearance,
00043 bool requiresValue,
00044 bool allowPartialMatch,
00045 const std::string& docString,
00046 const std::string& defaultValue = "");
00047
00048
00052 ~OptionDescription();
00053
00054
00055 const std::string&
00056 getDefaultValue() const {return m_defaultValue;}
00057
00058
00059 const std::string&
00060 getName() const {return m_name;}
00061
00062
00063 size_t
00064 getMatchLength(const std::string& argument,
00065 bool& isShortMatch) const;
00066
00067
00068 std::string
00069 getOptionDoc() const;
00070
00071
00072 bool
00073 isMatch(const std::string& argument) const;
00074
00075
00076 bool
00077 requiresValue() const {return m_requiresValue;}
00078
00079 private:
00080
00081 std::string m_name;
00082 std::string m_shortAppearance;
00083 std::string m_longAppearance;
00084 bool m_requiresValue;
00085 bool m_allowPartialMatch;
00086 std::string m_docString;
00087 std::string m_defaultValue;
00088 };
00089
00090
00091 std::ostream&
00092 operator<<(std::ostream& stream,
00093 const OptionDescription& optionDescription);
00094
00095
00096 }
00097
00098 }
00099
00100 #endif // #ifndef _DLRUTILITES_OPTIONDESCRIPTION_H_