mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 09:32:52 +00:00
Added factory functions to list a compressed archive as a file list, currently only supporting 7z
This commit is contained in:
parent
d9fd9c9177
commit
cfd9e64f78
18
file_path.c
18
file_path.c
@ -376,6 +376,22 @@ void dir_list_sort(struct string_list *list, bool dir_first)
|
||||
dir_first ? qstrcmp_dir : qstrcmp_plain);
|
||||
}
|
||||
|
||||
struct string_list *compressed_file_list_new(const char *path,
|
||||
const char* ext)
|
||||
{
|
||||
#ifdef HAVE_COMPRESSION
|
||||
const char* file_ext = path_get_extension(path);
|
||||
#ifdef HAVE_7ZIP
|
||||
if (strcmp(file_ext,"7z") == 0)
|
||||
{
|
||||
return compressed_7zip_file_list_new(path,ext);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
struct string_list *dir_list_new(const char *dir,
|
||||
@ -443,8 +459,6 @@ struct string_list *dir_list_new(const char *dir,
|
||||
if (supported_by_core)
|
||||
attr.i = RARCH_PLAIN_FILE;
|
||||
|
||||
|
||||
|
||||
if (!string_list_append(list, file_path, attr))
|
||||
goto error;
|
||||
}
|
||||
|
@ -67,6 +67,8 @@ struct string_list
|
||||
size_t cap;
|
||||
};
|
||||
|
||||
struct string_list *compressed_file_list_new(const char *filename,
|
||||
const char* ext);
|
||||
struct string_list *dir_list_new(const char *dir, const char *ext,
|
||||
bool include_dirs);
|
||||
void dir_list_sort(struct string_list *list, bool dir_first);
|
||||
|
Loading…
x
Reference in New Issue
Block a user