diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-22 12:51:24 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-22 12:51:24 +0200 |
commit | 4d79758a845d3cd64f0153d60abb88d3ae4c2a68 (patch) | |
tree | e87278e7c839e84de26b32b17f0fe4dca883be85 /butl/process.ixx | |
parent | 91a5ccf011c569dabc6cc79997ddd5f4e04592b1 (diff) |
Extend process search with pre-search support, other minor improvements
Diffstat (limited to 'butl/process.ixx')
-rw-r--r-- | butl/process.ixx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/butl/process.ixx b/butl/process.ixx index 59ac60c..264f77c 100644 --- a/butl/process.ixx +++ b/butl/process.ixx @@ -7,6 +7,20 @@ namespace butl { inline process_path:: + ~process_path () + { + if (args0_ != nullptr) + *args0_ = initial; + } + + inline process_path:: + process_path (const char* i, path&& r, path&& e) + : initial (i), + recall (std::move (r)), + effect (std::move (e)), + args0_ (nullptr) {} + + inline process_path:: process_path (process_path&& p) : initial (p.initial), recall (std::move (p.recall)), @@ -35,6 +49,32 @@ namespace butl return *this; } + inline const char* process_path:: + recall_string () const + { + return recall.empty () ? initial : recall.string ().c_str (); + } + + inline const char* process_path:: + effect_string () const + { + return effect.empty () ? recall_string () : effect.string ().c_str (); + } + + inline process_path process:: + path_search (const char*& a0, const dir_path& fb) + { + process_path r (path_search (a0, true, fb)); + + if (!r.recall.empty ()) + { + r.args0_ = &a0; + a0 = r.recall.string ().c_str (); + } + + return r; + } + inline process:: process () : handle (0), |