Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

EnumHelper.h File Reference

Go to the source code of this file.

Defines

#define FOREACH_ENUM(e, max, var)   for( e var=(e)0; var<max; enum_add<e>( var, +1 ) )
#define XToString(X)
#define XToThemedString(X)
#define StringToX(X)

Functions

template<typename T> void enum_add (T &val, int iAmt)

Variables

const CString EMPTY_STRING


Define Documentation

#define FOREACH_ENUM e,
max,
var   )     for( e var=(e)0; var<max; enum_add<e>( var, +1 ) )
 

#define StringToX  ) 
 

Value:

X StringTo##X( const CString& s ) \ { \ CString s2 = s; \ s2.MakeLower(); \ unsigned i; \ for( i = 0; i < ARRAYSIZE(X##Names); ++i ) \ if( !s2.CompareNoCase(X##Names[i]) ) \ return (X)i; \ return (X)(i+1); /*invalid*/ \ }

#define XToString  ) 
 

Value:

const CString& X##ToString( X x ) \ { \ if( x == ARRAYSIZE(X##Names)+1 ) \ return EMPTY_STRING; \ ASSERT(unsigned(x) < ARRAYSIZE(X##Names)); \ return X##Names[x]; \ }

#define XToThemedString  ) 
 

Value:

CString X##ToThemedString( X x ) \ { \ return THEME->GetMetric( #X, X##ToString(x) ); \ }


Function Documentation

template<typename T>
void enum_add T &  val,
int  iAmt
[inline, static]
 


Variable Documentation

const CString EMPTY_STRING [static]
 


Generated on Thu Jan 27 20:57:36 2005 for StepMania by doxygen 1.3.7