Pass std::ranges::subrange to PHYSFSX_findabsoluteFiles

This commit is contained in:
Kp 2022-10-09 23:15:21 +00:00
parent 052dff6dae
commit 2c7ed3cfce
2 changed files with 2 additions and 2 deletions

View file

@ -83,7 +83,7 @@ PHYSFSX_uncounted_list PHYSFSX_findFiles(const char *path, partial_range_t<const
[[nodiscard]] [[nodiscard]]
__attribute_nonnull() __attribute_nonnull()
PHYSFSX_uncounted_list PHYSFSX_findabsoluteFiles(const char *path, const char *realpath, const partial_range_t<const file_extension_t *> exts); PHYSFSX_uncounted_list PHYSFSX_findabsoluteFiles(const char *path, const char *realpath, std::ranges::subrange<const file_extension_t *> exts);
} }
#endif #endif

View file

@ -514,7 +514,7 @@ PHYSFSX_uncounted_list PHYSFSX_findFiles(const char *path, const partial_range_t
// Same function as above but takes a real directory as second argument, only adding files originating from this directory. // Same function as above but takes a real directory as second argument, only adding files originating from this directory.
// This can be used to further seperate files in search path but it must be made sure realpath is properly formatted. // This can be used to further seperate files in search path but it must be made sure realpath is properly formatted.
PHYSFSX_uncounted_list PHYSFSX_findabsoluteFiles(const char *path, const char *realpath, const partial_range_t<const file_extension_t *> exts) PHYSFSX_uncounted_list PHYSFSX_findabsoluteFiles(const char *path, const char *realpath, const std::ranges::subrange<const file_extension_t *> exts)
{ {
const auto predicate = [&](const char *i) { const auto predicate = [&](const char *i) {
return PHYSFSX_checkMatchingExtension(i, exts) && (!strcmp(PHYSFS_getRealDir(i), realpath)); return PHYSFSX_checkMatchingExtension(i, exts) && (!strcmp(PHYSFS_getRealDir(i), realpath));