Added factory functions to list a compressed archive as a file list, currently only supporting 7z

This commit is contained in:
Timo Strunk 2014-09-06 20:49:15 +02:00
parent d9fd9c9177
commit cfd9e64f78
2 changed files with 18 additions and 2 deletions

View File

@ -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;
}

View File

@ -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);