// file : libbuild2/script/timeout.hxx -*- C++ -*- // license : MIT; see accompanying LICENSE file #ifndef LIBBUILD2_SCRIPT_TIMEOUT_HXX #define LIBBUILD2_SCRIPT_TIMEOUT_HXX #include #include namespace build2 { // Parse the specified in seconds timeout returning it if the value is not // zero and nullopt otherwise. Issue diagnostics with an optional prefix and // fail if the argument is not a valid timeout. // optional parse_timeout (const string&, const char* what, const char* prefix = "", const location& = location ()); // As above, but return the timepoint which is away from now by the // specified timeout. // optional parse_deadline (const string&, const char* what, const char* prefix = "", const location& = location ()); // Return the earlier timeout/deadline of two values, if any is present. // // Note that earlier(nullopt, v) and earlier(v, nullopt) return v. // template T earlier (const T&, const T&); template T earlier (const optional&, const T&); template T earlier (const T&, const optional&); template optional earlier (const optional&, const optional&); } #include #endif // LIBBUILD2_SCRIPT_TIMEOUT_HXX