get rid of HAS_STD_FILESYSTEM

just use std::filesystem
This commit is contained in:
Shawn Hoffman
2022-08-19 19:50:36 -07:00
parent acafb07707
commit d51e4e5236
6 changed files with 42 additions and 121 deletions

View File

@ -3,12 +3,6 @@
#include "Core/Boot/Boot.h"
#ifdef _MSC_VER
#include <filesystem>
namespace fs = std::filesystem;
#define HAS_STD_FILESYSTEM
#endif
#include <algorithm>
#include <array>
#include <cstring>
@ -67,10 +61,6 @@ namespace fs = std::filesystem;
static std::vector<std::string> ReadM3UFile(const std::string& m3u_path,
const std::string& folder_path)
{
#ifndef HAS_STD_FILESYSTEM
ASSERT(folder_path.back() == '/');
#endif
std::vector<std::string> result;
std::vector<std::string> nonexistent;
@ -91,12 +81,7 @@ static std::vector<std::string> ReadM3UFile(const std::string& m3u_path,
if (!line.empty() && line.front() != '#') // Comments start with #
{
#ifdef HAS_STD_FILESYSTEM
const std::string path_to_add = PathToString(StringToPath(folder_path) / StringToPath(line));
#else
const std::string path_to_add = line.front() != '/' ? folder_path + line : line;
#endif
(File::Exists(path_to_add) ? result : nonexistent).push_back(path_to_add);
}
}