diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-04-25 13:38:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 13:38:08 +0200 |
commit | 7c7ce7dcd7430d8503d6f74bb49c68892bc31dca (patch) | |
tree | 172e5211446f4206d928a76e7eee6e8c706be819 /core/string/string_name.h | |
parent | 6a9115b983384f5dce341b22268dbc7f4a12f64e (diff) | |
parent | 8580f377a3d7d72c319e9e5489bcbe1678ad704b (diff) |
Merge pull request #60298 from reduz/scene-unique-paths
Diffstat (limited to 'core/string/string_name.h')
-rw-r--r-- | core/string/string_name.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/string/string_name.h b/core/string/string_name.h index f4233854ac..ff4c41af94 100644 --- a/core/string/string_name.h +++ b/core/string/string_name.h @@ -35,6 +35,8 @@ #include "core/string/ustring.h" #include "core/templates/safe_refcount.h" +#define UNIQUE_NODE_PREFIX "%" + class Main; struct StaticCString { @@ -100,6 +102,17 @@ public: bool operator==(const String &p_name) const; bool operator==(const char *p_name) const; bool operator!=(const String &p_name) const; + + _FORCE_INLINE_ bool is_node_unique_name() const { + if (!_data) { + return false; + } + if (_data->cname != nullptr) { + return (char32_t)_data->cname[0] == (char32_t)UNIQUE_NODE_PREFIX[0]; + } else { + return (char32_t)_data->name[0] == (char32_t)UNIQUE_NODE_PREFIX[0]; + } + } _FORCE_INLINE_ bool operator<(const StringName &p_name) const { return _data < p_name._data; } |