From a20235aeb02c0c9e5ce58c0236f88a19865d571c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 8 Apr 2019 19:18:03 -0300 Subject: Add ability to edit editor feature profiles Allows enabling/disabling parts of the editor and storing/loading profiles for that. --- core/ustring.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'core/ustring.cpp') 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) { -- cgit v1.2.3