Skip to content

Commit

Permalink
Use std::filesystem instead experimental one
Browse files Browse the repository at this point in the history
  • Loading branch information
uis246 committed Dec 3, 2020
1 parent f5c2598 commit 61cab4a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/AssetManager.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include "AssetManager.hpp"
#include "ModLoader.hpp"

#include <fstream>
#include <experimental/filesystem>
#include <filesystem>

#include <nlohmann/json.hpp>
#include <easylogging++.h>
Expand All @@ -12,7 +11,7 @@
#include "Utility.hpp"
#include "Plugin.hpp"

namespace fs = std::experimental::filesystem::v1;
namespace fs = std::filesystem;

const fs::path pathToAssets = "./assets/";
const std::string pathToAssetsList = "./items.json";
Expand Down
2 changes: 2 additions & 0 deletions src/ModLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <nlohmann/json.hpp>
#include <stb_image.h>

namespace fs = std::filesystem;

static std::vector<std::shared_ptr<ModLoader::Mod>> mods;

void ModLoader::LoadMod(AssetTreeNode &node) noexcept {
Expand Down
5 changes: 2 additions & 3 deletions src/ModLoader.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#pragma once
#include "AssetManager.hpp"

#include <experimental/filesystem>
#include <filesystem>

namespace ModLoader {
namespace fs = std::experimental::filesystem::v1;
struct Mod{
std::string modid;
std::string dirname;
Expand All @@ -31,7 +30,7 @@ namespace ModLoader {
void ParseAssetLua(AssetTreeNode &node) noexcept;
void ParseAssetSound(AssetTreeNode &node) noexcept;

void WalkDirEntry(const fs::directory_entry &dirEntry, AssetTreeNode *node) noexcept;
void WalkDirEntry(const std::filesystem::directory_entry &dirEntry, AssetTreeNode *node) noexcept;

void RecursiveWalkAssetFiles(AssetTreeNode &assetNode, std::function<void(AssetTreeNode&)> fnc) noexcept;
void RecursiveWalkAssetPath(const std::string &assetPath, std::function<void(AssetTreeNode&)> fnc) noexcept;
Expand Down

0 comments on commit 61cab4a

Please sign in to comment.