Commit b87e773ee431d65aa77118d725c47cc29e257fe9

Authored by Jordi Inglada
1 parent 5ced6fe7
Exists in master

Use boost instead of std for filesystem

Showing 1 changed file with 2 additions and 14 deletions   Show diff stats
include/cbutils.h
... ... @@ -27,15 +27,9 @@
27 27 #include <chrono>
28 28 #include <iomanip>
29 29 #include <regex>
  30 +#include <boost/filesystem.hpp>
  31 +namespace fs = boost::filesystem;
30 32  
31   -#if __GNUC__ == 8
32   -#if __GNUC_MINOR__ == 2
33   -#include <filesystem>
34   -#define GCC82
35   -#else
36   -#include <experimental/filesystem>
37   -#endif
38   -#endif
39 33 namespace cbutils
40 34 {
41 35 // ----------------- String manipulation ---------------------------------------
... ... @@ -92,11 +86,6 @@ bool contains(std::string s, std::vector&lt;std::string&gt; patterns)
92 86 // ----------------- File IO ---------------------------------------------------
93 87 namespace file
94 88 {
95   -#ifndef GCC82
96   -namespace fs = std::experimental::filesystem;
97   -#else
98   -namespace fs = std::filesystem;
99   -#endif
100 89 //Reads a text file and returns a vector of lines
101 90 std::vector<std::string> read_lines(const std::string& fname)
102 91 {
... ... @@ -134,7 +123,6 @@ std::vector&lt;std::string&gt; list_files(const std::string&amp; dir,
134 123 const std::string& pattern = ".*")
135 124 {
136 125 std::regex regex_pattern(pattern);
137   - namespace fs = std::experimental::filesystem;
138 126 std::vector<std::string> result;
139 127 for(auto& p: fs::directory_iterator(dir))
140 128 {
... ...