Kigs Framework  Doc version 0.8
Open source multi purpose Rapid Application Development framework
Static Public Member Functions | List of all members
CharToID Class Reference

#include <CoreTypes.h>

Static Public Member Functions

template<size_t _Size>
static unsigned int GetID (const char(&a)[_Size])
 only one static method to convert the given string to an unsigned int, used as an ID More...
 
static unsigned int GetID (const kstl::string &a)
 only one static method to convert the given string to an unsigned int, used as an ID More...
 

Detailed Description

CharToID utility class, convert a string to an int ID

Author
ukn
Version
ukn
Date
ukn

We use the size of the character array (including the terminating 0) as a template argument The goal is to have a loop with a repeating count which is easily computable by the optimizer.

Member Function Documentation

◆ GetID() [1/2]

template<size_t _Size>
template< size_t _Size > static inline unsigned int CharToID::GetID ( const char(&)  a[_Size])
inlinestatic

only one static method to convert the given string to an unsigned int, used as an ID

Parameters
a: char array to convert to an Id
Returns
the unique Id of the char array

◆ GetID() [2/2]

static inline unsigned int CharToID::GetID ( const kstl::string &  a)
inlinestatic

only one static method to convert the given string to an unsigned int, used as an ID

Parameters
a: string to convert to an Id
Returns
the unique Id of the string

The documentation for this class was generated from the following file: