aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/file.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-02-16 06:22:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-02-16 06:22:13 +0200
commitd9b34adbc5ae1e9e23cf3641c72fd302e8c7790c (patch)
treeba3625a8fa2de237ec47671479e24fc786b3e2c1 /libbuild2/file.hxx
parentbc2efe549c842d08f8253083e97f38f154907750 (diff)
Add pre/post hooks to load_root()
Diffstat (limited to 'libbuild2/file.hxx')
-rw-r--r--libbuild2/file.hxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/libbuild2/file.hxx b/libbuild2/file.hxx
index 5a25475..43cd1ff 100644
--- a/libbuild2/file.hxx
+++ b/libbuild2/file.hxx
@@ -17,6 +17,7 @@
namespace build2
{
class lexer;
+ class parser;
LIBBUILD2_SYMEXPORT extern const dir_path std_build_dir; // build/
@@ -231,8 +232,13 @@ namespace build2
// loaded. Also make sure all outer root scopes are loaded prior to loading
// this root scope.
//
+ // If pre/post functions are specified, they are called before/after
+ // pre/post hooks, respectively.
+ //
LIBBUILD2_SYMEXPORT void
- load_root (scope& root);
+ load_root (scope& root,
+ const function<void (parser&)>& pre = nullptr,
+ const function<void (parser&)>& post = nullptr);
// Extract the specified variable value from a buildfile. It is expected to
// be the first non-blank/comment line and not to rely on any variable