X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FConsole%2FMainpage.dox;h=1811aa2d18aea96fc45cec75c68f348c6a521545;hb=f13780e9e4da7df981d6f6542fbdc714beb34765;hp=51b6360877ae07b05ea227247ee725063e23f433;hpb=f7f08ce8a2ffd9a8004ab04a22a8ed434c0812f7;p=senf.git diff --git a/senf/Utils/Console/Mainpage.dox b/senf/Utils/Console/Mainpage.dox index 51b6360..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 types + \section console_args Console library supported types - By default, 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 may \e only be + written: +
+    ((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 @@ -1277,19 +1330,19 @@ 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(&fun4)); + .add("test8", boost::function(&fun4)); \endcode Here, the type signature specified via \c boost::function is different from the real type signature but is compatible. \c boost::function automatically handles the conversion - process. Since the console library now sees the argument and return value of type \c unsigned, - the values will be parsed correctly as numeric values. + process. Since the console library now sees the argument and return value of type \c bool, + the values will be parsed and formatted as boolean values. \subsection console_args_special Special Console types