diff options
author | kr3nshaw <20672068+kr3nshaw@users.noreply.github.com> | 2020-06-08 05:54:51 +1000 |
---|---|---|
committer | kr3nshaw <20672068+kr3nshaw@users.noreply.github.com> | 2020-06-08 05:54:51 +1000 |
commit | 19d0c085f76ac5830e38339248d2f70b58ee54b2 (patch) | |
tree | 92acdeb79d0deb9c9056275a38e252b001d9dfd4 /tools/knarc/Narc.h | |
parent | 61df5c9cad91d0e73c09a0f27ca57b7ad757c024 (diff) |
Added preprocessor macros to switch experimental on and off
Diffstat (limited to 'tools/knarc/Narc.h')
-rw-r--r-- | tools/knarc/Narc.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/knarc/Narc.h b/tools/knarc/Narc.h index 515a1cc2..4516d2d5 100644 --- a/tools/knarc/Narc.h +++ b/tools/knarc/Narc.h @@ -1,11 +1,18 @@ #pragma once #include <cstdint> -#include <experimental/filesystem> #include <fstream> #include <string> #include <vector> +#if __GNUC__ <= 7 +#include <experimental/filesystem> +namespace fs = std::experimental::filesystem; +#else +#include <filesystem> +namespace fs = std::filesystem; +#endif + enum class NarcError { None, @@ -71,8 +78,8 @@ class Narc public: NarcError GetError() const; - bool Pack(const std::experimental::filesystem::path& fileName, const std::experimental::filesystem::path& directory); - bool Unpack(const std::experimental::filesystem::path& fileName, const std::experimental::filesystem::path& directory); + bool Pack(const fs::path& fileName, const fs::path& directory); + bool Unpack(const fs::path& fileName, const fs::path& directory); private: NarcError error = NarcError::None; @@ -82,5 +89,5 @@ class Narc bool Cleanup(std::ifstream& ifs, const NarcError& e); bool Cleanup(std::ofstream& ofs, const NarcError& e); - std::vector<std::experimental::filesystem::directory_entry> OrderedDirectoryIterator(const std::experimental::filesystem::path& path, bool recursive) const; + std::vector<fs::directory_entry> OrderedDirectoryIterator(const fs::path& path, bool recursive) const; }; |