Common/FileSearch: Refactor DoFileSearch

This commit is contained in:
Sintendo
2025-12-24 10:14:02 +01:00
parent 3221e982d3
commit f2e1c71803
19 changed files with 87 additions and 48 deletions

View File

@@ -1,6 +1,8 @@
// Copyright 2018 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
#include <iterator>
#include <memory>
#include <vector>
@@ -35,8 +37,10 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_model_GameFileCache_finali
JNIEXPORT jobjectArray JNICALL Java_org_dolphinemu_dolphinemu_model_GameFileCache_getAllGamePaths(
JNIEnv* env, jclass, jobjectArray folder_paths, jboolean recursive_scan)
{
return VectorToJStringArray(
env, UICommon::FindAllGamePaths(JStringArrayToVector(env, folder_paths), recursive_scan));
const std::vector<std::string> paths = JStringArrayToVector(env, folder_paths);
std::vector<std::string_view> path_views;
std::ranges::copy(paths, std::back_inserter(path_views));
return SpanToJStringArray(env, UICommon::FindAllGamePaths(path_views, recursive_scan));
}
JNIEXPORT jobjectArray JNICALL