5
5
6
6
#include < boost/program_options.hpp>
7
7
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
-
16
8
#include < cctype>
9
+ #include < filesystem>
17
10
#include < fstream>
18
11
#include < iostream>
19
12
#include < regex>
@@ -304,11 +297,11 @@ std::string Generator::getHeaderDir() const noexcept
304
297
{
305
298
if (_isIntrospection)
306
299
{
307
- return (fs ::path { " include" } / " graphqlservice" ).string ();
300
+ return (std::filesystem ::path { " include" } / " graphqlservice" ).string ();
308
301
}
309
302
else if (_options.paths )
310
303
{
311
- return fs ::path { _options.paths ->headerPath }.string ();
304
+ return std::filesystem ::path { _options.paths ->headerPath }.string ();
312
305
}
313
306
else
314
307
{
@@ -324,13 +317,13 @@ std::string Generator::getSourceDir() const noexcept
324
317
}
325
318
else
326
319
{
327
- return fs ::path (_options.paths ->sourcePath ).string ();
320
+ return std::filesystem ::path (_options.paths ->sourcePath ).string ();
328
321
}
329
322
}
330
323
331
324
std::string Generator::getHeaderPath () const noexcept
332
325
{
333
- fs ::path fullPath { _headerDir };
326
+ std::filesystem ::path fullPath { _headerDir };
334
327
335
328
if (_isIntrospection)
336
329
{
@@ -348,7 +341,7 @@ std::string Generator::getObjectHeaderPath() const noexcept
348
341
{
349
342
if (_options.separateFiles )
350
343
{
351
- fs ::path fullPath { _headerDir };
344
+ std::filesystem ::path fullPath { _headerDir };
352
345
353
346
fullPath /= (_options.customSchema ->filenamePrefix + " Objects.h" );
354
347
return fullPath.string ();
@@ -359,7 +352,7 @@ std::string Generator::getObjectHeaderPath() const noexcept
359
352
360
353
std::string Generator::getSourcePath () const noexcept
361
354
{
362
- fs ::path fullPath { _sourceDir };
355
+ std::filesystem ::path fullPath { _sourceDir };
363
356
364
357
if (_isIntrospection)
365
358
{
@@ -1666,7 +1659,8 @@ std::string Generator::getOutputCppType(const OutputField& field) const noexcept
1666
1659
bool Generator::outputHeader () const noexcept
1667
1660
{
1668
1661
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 () };
1670
1664
1671
1665
headerFile << R"cpp( #include "graphqlservice/GraphQLService.h"
1672
1666
@@ -2048,8 +2042,8 @@ bool Generator::outputSource() const noexcept
2048
2042
)cpp" ;
2049
2043
if (!_isIntrospection)
2050
2044
{
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( "
2053
2047
2054
2048
)cpp" ;
2055
2049
}
@@ -3427,8 +3421,8 @@ std::string Generator::getIntrospectionType(
3427
3421
std::vector<std::string> Generator::outputSeparateFiles () const noexcept
3428
3422
{
3429
3423
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);
3432
3426
std::string queryType;
3433
3427
3434
3428
for (const auto & operation : _operationTypes)
@@ -3443,10 +3437,10 @@ std::vector<std::string> Generator::outputSeparateFiles() const noexcept
3443
3437
// Output a convenience header
3444
3438
std::ofstream objectHeaderFile (_objectHeaderPath, std::ios_base::trunc);
3445
3439
IncludeGuardScope includeGuard { objectHeaderFile,
3446
- fs ::path (_objectHeaderPath).filename ().string () };
3440
+ std::filesystem ::path (_objectHeaderPath).filename ().string () };
3447
3441
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( "
3450
3444
3451
3445
)cpp" ;
3452
3446
@@ -3480,7 +3474,8 @@ std::vector<std::string> Generator::outputSeparateFiles() const noexcept
3480
3474
std::ofstream headerFile (headerPath, std::ios_base::trunc);
3481
3475
IncludeGuardScope includeGuard { headerFile, headerFilename };
3482
3476
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( "
3484
3479
3485
3480
)cpp" ;
3486
3481
@@ -3503,7 +3498,7 @@ std::vector<std::string> Generator::outputSeparateFiles() const noexcept
3503
3498
sourceFile << R"cpp( // Copyright (c) Microsoft Corporation. All rights reserved.
3504
3499
// Licensed under the MIT License.
3505
3500
3506
- #include ")cpp" << fs ::path (_objectHeaderPath).filename ().string ()
3501
+ #include ")cpp" << std::filesystem ::path (_objectHeaderPath).filename ().string ()
3507
3502
<< R"cpp( "
3508
3503
3509
3504
#include "graphqlservice/Introspection.h"
0 commit comments