11
11
#include < iostream>
12
12
#include < utility>
13
13
14
- #include < boost/filesystem.hpp>
15
14
#include < boost/program_options.hpp>
16
15
#include < boost/system/config.hpp>
17
16
18
- namespace bfs = boost::filesystem;
17
+
18
+ #include < filesystem>
19
+
20
+ namespace fs = std::filesystem;
21
+
19
22
namespace bpo = boost::program_options;
20
23
21
24
// ////////////////////////////////////////////////////////////////////////
22
25
23
26
static bool parseAndEmitFormatted (cppparser::CppParser& parser,
24
- const bfs ::path& inputFilePath,
25
- const bfs ::path& outputFilePath,
27
+ const fs ::path& inputFilePath,
28
+ const fs ::path& outputFilePath,
26
29
const cppcodegen::CppWriter& cppWriter)
27
30
{
28
31
auto progUnit = parser.parseFile (inputFilePath.string ().c_str ());
29
32
if (!progUnit)
30
33
return false ;
31
- bfs ::create_directories (outputFilePath.parent_path ());
34
+ fs ::create_directories (outputFilePath.parent_path ());
32
35
std::ofstream stm (outputFilePath.string ());
33
36
cppWriter.emit (*progUnit.get (), stm);
34
37
@@ -54,21 +57,21 @@ static std::pair<size_t, size_t> performTest(cppparser::CppParser& parser, const
54
57
std::vector<std::string> parsingFailedFor;
55
58
std::vector<FilePair> diffFailedList;
56
59
57
- for (bfs ::recursive_directory_iterator dirItr (params.inputPath ); dirItr != bfs ::recursive_directory_iterator ();
60
+ for (fs ::recursive_directory_iterator dirItr (params.inputPath ); dirItr != fs ::recursive_directory_iterator ();
58
61
++dirItr)
59
62
{
60
63
cppcodegen::CppWriter cppWriter;
61
- bfs ::path file = *dirItr;
62
- if (bfs ::is_regular_file (file))
64
+ fs ::path file = *dirItr;
65
+ if (fs ::is_regular_file (file))
63
66
{
64
67
++numInputFiles;
65
68
std::cout << " CppParserTest: Parsing " << file.string () << " ...\n " ;
66
69
auto fileRelPath = file.string ().substr (inputPathLen);
67
- bfs ::path outfile = params.outputPath / fileRelPath;
68
- bfs ::remove (outfile);
69
- if (parseAndEmitFormatted (parser, file, outfile, cppWriter) && bfs ::exists (outfile))
70
+ fs ::path outfile = params.outputPath / fileRelPath;
71
+ fs ::remove (outfile);
72
+ if (parseAndEmitFormatted (parser, file, outfile, cppWriter) && fs ::exists (outfile))
70
73
{
71
- bfs ::path masfile = params.masterPath / fileRelPath;
74
+ fs ::path masfile = params.masterPath / fileRelPath;
72
75
std::pair<int , int > diffStartInfo;
73
76
auto rez = compareFiles (outfile, masfile, diffStartInfo);
74
77
if (rez == kSameFiles )
0 commit comments