X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Console%2FMainpage.dox;h=62cffd6d85642731960c1a04a66749401e70d897;hb=fe92380af7b511d398290e4ab0c535025006b57b;hp=6929f2537fba9c84879ff36f57e4af24a1bae86f;hpb=8e708e9784c76461252c3bdf646d291c593a49be;p=senf.git diff --git a/Console/Mainpage.dox b/Console/Mainpage.dox index 6929f25..62cffd6 100644 --- a/Console/Mainpage.dox +++ b/Console/Mainpage.dox @@ -266,7 +266,7 @@ To greatly simplify parsing complex commands, we turn to automatic argument parsing. - \subsection console_autoadd Adding automatically parsed commands + \subsection console_autoadd Adding Automatically parsed commands are registered by just adding a callback which has the correct arguments and return-value defined: @@ -332,7 +332,7 @@ \endhtmlonly - \subsection command_overload Command overloading + \subsection command_overload Overloading Automatically parsed commands can be overloaded: You can register multiple commands under the same name. Each overload is tried in turn until no SyntaxErrorException is raised. @@ -358,7 +358,7 @@ server:/$ - \subsection console_attributes Attributes of automatically parsed commands + \subsection console_attributes Attributes As have seen so far, some documentation is automatically provided. We can add more info, by setting additional attributes. @@ -444,13 +444,9 @@ \endhtmlonly - - \subsection console_argattribpos Passing argument attributes as positional arguments - Since most of the time, we only need to set the name and possibly a description for arguments, there is a shortcut: name and description can be specified as positional arguments in this - order. So the following will give the exactly same result as the example in the previous section - + order. So the following will give the exactly same result as above: \code namespace kw = senf::console::kw; @@ -512,14 +508,46 @@ \endhtmlonly + + \subsection console_boostfn Non-function-pointer commands + + It is possible to add other callable objects besides function (and member-function) + pointers. However, since it is not possible to automatically deduce the argument and return + types in this case, the callables have to be wrapped in a \c boost::function object: + + \code + senf::console::root() + .add("test8", + boost::function( + boost::bind(&fun3, _1, 4u, _2))); + \endcode + + This works with any callable object where argument types cannot be deduced automatically: + Boost.Bind expressions, Boost.Lambda expressions, functors and so on. + + \htmlonly +
+    server:/$ test8 ok
+    ok
+    ok
+    ok
+    ok
+    server:/$ help test8
+    Usage:
+        test8 arg11:string
+    server:/$
+    
+ \endhtmlonly + + \subsection console_attr_summary Attribute summary Here a summary of the most common attributes - + @@ -533,7 +561,8 @@
\link senf::console::ParsedArgumentAttributorBase::doc() .doc\endlink ( \e doc )Set - documentation for all overloads
\link senf::console::ParsedArgumentAttributorBase::doc() .doc\endlink + ( \e doc )Set documentation for all overloads
\link senf::console::ParsedArgumentAttributorBase::overloadDoc() .overloadDoc\endlink ( \e doc )Set documentation for a specific overload
- + @@ -549,7 +578,7 @@ \ref senf::console::kw for a list of all argument attribute keywords - \section console_memberfn Registering member functions + \section console_memberfn Member functions Member functions are supported like non-member functions. They must however be added through a senf::console::ScopedDirectory instance to bind them to their instance.
\link senf::console::kw::name kw::name\endlinkParameter name
\link senf::console::kw::name kw::name\endlinkParameter + name
\link senf::console::kw::description kw::description\endlinkOne-line description of the argument