Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions include/bout/bout.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#ifndef BOUT_H
#define BOUT_H

#include <filesystem> // std::filesystem (C++17)

// IWYU pragma: begin_keep, begin_export
#include "bout/build_defines.hxx"

Expand Down Expand Up @@ -106,10 +108,10 @@ void setupGetText();
struct CommandLineArgs {
int verbosity{4};
bool color_output{false};
std::string data_dir{"data"}; ///< Directory for data input/output
std::string opt_file{"BOUT.inp"}; ///< Filename for the options file
std::string set_file{"BOUT.settings"}; ///< Filename for the options file
std::string log_file{"BOUT.log"}; ///< File name for the log file
std::filesystem::path data_dir{"data"}; ///< Directory for data input/output
std::filesystem::path opt_file{"BOUT.inp"}; ///< Filename for the options file
std::filesystem::path set_file{"BOUT.settings"}; ///< Filename for the options file
std::filesystem::path log_file{"BOUT.log"}; ///< File name for the log file
/// The original set of command line arguments
std::vector<std::string> original_argv;
/// The "canonicalised" command line arguments, with single-letter
Expand Down
6 changes: 3 additions & 3 deletions src/bout++.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Adapted from the BOUT code by B.Dudson, University of York, Oct 2007
*
**************************************************************************
* Copyright 2010-2023 BOUT++ contributors
* Copyright 2010-2025 BOUT++ contributors
*
* Contact Ben Dudson, dudson2@llnl.gov
*
Expand Down Expand Up @@ -84,7 +84,7 @@ const char DEFAULT_DIR[] = "data";
// Define S_ISDIR if not defined by system headers (that is, MSVC)
// Taken from https://github.com/curl/curl/blob/e59540139a398dc70fde6aec487b19c5085105af/lib/curl_setup.h#L748-L751
#if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR)
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif

#ifdef _MSC_VER
Expand Down Expand Up @@ -180,7 +180,7 @@ int BoutInitialise(int& argc, char**& argv) {
// `optionfile` here, but we'd need to call parseCommandLine
// _first_ in order to do that and set the source, etc., but we
// need to call that _second_ in order to override the input file
reader->read(Options::getRoot(), "{}/{}", args.data_dir, args.opt_file);
reader->read(Options::getRoot(), "{}", (args.data_dir / args.opt_file).string());

// Get options override from command-line
reader->parseCommandLine(Options::getRoot(), args.argv);
Expand Down
Loading