X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FConsole%2FTraits.hh;fp=senf%2FUtils%2FConsole%2FTraits.hh;h=b65565021e218b3430a2c8d27c12b43f8819222b;hb=649d1287af25496ff538bc97ea03a17cd03c4200;hp=b281c93779a0d03be76193c49e6e8d55e3c3dc1f;hpb=13d2e8af1e2516a2289949b8360f4e6a1c508720;p=senf.git 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.