|
9 | 9 | // Official repository: https://github.com/cppalliance/mrdocs |
10 | 10 | // |
11 | 11 |
|
12 | | -#include "mrdocs/Config.hpp" |
13 | | -#include <mrdocs/Support/Report.hpp> |
14 | | -#include <mrdocs/Support/Path.hpp> |
15 | | -#include <llvm/Support/FileSystem.h> |
| 12 | +#include <mrdocs/Config.hpp> |
| 13 | +#include <mrdocs/Support/Algorithm.hpp> |
16 | 14 | #include <ranges> |
17 | 15 | #include <thread> |
| 16 | +#include <llvm/Support/FileSystem.h> |
| 17 | +#include <mrdocs/Support/Path.hpp> |
| 18 | +#include <mrdocs/Support/Report.hpp> |
18 | 19 |
|
19 | 20 | namespace clang { |
20 | 21 | namespace mrdocs { |
@@ -534,5 +535,36 @@ configDir() const |
534 | 535 | return files::getParentDir(config); |
535 | 536 | } |
536 | 537 |
|
| 538 | +/** Full path to the output directory |
| 539 | +
|
| 540 | + The reference directory for MrDocs |
| 541 | + output and temporary files is the |
| 542 | + output directory. |
| 543 | +
|
| 544 | + This is either the output option |
| 545 | + (if already a directory) or |
| 546 | + the parent directory of the output |
| 547 | + option (if it is a file). |
| 548 | +
|
| 549 | + When the output option is a path |
| 550 | + that does not exist, we determine |
| 551 | + if it's a file or directory by |
| 552 | + checking if the filename contains |
| 553 | + a period. |
| 554 | +
|
| 555 | + This string will always be native style |
| 556 | + and have a trailing directory separator. |
| 557 | +*/ |
| 558 | +std::string |
| 559 | +Config::Settings:: |
| 560 | +outputDir() const |
| 561 | +{ |
| 562 | + if (files::isLexicalDirectory(output)) |
| 563 | + { |
| 564 | + return output; |
| 565 | + } |
| 566 | + return files::getParentDir(output); |
| 567 | +} |
| 568 | + |
537 | 569 | } // mrdocs |
538 | 570 | } // clang |
0 commit comments