|
|
@@ -33,6 +33,7 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
|
#include "Allocator.h"
|
|
|
#include "StringUtils.h"
|
|
|
#include "List.h"
|
|
|
+#include "Hash.h"
|
|
|
|
|
|
namespace crown
|
|
|
{
|
|
|
@@ -77,6 +78,9 @@ public:
|
|
|
/// Returns wheterh the string ends with the given @æ s string.
|
|
|
bool ends_with(const char* s);
|
|
|
|
|
|
+ /// Returns the string hashed to hash::murmur2_32.
|
|
|
+ StringId32 to_string_id();
|
|
|
+
|
|
|
///
|
|
|
const char* c_str();
|
|
|
|
|
|
@@ -229,6 +233,12 @@ inline bool DynamicString::ends_with(const char* s)
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
+inline StringId32 DynamicString::to_string_id()
|
|
|
+{
|
|
|
+ return hash::murmur2_32(c_str(), length());
|
|
|
+}
|
|
|
+
|
|
|
//-----------------------------------------------------------------------------
|
|
|
inline const char* DynamicString::c_str()
|
|
|
{
|