summaryrefslogtreecommitdiff
path: root/util/filesystem.hh
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-27 08:49:03 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-27 08:49:03 -0500
commitb4215cbbf297a79dc70e8c2cde85b849033cb144 (patch)
tree01aaca55d22c672d61a5df23be59003da34e90ea /util/filesystem.hh
parentcbc3c3ead5a29ca5d4f802793042d072b9fd25fb (diff)
downloadhorizon-b4215cbbf297a79dc70e8c2cde85b849033cb144.tar.gz
horizon-b4215cbbf297a79dc70e8c2cde85b849033cb144.tar.bz2
horizon-b4215cbbf297a79dc70e8c2cde85b849033cb144.tar.xz
horizon-b4215cbbf297a79dc70e8c2cde85b849033cb144.zip
hscript: Make portable to std::filesystem OR boost::filesystem
Diffstat (limited to 'util/filesystem.hh')
-rw-r--r--util/filesystem.hh15
1 files changed, 15 insertions, 0 deletions
diff --git a/util/filesystem.hh b/util/filesystem.hh
new file mode 100644
index 0000000..08db437
--- /dev/null
+++ b/util/filesystem.hh
@@ -0,0 +1,15 @@
+#if defined(FS_IS_BOOST)
+# include <boost/filesystem.hpp>
+ namespace fs = boost::filesystem;
+ using boost::system::error_code;
+# define fs_overwrite fs::copy_option::overwrite_if_exists
+# define rwxr_xr_x fs::perms::owner_all | fs::perms::group_read | fs::perms::group_exe | fs::perms::others_read | fs::perms::others_exe
+#elif defined(FS_IS_STDCXX)
+# include <filesystem>
+ namespace fs = std::filesystem;
+ using std::error_code;
+# define fs_overwrite fs::copy_options::overwrite_existing
+# define rwxr_xr_x fs::perms::owner_all | fs::perms::group_read | fs::perms::group_exec | fs::perms::others_read | fs::perms::others_exec
+#else
+# error Missing <filesystem> implementation.
+#endif