55
66#include < boost/program_options.hpp>
77
8- #ifdef USE_BOOST_FILESYSTEM
9- #include < boost/filesystem.hpp>
10- namespace fs = boost::filesystem;
11- #else
12- #include < filesystem>
13- namespace fs = std::filesystem;
14- #endif
15-
168#include < cctype>
9+ #include < filesystem>
1710#include < fstream>
1811#include < iostream>
1912#include < regex>
@@ -304,11 +297,11 @@ std::string Generator::getHeaderDir() const noexcept
304297{
305298 if (_isIntrospection)
306299 {
307- return (fs ::path { " include" } / " graphqlservice" ).string ();
300+ return (std::filesystem ::path { " include" } / " graphqlservice" ).string ();
308301 }
309302 else if (_options.paths )
310303 {
311- return fs ::path { _options.paths ->headerPath }.string ();
304+ return std::filesystem ::path { _options.paths ->headerPath }.string ();
312305 }
313306 else
314307 {
@@ -324,13 +317,13 @@ std::string Generator::getSourceDir() const noexcept
324317 }
325318 else
326319 {
327- return fs ::path (_options.paths ->sourcePath ).string ();
320+ return std::filesystem ::path (_options.paths ->sourcePath ).string ();
328321 }
329322}
330323
331324std::string Generator::getHeaderPath () const noexcept
332325{
333- fs ::path fullPath { _headerDir };
326+ std::filesystem ::path fullPath { _headerDir };
334327
335328 if (_isIntrospection)
336329 {
@@ -348,7 +341,7 @@ std::string Generator::getObjectHeaderPath() const noexcept
348341{
349342 if (_options.separateFiles )
350343 {
351- fs ::path fullPath { _headerDir };
344+ std::filesystem ::path fullPath { _headerDir };
352345
353346 fullPath /= (_options.customSchema ->filenamePrefix + " Objects.h" );
354347 return fullPath.string ();
@@ -359,7 +352,7 @@ std::string Generator::getObjectHeaderPath() const noexcept
359352
360353std::string Generator::getSourcePath () const noexcept
361354{
362- fs ::path fullPath { _sourceDir };
355+ std::filesystem ::path fullPath { _sourceDir };
363356
364357 if (_isIntrospection)
365358 {
@@ -1666,7 +1659,8 @@ std::string Generator::getOutputCppType(const OutputField& field) const noexcept
16661659bool Generator::outputHeader () const noexcept
16671660{
16681661 std::ofstream headerFile (_headerPath, std::ios_base::trunc);
1669- IncludeGuardScope includeGuard { headerFile, fs::path (_headerPath).filename ().string () };
1662+ IncludeGuardScope includeGuard { headerFile,
1663+ std::filesystem::path (_headerPath).filename ().string () };
16701664
16711665 headerFile << R"cpp( #include "graphqlservice/GraphQLService.h"
16721666
@@ -2048,8 +2042,8 @@ bool Generator::outputSource() const noexcept
20482042)cpp" ;
20492043 if (!_isIntrospection)
20502044 {
2051- sourceFile << R"cpp( #include ")cpp" << fs::path (_objectHeaderPath). filename (). string ()
2052- << R"cpp( "
2045+ sourceFile << R"cpp( #include ")cpp"
2046+ << std::filesystem::path (_objectHeaderPath). filename (). string () << R"cpp( "
20532047
20542048)cpp" ;
20552049 }
@@ -3427,8 +3421,8 @@ std::string Generator::getIntrospectionType(
34273421std::vector<std::string> Generator::outputSeparateFiles () const noexcept
34283422{
34293423 std::vector<std::string> files;
3430- const fs ::path headerDir (_headerDir);
3431- const fs ::path sourceDir (_sourceDir);
3424+ const std::filesystem ::path headerDir (_headerDir);
3425+ const std::filesystem ::path sourceDir (_sourceDir);
34323426 std::string queryType;
34333427
34343428 for (const auto & operation : _operationTypes)
@@ -3443,10 +3437,10 @@ std::vector<std::string> Generator::outputSeparateFiles() const noexcept
34433437 // Output a convenience header
34443438 std::ofstream objectHeaderFile (_objectHeaderPath, std::ios_base::trunc);
34453439 IncludeGuardScope includeGuard { objectHeaderFile,
3446- fs ::path (_objectHeaderPath).filename ().string () };
3440+ std::filesystem ::path (_objectHeaderPath).filename ().string () };
34473441
3448- objectHeaderFile << R"cpp( #include ")cpp" << fs::path (_headerPath). filename (). string ()
3449- << R"cpp( "
3442+ objectHeaderFile << R"cpp( #include ")cpp"
3443+ << std::filesystem::path (_headerPath). filename (). string () << R"cpp( "
34503444
34513445)cpp" ;
34523446
@@ -3480,7 +3474,8 @@ std::vector<std::string> Generator::outputSeparateFiles() const noexcept
34803474 std::ofstream headerFile (headerPath, std::ios_base::trunc);
34813475 IncludeGuardScope includeGuard { headerFile, headerFilename };
34823476
3483- headerFile << R"cpp( #include ")cpp" << fs::path (_headerPath).filename ().string () << R"cpp( "
3477+ headerFile << R"cpp( #include ")cpp"
3478+ << std::filesystem::path (_headerPath).filename ().string () << R"cpp( "
34843479
34853480)cpp" ;
34863481
@@ -3503,7 +3498,7 @@ std::vector<std::string> Generator::outputSeparateFiles() const noexcept
35033498 sourceFile << R"cpp( // Copyright (c) Microsoft Corporation. All rights reserved.
35043499// Licensed under the MIT License.
35053500
3506- #include ")cpp" << fs ::path (_objectHeaderPath).filename ().string ()
3501+ #include ")cpp" << std::filesystem ::path (_objectHeaderPath).filename ().string ()
35073502 << R"cpp( "
35083503
35093504#include "graphqlservice/Introspection.h"
0 commit comments