CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

identstrings.h File Reference

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

Go to the source code of this file.

Classes

class  csIdentStrings
 Helper class that contains a list of identifiers and their names. More...

Defines

#define CS_IDENT_STRING_LIST(ListName)   static csIdentStrings::csIdentString ListName##_strings[] = {
 Begin an identifier list.
#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_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 90 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 95 of file identstrings.h.

#define CS_IDENT_STRING_LIST ListName   )     static 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 84 of file identstrings.h.

#define CS_IDENT_STRING_LIST_END ListName   ) 
 

Value:

{0, 0}                                                          \
  };                                                                    \
  static csIdentStrings ListName (ListName##_strings,                   \
    (sizeof (ListName##_strings) / sizeof (csIdentStrings::csIdentString)) - 1);
End an identifier list.

Definition at line 99 of file identstrings.h.


Generated for Crystal Space by doxygen 1.3.9.1