X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Console%2FParsedCommand.cti;h=9abe00dc94db72123cdb54d42984234c95e41900;hb=f47679431aa3461936ee4a85c0c4216e44292b55;hp=72f372ee91568081637551c35f482272fa3519ba;hpb=ef4c5558d6a52367bd7040530d40c7616f6f5b71;p=senf.git diff --git a/Console/ParsedCommand.cti b/Console/ParsedCommand.cti index 72f372e..9abe00d 100644 --- a/Console/ParsedCommand.cti +++ b/Console/ParsedCommand.cti @@ -118,63 +118,67 @@ ParsedAttributeAttributorBase(Overload & overload, unsigned index) // senf::console::ParsedAttributeAttributor template -template prefix_ typename senf::console::ParsedAttributeAttributor::next_type -senf::console::ParsedAttributeAttributor:: -argInfo(ArgumentPack const & args) +senf::console::ParsedAttributeAttributor::arg() const { - typedef typename boost::parameter::binding< - ArgumentPack, tag::detail::default_value_>::type default_value_t; - return argInfo( args, boost::is_same() ); + return next(); } template template prefix_ typename senf::console::ParsedAttributeAttributor::next_type senf::console::ParsedAttributeAttributor:: -argInfo(ArgumentPack const & args, boost::mpl::true_) +argInfo(ArgumentPack const & args) const { - return argInfo( args[tag::name_ | ""], - args[tag::description_ | ""] ); +# define HaveArg(tag) boost::is_same< \ + typename boost::parameter::binding::type, void >() + + argInfo( kw::name, args, HaveArg(kw::type::name) ); + argInfo( kw::description, args, HaveArg(kw::type::description) ); + argInfo( kw::default_value, args, HaveArg(kw::type::default_value) ); + return next(); + +# undef HaveArg } template +template +prefix_ void senf::console::ParsedAttributeAttributor:: +argInfo(Kw const &, ArgumentPack const &, boost::mpl::true_) + const +{} + +template template -prefix_ typename senf::console::ParsedAttributeAttributor::next_type -senf::console::ParsedAttributeAttributor:: -argInfo(ArgumentPack const & args, boost::mpl::false_) +prefix_ void senf::console::ParsedAttributeAttributor:: +argInfo(boost::parameter::keyword const &, ArgumentPack const & args, + boost::mpl::false_) const { - return argInfo( args[tag::name_ | ""], - args[tag::description_ | ""], - args[tag::default_value_ | value_type()] ); + this->argName(args[kw::name]); } template -prefix_ typename senf::console::ParsedAttributeAttributor::next_type -senf::console::ParsedAttributeAttributor::argInfo(std::string const & name, - std::string const & doc) +template +prefix_ void senf::console::ParsedAttributeAttributor:: +argInfo(boost::parameter::keyword const &, ArgumentPack const & args, + boost::mpl::false_) const { - this->argName(name); - this->argDoc(doc); - return next(); + this->argDoc(args[kw::description]); } template -prefix_ typename senf::console::ParsedAttributeAttributor::next_type -senf::console::ParsedAttributeAttributor::argInfo(std::string const & name, - std::string const & doc, - value_type const & value) +template +prefix_ void senf::console::ParsedAttributeAttributor:: +argInfo(boost::parameter::keyword const &, ArgumentPack const & args, + boost::mpl::false_) const { - this->argName(name); - this->argDoc(doc); - defaultValue(value); - return next(); + this->defaultValue(args[kw::default_value]); } template @@ -185,7 +189,7 @@ ParsedAttributeAttributor(Overload & overload) {} template -prefix_ senf::console::ParsedAttributeAttributor +prefix_ typename senf::console::ParsedAttributeAttributor::next_type senf::console::ParsedAttributeAttributor::next() const { @@ -207,7 +211,8 @@ template prefix_ senf::console::ParsedAttributeAttributor:: ParsedAttributeAttributor(Overload & overload) - : ParsedCommandAttributor (overload, index) + : ParsedAttributeAttributorBase< Overload, + ParsedAttributeAttributor > (overload, index) {} ///////////////////////////////////////////////////////////////////////////