diff options
Diffstat (limited to 'bbot/utility')
-rw-r--r-- | bbot/utility | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/bbot/utility b/bbot/utility index 81c6c87..ebab971 100644 --- a/bbot/utility +++ b/bbot/utility @@ -13,8 +13,8 @@ #include <butl/ft/lang> +#include <butl/process> #include <butl/utility> // casecmp(), reverse_iterate(), etc - #include <butl/filesystem> #include <bbot/types> @@ -39,6 +39,51 @@ namespace bbot using butl::exception_guard; using butl::make_exception_guard; + + // Process execution. + // + class tracer; + + template <typename I, typename O, typename E, typename P, typename... A> + void + run (tracer&, I&& in, O&& out, E&& err, P&&, A&&...); + + template <typename I, typename O, typename E, typename P, typename... A> + butl::process_exit::code_type + run_exit (tracer&, I&& in, O&& out, E&& err, P&&, A&&...); + + template <typename P, typename... A> + inline void + run (tracer& t, P&& p, A&&... a) + { + run (t, butl::fdnull (), 2, 2, forward<P> (p), forward<A> (a)...); + } + + template <typename P, typename... A> + inline butl::process_exit::code_type + run_exit (tracer& t, P&& p, A&&... a) + { + return run (t, butl::fdnull (), 2, 2, forward<P> (p), forward<A> (a)...); + } + + // Manifest parsing and serialization. + // + template <typename T> + T + parse_manifest (const path&, const char* what, bool ignore_unknown = true); + + template <typename T> + void + serialize_manifest (const T&, const path&, const char* what); + + template <typename T> + void + serialize_manifest (const T&, + ostream&, + const string& name, + const char* what); } +#include <bbot/utility.txx> + #endif // BBOT_UTILITY |