diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-10-07 08:17:49 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-10-08 15:05:21 +0200 |
commit | 8384a087afc7e29e900a3ce96d55ab2f5c2a74c2 (patch) | |
tree | deff3d99e33bfc7abecb3ef0422ccb2dd6c3d43b /libbuild2/config/utility.ixx | |
parent | 734bf117f0eb596fc40579810613a6e13c43d3c4 (diff) |
Expose custom save function in config module
It can generally be useful, for example, to complete relative paths before
saving them to config.build (if abs_dir_path does not fit).
Diffstat (limited to 'libbuild2/config/utility.ixx')
-rw-r--r-- | libbuild2/config/utility.ixx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libbuild2/config/utility.ixx b/libbuild2/config/utility.ixx index d8348bd..87f628c 100644 --- a/libbuild2/config/utility.ixx +++ b/libbuild2/config/utility.ixx @@ -6,25 +6,32 @@ namespace build2 namespace config { LIBBUILD2_SYMEXPORT pair<lookup, bool> - lookup_config_impl (scope&, const variable&, uint64_t); + lookup_config_impl (scope&, + const variable&, + uint64_t, + save_variable_function*); template <typename T> pair<lookup, bool> lookup_config_impl (scope&, const variable&, T&&, uint64_t, bool); inline lookup - lookup_config (scope& rs, const variable& var, uint64_t sflags) + lookup_config (scope& rs, + const variable& var, + uint64_t sflags, + save_variable_function* func) { - return lookup_config_impl (rs, var, sflags).first; + return lookup_config_impl (rs, var, sflags, func).first; } inline lookup lookup_config (bool& new_value, scope& rs, const variable& var, - uint64_t sflags) + uint64_t sflags, + save_variable_function* func) { - auto r (lookup_config_impl (rs, var, sflags)); + auto r (lookup_config_impl (rs, var, sflags, func)); new_value = new_value || r.second; return r.first; } |