From 7eff6adfe294038c723c8059a5993a533551f6cc Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 13 Aug 2019 21:32:05 +0300 Subject: Add load_default_options() function template overload that accepts tracing function --- libbutl/default-options.mxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'libbutl/default-options.mxx') 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 // move() +#include // 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 + template default_options load_default_options (const optional& sys_dir, const optional& 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&, const O&, F&&); } +#include #include -- cgit v1.1