X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FConsole%2FMainpage.dox;h=1811aa2d18aea96fc45cec75c68f348c6a521545;hb=fd884ba2ba992b5032c0644ade77613074216767;hp=e5f90e483378bcc6ba6d5837c2bc93e8fa2f704a;hpb=601d1f509f5bb24df167a4dd5a20da67a0af9af8;p=senf.git diff --git a/senf/Utils/Console/Mainpage.dox b/senf/Utils/Console/Mainpage.dox index e5f90e4..1811aa2 100644 --- a/senf/Utils/Console/Mainpage.dox +++ b/senf/Utils/Console/Mainpage.dox @@ -1176,11 +1176,64 @@ After this setup, \c varChanged will be called, whenever the value has changed. - \section console_args Special argument types + \section console_args Console library supported types - By default, argument types which can be read and written using \c iostreams are automatically - supported. Other types need to be registered explicitly + By default, types which can be read and written using \c iostreams are automatically supported. + This includes all the C++ built-in types as well as user defined streamable types. + An exception is made for all \c char types: These types are by default parsed as \e numeric + values not single-character data. To interpret \c char values as single-char strings, use \ref + senf::console::CharAsString. + + \subsection console_args_stl STL container support + + The %console library contains support for the STL container types: \c std::vector, \c + std::list, \c std::set, \c std::multiset, \c std::map and \c std::multimap. + + All container types are parsed as parenthesized list of elements. Each element is parsed as + defined for the element type: + + \c vector, \c list or \c set of integers: +
+ (1 2 3) ++ + \c vector, \c list or \c set of strings: +
+ ("String 1" "String 2" "String 3") ++ + \c vector, \c list or \c set of pair
+ ((1 "String 1") (2 "String 2") (3 "String 3")) ++ + Empty collection: +
+ () ++ + Collection's with only one element may skip the parenthesis if and only if the element + type does not need additional parenthesis + + A \c vector, \c list or \c set of integer with one element may be written with or without + parenthesis: +
+ (1) + 1 ++ + \e but a single element \c vector, \c list or \c set of pair
+ ((1 "String 1")) ++ + In mapping containers, the key and value are separated by \c =: +
+ (foo=1 bar=2 "foo bar"=3) ++ \subsection console_args_bool Boolean arguments and return values @@ -1271,27 +1324,34 @@ \endhtmlonly - \subsection console_args_convert Handling special argument types by conversion + \subsection console_args_convert Handling argument types by conversion Sometimes an argument type is best handled by just pretending it to be of some other type. The basic idea is, to us \c boost::function to convert the real argument type to some different type \code - unsigned char fun4(unsigned char value) + int fun4(int value) { return value; } senf::console::root() - .add("test8", boost::function