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

Method is_valid_filename

core/string/ustring.cpp:5184–5200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5182static const char *invalid_filename_characters[] = { ":", "/", "\\", "?", "*", "\"", "|", "%", "<", ">" };
5183
5184bool String::is_valid_filename() const {
5185 String stripped = strip_edges();
5186 if (*this != stripped) {
5187 return false;
5188 }
5189
5190 if (stripped.is_empty()) {
5191 return false;
5192 }
5193
5194 for (const char *ch : invalid_filename_characters) {
5195 if (contains(ch)) {
5196 return false;
5197 }
5198 }
5199 return true;
5200}
5201
5202String String::validate_filename() const {
5203 String name = strip_edges();

Callers 8

create_tempMethod · 0.80
create_tempMethod · 0.80
update_dialogMethod · 0.80
PackedSceneEditorMethod · 0.80
_validate_pathMethod · 0.80
_create_new_profileMethod · 0.80
test_string.hFile · 0.80

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected