mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 11:15:34 +08:00
use keyword auto
for simplicity and avoiding false positive results when searching via ctrl+f
This commit is contained in:
parent
638eb78f0f
commit
2556db1f84
@ -617,7 +617,7 @@ std::vector<std::string> Local_Storage::get_folders_path(std::string path)
|
||||
std::vector<std::string> output{};
|
||||
try
|
||||
{
|
||||
const std::filesystem::path path_p(std::filesystem::u8path(path));
|
||||
const auto path_p(std::filesystem::u8path(path));
|
||||
if (!common_helpers::dir_exist(path_p)) return output;
|
||||
|
||||
for (const auto &dir_entry :
|
||||
|
@ -33,11 +33,11 @@ static void copy_file(const std::string &src_filepath, const std::string &dst_fi
|
||||
try
|
||||
{
|
||||
PRINT_DEBUG("copying file '%s' to '%s'", src_filepath.c_str(), dst_filepath.c_str());
|
||||
const std::filesystem::path src_p(std::filesystem::u8path(src_filepath));
|
||||
const auto src_p(std::filesystem::u8path(src_filepath));
|
||||
|
||||
if (!common_helpers::file_exist(src_p)) return;
|
||||
|
||||
const std::filesystem::path dst_p(std::filesystem::u8path(dst_filepath));
|
||||
const auto dst_p(std::filesystem::u8path(dst_filepath));
|
||||
std::filesystem::create_directories(dst_p.parent_path()); // make the folder tree if needed
|
||||
std::filesystem::copy_file(src_p, dst_p, std::filesystem::copy_options::overwrite_existing);
|
||||
} catch(...) {}
|
||||
|
@ -98,7 +98,7 @@ void KillableWorker::kill()
|
||||
|
||||
}
|
||||
|
||||
static bool create_dir_impl(std::filesystem::path &dirpath)
|
||||
static bool create_dir_impl(const std::filesystem::path &dirpath)
|
||||
{
|
||||
if (std::filesystem::is_directory(dirpath))
|
||||
{
|
||||
@ -114,13 +114,13 @@ static bool create_dir_impl(std::filesystem::path &dirpath)
|
||||
|
||||
bool common_helpers::create_dir(std::string_view filepath)
|
||||
{
|
||||
std::filesystem::path parent(std::filesystem::u8path(filepath).parent_path());
|
||||
const auto parent(std::filesystem::u8path(filepath).parent_path());
|
||||
return create_dir_impl(parent);
|
||||
}
|
||||
|
||||
bool common_helpers::create_dir(std::wstring_view filepath)
|
||||
{
|
||||
std::filesystem::path parent(std::filesystem::path(filepath).parent_path());
|
||||
const auto parent(std::filesystem::path(filepath).parent_path());
|
||||
return create_dir_impl(parent);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user