Lines Matching defs:Option
52 struct Option
68 //! Construct generic option (string, int, boolean).
69 Option (const char* shortName_, const char* longName_, const char* description_, const char* defaultValue_ = DE_NULL)
80 //! Option with custom parsing function.
81 Option (const char* shortName_, const char* longName_, const char* description_, ParseFunc parse_, const char* defaultValue_ = DE_NULL)
92 //! Option that uses named values.
93 Option (const char* shortName_, const char* longName_, const char* description_, const NamedValue<ValueType>* namedValues_, const NamedValue<ValueType>* namedValuesEnd_, const char* defaultValue_ = DE_NULL)
104 //! Option that uses named values.
106 Option (const char* shortName_, const char* longName_, const char* description_, const NamedValue<ValueType> (&namedValues_)[NumNamedValues], const char* defaultValue_ = DE_NULL)
118 template<class Option>
121 typedef typename Option::ValueType ValueType;
137 template<class Option> inline bool isBooleanOpt (void) { return isBoolean<typename OptTraits<Option>::ValueType>(); }
252 void addOption (const Option<OptType>& option);
299 void addOption (const OptInfo& option);
308 inline Parser& operator<< (Parser& parser, const Option<OptType>& option)
310 parser.addOption(option);
326 ((typename Option<OptType>::ParseFunc)(info->parse))(src, value);
373 void Parser::addOption (const Option<OptType>& option)
377 opt.shortName = option.shortName;
378 opt.longName = option.longName;
379 opt.description = option.description;
380 opt.defaultValue = option.defaultValue;
381 opt.isFlag = isBooleanOpt<OptType>() && !option.namedValues;
382 opt.parse = (GenericParseFunc)option.parse;
383 opt.namedValues = (const void*)option.namedValues;
384 opt.namedValuesEnd = (const void*)option.namedValuesEnd;
385 opt.namedValueStride = sizeof(*option.namedValues);
403 template<typename Option>
404 const typename TypedFieldTraits<Option>::ValueType&
405 getOption (void) const { return m_options.get<Option>(); }