summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2021-08-24 17:06:16 +0200
committerGitHub <noreply@github.com>2021-08-24 17:06:16 +0200
commit7e0f1fa2ec568bdbbfb4e8b30f0b6a192c5f18ca (patch)
tree989fef07e6d7c3496412ec985704a855fabf1129
parent9500950af67fb740071606fcc6a5c4ec4844fb19 (diff)
parent17821603b49b77668c67c0362be28c9dbea829e4 (diff)
Merge pull request #52041 from Rubonnek/expose-simplify-path
Expose `String.simplify_path`
-rw-r--r--core/variant/variant_call.cpp1
-rw-r--r--doc/classes/String.xml6
2 files changed, 7 insertions, 0 deletions
diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp
index c3481d4896..a4817eb7d2 100644
--- a/core/variant/variant_call.cpp
+++ b/core/variant/variant_call.cpp
@@ -1422,6 +1422,7 @@ static void _register_variant_builtin_methods() {
bind_method(String, is_absolute_path, sarray(), varray());
bind_method(String, is_rel_path, sarray(), varray());
+ bind_method(String, simplify_path, sarray(), varray());
bind_method(String, get_base_dir, sarray(), varray());
bind_method(String, get_file, sarray(), varray());
bind_method(String, xml_escape, sarray("escape_quotes"), varray(false));
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index 277eaa7376..de9eb518c6 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -646,6 +646,12 @@
Returns the similarity index of the text compared to this string. 1 means totally similar and 0 means totally dissimilar.
</description>
</method>
+ <method name="simplify_path" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns a simplified canonical path.
+ </description>
+ </method>
<method name="split" qualifiers="const">
<return type="PackedStringArray" />
<argument index="0" name="delimiter" type="String" />