U3D
Open-source, cross-platform 2D and 3D game engine built in C++
Loading...
Searching...
No Matches
Urho3D::StringHash Class Reference

32-bit hash value for a string. More...

#include </var/dev/u3d/stable/Source/Urho3D/Math/StringHash.h>

Collaboration diagram for Urho3D::StringHash:
[legend]

Public Member Functions

 StringHash () noexcept
 Construct with zero value.
 
 StringHash (const StringHash &rhs) noexcept=default
 Copy-construct from another hash.
 
 StringHash (unsigned value) noexcept
 Construct with an initial value.
 
 StringHash (const char *str) noexcept
 Construct from a C string.
 
 StringHash (const String &str) noexcept
 Construct from a string.
 
StringHashoperator= (const StringHash &rhs) noexcept=default
 Assign from another hash.
 
StringHash operator+ (const StringHash &rhs) const
 Add a hash.
 
StringHashoperator+= (const StringHash &rhs)
 Add-assign a hash.
 
bool operator== (const StringHash &rhs) const
 Test for equality with another hash.
 
bool operator!= (const StringHash &rhs) const
 Test for inequality with another hash.
 
bool operator< (const StringHash &rhs) const
 Test if less than another hash.
 
bool operator> (const StringHash &rhs) const
 Test if greater than another hash.
 
 operator bool () const
 Return true if nonzero hash value.
 
unsigned Value () const
 
String ToString () const
 Return as string.
 
String Reverse () const
 Return string which has specific hash value. Return first string if many (in order of calculation). Use for debug purposes only. Return empty string if URHO3D_HASH_DEBUG is off.
 
unsigned ToHash () const
 Return hash value for HashSet & HashMap.
 

Static Public Member Functions

static unsigned Calculate (const char *str, unsigned hash=0)
 Calculate hash value from a C string.
 
static StringHashRegisterGetGlobalStringHashRegister ()
 Get global StringHashRegister. Use for debug purposes only. Return nullptr if URHO3D_HASH_DEBUG is off.
 

Static Public Attributes

static const StringHash ZERO
 Zero hash.
 

Private Attributes

unsigned value_
 Hash value.
 

Detailed Description

32-bit hash value for a string.

Member Function Documentation

◆ Value()

unsigned Urho3D::StringHash::Value ( ) const
inline

Return hash value.

Here is the caller graph for this function:

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