X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Console%2FParsedCommand.ih;h=d8a72d28ab5715739957ddca477e4aa97c8d3138;hb=63c40810b93b4d8f3d6dad5f987adc5f2bf5b5ed;hp=445d05521c3d658ed813dc8f7749bdc7d7639141;hpb=da7b4fef4655148b8cfb2857e0d80e4d92a3b65e;p=senf.git diff --git a/Console/ParsedCommand.ih b/Console/ParsedCommand.ih index 445d055..d8a72d2 100644 --- a/Console/ParsedCommand.ih +++ b/Console/ParsedCommand.ih @@ -34,10 +34,43 @@ namespace senf { namespace console { namespace detail { +#ifndef DOXYGEN + + struct ArgumentInfoBase + : public intrusive_refcount + { + typedef boost::intrusive_ptr ptr; + + std::string type; + std::string name; + bool hasDefault; + std::string doc; + + ArgumentInfoBase(std::string const & type); + + virtual std::string defaultValueStr() const = 0; + }; + + template + struct ArgumentInfo + : public ArgumentInfoBase + { + typedef boost::intrusive_ptr ptr; + + static ptr create(); + ArgumentInfo(); + + ParameterType defaultValue; + + virtual std::string defaultValueStr() const; + }; + template ::value> struct ParsedCommandTraits {}; + // FirstArgType returns void, if the function has no arguments, otherwise it returns arg1_type + template 0)> struct FirstArgType { @@ -54,10 +87,8 @@ namespace detail { struct ParsedCommandTraits { typedef Function base_type; - typedef typename senf::remove_member_pointer< - typename boost::remove_pointer::type>::type function_type; + typedef typename senf::remove_any_pointer::type function_type; typedef boost::function_traits base_traits; - typedef typename FirstArgType::type first_arg_type; static const bool has_ostream_arg = boost::is_same::value; @@ -73,6 +104,22 @@ namespace detail { typedef typename senf::member_class::type class_type; }; + template + struct CheckVoidReturn + { + template + static void call(Fn fn, std::ostream & os); + }; + + template <> + struct CheckVoidReturn + { + template + static void call(Fn fn, std::ostream & os); + }; + +#endif + }}} ///////////////////////////////ih.e////////////////////////////////////////