Browse Source

Replace std::experimental::filesystem with ghc::filesystem library.

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
2a7fab31aa
4 changed files with 13 additions and 3 deletions
  1. +3
    -0
      .gitmodules
  2. +6
    -0
      dep/Makefile
  3. +1
    -0
      dep/filesystem
  4. +3
    -3
      src/system.cpp

+ 3
- 0
.gitmodules View File

@@ -25,3 +25,6 @@
[submodule "dep/fuzzysearchdatabase"] [submodule "dep/fuzzysearchdatabase"]
path = dep/fuzzysearchdatabase path = dep/fuzzysearchdatabase
url = https://bitbucket.org/j_norberg/fuzzysearchdatabase.git url = https://bitbucket.org/j_norberg/fuzzysearchdatabase.git
[submodule "dep/filesystem"]
path = dep/filesystem
url = https://github.com/gulrak/filesystem.git

+ 6
- 0
dep/Makefile View File

@@ -54,6 +54,7 @@ oui-blendish = include/blendish.h
osdialog = include/osdialog.h osdialog = include/osdialog.h
pffft = include/pffft.h pffft = include/pffft.h
fuzzysearchdatabase = include/FuzzySearchDatabase.hpp fuzzysearchdatabase = include/FuzzySearchDatabase.hpp
ghcfilesystem = include/ghc/filesystem.hpp


DEPS += $(glew) DEPS += $(glew)
DEPS += $(glfw) DEPS += $(glfw)
@@ -70,6 +71,7 @@ DEPS += $(oui-blendish)
DEPS += $(osdialog) DEPS += $(osdialog)
DEPS += $(pffft) DEPS += $(pffft)
DEPS += $(fuzzysearchdatabase) DEPS += $(fuzzysearchdatabase)
DEPS += $(ghcfilesystem)




DEP_LOCAL := . DEP_LOCAL := .
@@ -250,6 +252,10 @@ $(fuzzysearchdatabase): fuzzysearchdatabase/src/FuzzySearchDatabase.hpp
mkdir -p include mkdir -p include
cp $^ include/ cp $^ include/


$(ghcfilesystem): filesystem/include/ghc
mkdir -p include
cp -r $^ include/

# Helpers # Helpers


src: glew-2.1.0 glfw jansson-2.12 speexdsp-SpeexDSP-1.2rc3 openssl-1.1.1d curl-7.66.0 zstd-1.4.5 libarchive-3.4.3 rtmidi-4.0.0 rtaudio nanovg nanosvg oui-blendish osdialog pffft src: glew-2.1.0 glfw jansson-2.12 speexdsp-SpeexDSP-1.2rc3 openssl-1.1.1d curl-7.66.0 zstd-1.4.5 libarchive-3.4.3 rtmidi-4.0.0 rtaudio nanovg nanosvg oui-blendish osdialog pffft


+ 1
- 0
dep/filesystem

@@ -0,0 +1 @@
Subproject commit 7e37433f318488ae4bc80f80e12df12a01579874

+ 3
- 3
src/system.cpp View File

@@ -1,7 +1,7 @@
#include <thread> #include <thread>
#include <regex> #include <regex>
#include <chrono> #include <chrono>
#include <experimental/filesystem>
#include <ghc/filesystem.hpp>


#include <dirent.h> #include <dirent.h>
#include <sys/stat.h> #include <sys/stat.h>
@@ -43,7 +43,7 @@ Important: When using `fs::path`, always convert strings to UTF-8 using
In fact, it's best to work only with strings to avoid forgetting to decode a string as UTF-8. In fact, it's best to work only with strings to avoid forgetting to decode a string as UTF-8.
The need to do this is a fatal flaw of `fs::path`, but at least `std::filesystem` has some helpful operations. The need to do this is a fatal flaw of `fs::path`, but at least `std::filesystem` has some helpful operations.
*/ */
namespace fs = std::experimental::filesystem;
namespace fs = ghc::filesystem;




namespace rack { namespace rack {
@@ -415,7 +415,7 @@ void unarchiveToFolder(const std::string& archivePath, const std::string& folder
std::string entryPath = archive_entry_pathname(entry); std::string entryPath = archive_entry_pathname(entry);
if (!fs::u8path(entryPath).is_relative()) if (!fs::u8path(entryPath).is_relative())
throw Exception(string::f("Unarchiver does not support absolute tar paths: %s", entryPath.c_str())); throw Exception(string::f("Unarchiver does not support absolute tar paths: %s", entryPath.c_str()));
entryPath = fs::absolute(fs::u8path(entryPath), fs::u8path(folderPath)).generic_u8string();
entryPath = fs::relative(fs::u8path(entryPath), fs::u8path(folderPath)).generic_u8string();
#if defined ARCH_WIN #if defined ARCH_WIN
archive_entry_copy_pathname_w(entry, string::U8toU16(entryPath).c_str()); archive_entry_copy_pathname_w(entry, string::U8toU16(entryPath).c_str());
#else #else


Loading…
Cancel
Save