Add filesystem header to select between std::filesystem and std::experimental::filesystem depending on system availability.

Commit amended by Adam Honse <calcprogrammer1@gmail.com>
This commit is contained in:
k1-801 2021-04-24 21:40:24 +04:00 committed by Adam Honse
parent 05d72ba96f
commit ad2cd89128
6 changed files with 33 additions and 21 deletions

View file

@ -2,17 +2,15 @@
#include "ResourceManager.h"
#include "RGBController_Dummy.h"
#include "LogManager.h"
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
#include <experimental/filesystem>
#include "filesystem.h"
#include <fstream>
#include <iostream>
#include <cstring>
#define OPENRGB_PROFILE_HEADER "OPENRGB_PROFILE"
#define OPENRGB_PROFILE_VERSION OPENRGB_SDK_PROTOCOL_VERSION
namespace fs = std::experimental::filesystem;
ProfileManager::ProfileManager(std::string config_dir)
{
configuration_directory = config_dir;
@ -389,7 +387,7 @@ void ProfileManager::UpdateProfileList()
/*---------------------------------------------------------*\
| Load profiles by looking for .orp files in current dir |
\*---------------------------------------------------------*/
for(const auto & entry : fs::directory_iterator(configuration_directory))
for(const auto & entry : filesystem::directory_iterator(configuration_directory))
{
std::string filename = entry.path().filename().string();