otio: began early functionality to export to OTIO

This commit is contained in:
itsmattkc
2020-09-25 16:32:18 +10:00
parent 2ea7b91f5d
commit bb6d5505f5
14 changed files with 288 additions and 10 deletions
+17
View File
@@ -170,4 +170,21 @@ bool FileFunctions::DirectoryIsValid(const QString &dir, bool try_to_create)
return false;
}
QString FileFunctions::EnsureFilenameExtension(QString fn, const QString &extension)
{
// No-op if either input is empty
if (!fn.isEmpty() && !extension.isEmpty()) {
QString extension_with_dot;
extension_with_dot.append('.');
extension_with_dot.append(extension);
if (!fn.endsWith(extension_with_dot, Qt::CaseInsensitive)) {
fn.append(extension_with_dot);
}
}
return fn;
}
OLIVE_NAMESPACE_EXIT