File tree 1 file changed +8
-14
lines changed
1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change 9
9
#ifndef XEUS_CPP_INSPECT_HPP
10
10
#define XEUS_CPP_INSPECT_HPP
11
11
12
+ #include < filesystem>
12
13
#include < fstream>
13
14
#include < string>
14
15
23
24
#include " xdemangle.hpp"
24
25
#include " xparser.hpp"
25
26
26
- #include " llvm/Support/FileSystem.h"
27
- #include " llvm/Support/Path.h"
28
-
29
27
namespace xcpp
30
28
{
31
29
struct node_predicate
@@ -102,17 +100,13 @@ namespace xcpp
102
100
static nl::json read_tagconfs (const char * path)
103
101
{
104
102
nl::json result = nl::json::array ();
105
- std::error_code EC;
106
- for (llvm::sys::fs::directory_iterator File (path, EC), FileEnd;
107
- File != FileEnd && !EC; File.increment (EC)) {
108
- llvm::StringRef FilePath = File->path ();
109
- llvm::StringRef FileName = llvm::sys::path::filename (FilePath);
110
- if (!FileName.endswith (" json" ))
111
- continue ;
112
- std::ifstream i (FilePath.str ());
113
- nl::json entry;
114
- i >> entry;
115
- result.emplace_back (std::move (entry));
103
+ for (const auto &entry: std::filesystem::directory_iterator (path)) {
104
+ if (entry.path ().extension () != " .json" )
105
+ continue ;
106
+ std::ifstream i (entry.path ());
107
+ nl::json json_entry;
108
+ i >> json_entry;
109
+ result.emplace_back (std::move (json_entry));
116
110
}
117
111
return result;
118
112
}
You can’t perform that action at this time.
0 commit comments