Crystal Space: cstool/identstrings.h File Reference (Crystal Space Public API Reference)

| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# cstool/identstrings.h File Reference

Set of helper macros to obtain the names of identifiers. More...

`#include "csutil/csstring.h"`

Go to the source code of this file.

## Classes
class | csIdentStrings
| Helper class that contains a list of identifiers and their names. More...
struct | csIdentStrings::csIdentString
## Defines
#define | CS_IDENT_STRING(Ident) {Ident, #Ident},
| Entry in the identifier list.
#define | CS_IDENT_STRING_EXPLICIT(Ident, Str) {Ident, str},
| Entry in the identifier list, but with an explicitly set name.
#define | CS_IDENT_STRING_LIST(ListName) static const csIdentStrings::csIdentString ListName##_strings[] = {
| Begin an identifier list.
#define | CS_IDENT_STRING_LIST_END(ListName)
| End an identifier list.

## Detailed Description

Set of helper macros to obtain the names of identifiers.

Definition in file identstrings.h.

## Define Documentation

#define CS_IDENT_STRING | ( | Ident |  | ) | {Ident, #Ident},

Entry in the identifier list.

Remarks:
  The identifiers *must* be sorted in increasing order.

Definition at line 98 of file identstrings.h.

#define CS_IDENT_STRING_EXPLICIT | ( | Ident,
|  | Str |  | ) | {Ident, str},

Entry in the identifier list, but with an explicitly set name.

Remarks:
  The identifiers *must* be sorted in increasing order.

Definition at line 103 of file identstrings.h.

#define CS_IDENT_STRING_LIST | ( | ListName |  | ) | static const csIdentStrings::csIdentString ListName##_strings[] = {

Begin an identifier list.

`ListName` is the identifier of the generated csIdentStrings object.

Example:

     CS_IDENT_STRING_LIST(FooNames)
       CS_IDENT_STRING(FOO_BAR)
       CS_IDENT_STRING(FOO_BAZ)
     CS_IDENT_STRING_LIST_END(FooNames)

From code, use like:

       csPrintf ("%s\n", FooNames.StringForIdent (foo));

Definition at line 92 of file identstrings.h.

#define CS_IDENT_STRING_LIST_END | ( | ListName |  | ) |

Value:

    {0, 0}                                                          \
      };                                                                    \
      CS_IMPLEMENT_STATIC_VAR(Get##ListName##Scratch, csString, ())         \
      static csIdentStrings ListName (ListName##_strings,                   \
        Get##ListName##Scratch(),                                           \
        (sizeof (ListName##_strings) / sizeof (csIdentStrings::csIdentString)) - 1);

End an identifier list.

Definition at line 107 of file identstrings.h.