From: g0dil Date: Fri, 24 Sep 2010 15:22:51 +0000 (+0000) Subject: Utils/Console: SENF_CONSOLE_REGISTER_ENUM key() modifier documentation X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=649d1287af25496ff538bc97ea03a17cd03c4200;p=senf.git Utils/Console: SENF_CONSOLE_REGISTER_ENUM key() modifier documentation git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1719 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Utils/Console/Traits.hh b/senf/Utils/Console/Traits.hh index b281c93..b655650 100644 --- a/senf/Utils/Console/Traits.hh +++ b/senf/Utils/Console/Traits.hh @@ -171,7 +171,17 @@ namespace console { This macro will register an enum type and it's enumerators defined at namespace scope. See \ref SENF_CONSOLE_REGISTER_ENUM_MEMBER to register a member enum type. - \note All enumerator values must be unique ignoring case. + By default, the keys used to represent the enumerator values in the console are identical to + the enumerator names in C++ (In the example above \c Foo1 and \c Foo2). You may however + override this default key using the + 'key("key", enumerator)' modifier: + \code + enum Foo { Foo1, Foo2 }; + SENF_CONSOLE_REGISTER_ENUM( Foo, (key("1", Foo1), Foo2) ); + \endcode + This will register the first enumerator \c Foo1 under the name '\c 1'. + + \note All enumerator keys must be unique ignoring case. The enum parser will accept any unique initial substring ignoring case as valid enum value.