10#include <detail/preprocessor.hpp>
33 string_hash() : str(nullptr), hash_value(0), needs_hashing(true) {}
41 : str(str), hash_value(0), needs_hashing(true) {}
48 this->needs_hashing =
true;
60 if (this->needs_hashing)
62 return this->hash_value;
91 this->hash_value = result;
92 this->needs_hashing =
false;
132 template <
typename... Args>
140 operator string_type&()
noexcept {
150 operator const string_type&()
const noexcept {
190 return this->
string.begin();
199 return this->
string.begin();
208 return this->
string.end();
216 auto end() const noexcept {
217 return this->
string.end();
235LIBER_ASSERT_SIZE(0x40);
A minimal FD4BasicHashString implementation.
Definition text.hpp:118
auto end() noexcept
Iterator end.
Definition text.hpp:207
FD4BasicHashString(Args &&... args)
Construct a new FD4BasicHashString object with from::wstring constructor arguments.
Definition text.hpp:133
auto begin() noexcept
Iterator begin.
Definition text.hpp:189
int get_hash() const noexcept
Access the hash.
Definition text.hpp:180
const string_type & get_string() const noexcept
Access the string.
Definition text.hpp:169
auto end() const noexcept
Iterator end.
Definition text.hpp:216
string_type & get_string() noexcept
Access the string.
Definition text.hpp:159
auto begin() const noexcept
Iterator const begin.
Definition text.hpp:198
from::basic_string based on std::basic_string
from::basic_string< wchar_t, std::char_traits< wchar_t >, from::default_allocator_tag > wstring
std::wstring with from::allocator.
Definition from_string.hpp:45
from::basic_string< char, std::char_traits< char >, from::default_allocator_tag > string
std::string with from::allocator.
Definition from_string.hpp:35
Simple structure that holds a string pointer and a hash of the string.
Definition text.hpp:28
string_hash()
Construct a new string hash object.
Definition text.hpp:33
string_hash(const wchar_t *str)
Construct a new string hash object.
Definition text.hpp:40
void set_string_ptr(const wchar_t *new_ptr)
Set the underlying string pointer of the hash.
Definition text.hpp:101
int get_hash(const T &str) noexcept
Get the hash of the string.
Definition text.hpp:59
void may_change() noexcept
Request a lazy rehash if the string may change.
Definition text.hpp:47
int hash_string(const T &str) noexcept
Hash the string and get the hash.
Definition text.hpp:79
std::pair< from::wstring, bool > DLString
Common Dantelion string type.
Definition text.hpp:232