aboutsummaryrefslogtreecommitdiff
path: root/libbutl/default-options.mxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-08-13 21:32:05 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-08-14 15:15:03 +0300
commit7eff6adfe294038c723c8059a5993a533551f6cc (patch)
treede9b93470224a163b715747ce61bbdc344a73b5e /libbutl/default-options.mxx
parent1e2e28d3e442ba3c95a5c2b9e5d920c72f6cee43 (diff)
Add load_default_options() function template overload that accepts tracing function
Diffstat (limited to 'libbutl/default-options.mxx')
-rw-r--r--libbutl/default-options.mxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/libbutl/default-options.mxx b/libbutl/default-options.mxx
index 01d32c1..d7aa70b 100644
--- a/libbutl/default-options.mxx
+++ b/libbutl/default-options.mxx
@@ -7,7 +7,7 @@
#endif
#ifndef __cpp_lib_modules_ts
-#include <utility> // move()
+#include <utility> // move(), forward()
#endif
// Other includes.
@@ -58,6 +58,11 @@ LIBBUTL_MODEXPORT namespace butl
// Search for and load (using scanner S and parsing in the U::fail mode for
// both options and arguments) the specified list of options files in the
// specified directories returning a vector of option class instances (O).
+ // Pass each default options file path to the specified function prior to
+ // load (can be used for tracing, etc). The function signature is:
+ //
+ // void (const path&, bool remote)
+ //
// Throw std::system_error on the underlying OS error and pass through
// exceptions thrown by the options scanner/parser.
//
@@ -80,11 +85,12 @@ LIBBUTL_MODEXPORT namespace butl
// sufficient ground to definititevly conclude that the file is not remote;
// to be sure we would need to query the VCS or some such).
//
- template <typename O, typename S, typename U>
+ template <typename O, typename S, typename U, typename F>
default_options<O>
load_default_options (const optional<dir_path>& sys_dir,
const optional<dir_path>& home_dir,
- const default_options_files&);
+ const default_options_files&,
+ F&&);
// Merge the default options and the command line options.
//
@@ -112,4 +118,5 @@ LIBBUTL_MODEXPORT namespace butl
merge_default_options (const default_options<O>&, const O&, F&&);
}
+#include <libbutl/default-options.ixx>
#include <libbutl/default-options.txx>