[Untested] Experimental plugin order management support

This commit is contained in:
Marc
2022-10-07 14:18:13 +02:00
parent 1abef49712
commit f3cd47b2bb
5 changed files with 192 additions and 22 deletions
+22
View File
@@ -128,3 +128,25 @@ void casefold(const char * folder) {
closedir(d);
}
}
const char * extractLastPart(const char * filePath, const char delimeter) {
const int length = strlen(filePath);
long index = -1;
for(long i= length - 1; i >= 0; i--) {
if(filePath[i] == delimeter) {
index = i + 1;
break;
}
}
if(index <= 0 || index == length) return NULL;
return &filePath[index];
}
const char * extractExtension(const char * filePath) {
return extractLastPart(filePath, '.');
}
const char * extractFileName(const char * filePath) {
return extractLastPart(filePath, '/');
}