mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Moved clean_filename to file_utils.cpp where it belongs;
Split up images exporting, and moved it to data/formats/image git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1085 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -397,25 +397,6 @@ bool cannocial_name_compare(const String& as, const Char* b) {
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Filenames
|
||||
|
||||
bool is_filename_char(Char c) {
|
||||
return isAlnum(c) || c == _(' ') || c == _('_') || c == _('-') || c == _('.');
|
||||
}
|
||||
|
||||
String clean_filename(const String& name) {
|
||||
String clean;
|
||||
FOR_EACH_CONST(c, name) {
|
||||
if (is_filename_char(c)) {
|
||||
clean += c;
|
||||
}
|
||||
}
|
||||
if (clean.empty() || starts_with(clean, _("."))) {
|
||||
clean = _("no-name") + clean;
|
||||
}
|
||||
return clean;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Regular expressions
|
||||
|
||||
/// Escape a single character for use in regular expressions
|
||||
|
||||
Reference in New Issue
Block a user