MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / NodePath

Class NodePath

core/string/node_path.h:44–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42#include "core/string/ustring.h"
43
44class [[nodiscard]] NodePath {
45 struct Data {
46 SafeRefCount refcount;
47 Vector<StringName> path;
48 Vector<StringName> subpath;
49 StringName concatenated_path;
50 StringName concatenated_subpath;
51 bool absolute;
52 mutable bool hash_cache_valid;
53 mutable uint32_t hash_cache;
54 };
55
56 mutable Data *data = nullptr;
57 void unref();
58
59 void _update_hash_cache() const;
60
61public:
62 bool is_absolute() const;
63 int get_name_count() const;
64 StringName get_name(int p_idx) const;
65 int get_subname_count() const;
66 StringName get_subname(int p_idx) const;
67 int get_total_name_count() const;
68 Vector<StringName> get_names() const;
69 Vector<StringName> get_subnames() const;
70 StringName get_concatenated_names() const;
71 StringName get_concatenated_subnames() const;
72 NodePath slice(int p_begin, int p_end = INT_MAX) const;
73
74 NodePath rel_path_to(const NodePath &p_np) const;
75 NodePath get_as_property_path() const;
76
77 void prepend_period();
78
79 _FORCE_INLINE_ uint32_t hash() const {
80 if (!data) {
81 return 0;
82 }
83 if (!data->hash_cache_valid) {
84 _update_hash_cache();
85 }
86 return data->hash_cache;
87 }
88
89 explicit operator String() const;
90 bool is_empty() const;
91
92 bool operator==(const NodePath &p_path) const;
93 bool operator!=(const NodePath &p_path) const;
94 void operator=(const NodePath &p_path);
95
96 void simplify();
97 NodePath simplified() const;
98
99 NodePath(const Vector<StringName> &p_path, bool p_absolute);
100 NodePath(const Vector<StringName> &p_path, const Vector<StringName> &p_subpath, bool p_absolute);
101 NodePath(const NodePath &p_path);

Callers 15

sliceMethod · 0.70
rel_path_toMethod · 0.70
get_as_property_pathMethod · 0.70
SceneStringNamesClass · 0.50
LiveEditorMethod · 0.50
set_sub_emitterMethod · 0.50
_notificationMethod · 0.50
Polygon2DClass · 0.50
get_bone_pathMethod · 0.50
_set_bonesMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected