diff options
author | Juan Linietsky <reduzio@gmail.com> | 2019-04-08 19:18:03 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2019-04-08 19:18:51 -0300 |
commit | a20235aeb02c0c9e5ce58c0236f88a19865d571c (patch) | |
tree | 9232009f86a08dedf4f6f709a8f1fd18a5df8322 /core/ustring.cpp | |
parent | 9ab17b664dbecad4bf773048c422c66320bd45eb (diff) | |
download | redot-engine-a20235aeb02c0c9e5ce58c0236f88a19865d571c.tar.gz |
Add ability to edit editor feature profiles
Allows enabling/disabling parts of the editor and storing/loading profiles for that.
Diffstat (limited to 'core/ustring.cpp')
-rw-r--r-- | core/ustring.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp index ff8fcaaaaf..d60bd16921 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3748,6 +3748,24 @@ bool String::is_valid_html_color() const { return Color::html_is_valid(*this); } +bool String::is_valid_filename() const { + + String stripped = strip_edges(); + if (*this != stripped) { + return false; + } + + if (stripped == String()) { + return false; + } + + if (find(":") != -1 || find("/") != -1 || find("\\") != -1 || find("?") != -1 || find("*") != -1 || find("\"") != -1 || find("|") != -1 || find("%") != -1 || find("<") != -1 || find(">") != -1) { + return false; + } else { + return true; + } +} + bool String::is_valid_ip_address() const { if (find(":") >= 0) { |