2021-08-02 16:34:47 +00:00
|
|
|
/*************************************************************************/
|
|
|
|
/* NodePath.hpp */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
|
|
|
/* https://godotengine.org */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
|
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2017-03-03 00:07:14 +00:00
|
|
|
#ifndef NODEPATH_H
|
|
|
|
#define NODEPATH_H
|
|
|
|
|
2017-03-06 07:49:24 +00:00
|
|
|
#include "String.hpp"
|
2017-03-03 00:07:14 +00:00
|
|
|
|
2017-10-03 10:37:34 +00:00
|
|
|
#include <gdnative/node_path.h>
|
2017-03-03 00:07:14 +00:00
|
|
|
|
|
|
|
namespace godot {
|
|
|
|
|
2018-11-23 22:09:41 +00:00
|
|
|
class NodePath {
|
2017-03-03 00:07:14 +00:00
|
|
|
godot_node_path _node_path;
|
2018-11-23 22:09:41 +00:00
|
|
|
|
2021-01-07 01:05:12 +00:00
|
|
|
friend class Variant;
|
|
|
|
inline explicit NodePath(godot_node_path node_path) {
|
|
|
|
_node_path = node_path;
|
|
|
|
}
|
|
|
|
|
2017-03-03 00:07:14 +00:00
|
|
|
public:
|
2017-03-06 02:30:46 +00:00
|
|
|
NodePath();
|
|
|
|
|
2017-04-06 00:32:24 +00:00
|
|
|
NodePath(const NodePath &other);
|
|
|
|
|
2018-11-23 22:09:41 +00:00
|
|
|
NodePath(const String &from);
|
2017-04-06 00:32:24 +00:00
|
|
|
|
|
|
|
NodePath(const char *contents);
|
2017-03-06 02:30:46 +00:00
|
|
|
|
|
|
|
String get_name(const int idx) const;
|
|
|
|
|
|
|
|
int get_name_count() const;
|
|
|
|
|
|
|
|
String get_subname(const int idx) const;
|
|
|
|
|
|
|
|
int get_subname_count() const;
|
|
|
|
|
|
|
|
bool is_absolute() const;
|
|
|
|
|
|
|
|
bool is_empty() const;
|
|
|
|
|
2019-05-22 09:06:01 +00:00
|
|
|
NodePath get_as_property_path() const;
|
|
|
|
|
|
|
|
String get_concatenated_subnames() const;
|
|
|
|
|
2017-03-06 02:30:46 +00:00
|
|
|
operator String() const;
|
|
|
|
|
2018-11-23 22:09:41 +00:00
|
|
|
void operator=(const NodePath &other);
|
2017-04-06 00:32:24 +00:00
|
|
|
|
2018-11-23 22:09:41 +00:00
|
|
|
bool operator==(const NodePath &other);
|
2018-03-02 18:04:57 +00:00
|
|
|
|
2017-03-06 02:30:46 +00:00
|
|
|
~NodePath();
|
2017-03-03 00:07:14 +00:00
|
|
|
};
|
|
|
|
|
2018-11-23 22:09:41 +00:00
|
|
|
} // namespace godot
|
2017-03-03 00:07:14 +00:00
|
|
|
|
|
|
|
#endif // NODEPATH_H
|