aboutsummaryrefslogtreecommitdiff
path: root/libbutl/process.mxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-17 09:13:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-17 09:13:30 +0200
commitb1cd193f1bd28837a00cbe6629f9a562f99d961f (patch)
tree4b8a8e1ed3923a7b81c85038d99d002a2b246cd3 /libbutl/process.mxx
parentc90760488f8a11886d2bb2baee4cc2714ac2fc83 (diff)
Add to_string(process_exit) in addition to operator<<(ostream,process_exit)
Diffstat (limited to 'libbutl/process.mxx')
-rw-r--r--libbutl/process.mxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/libbutl/process.mxx b/libbutl/process.mxx
index 27c13fa..199273b 100644
--- a/libbutl/process.mxx
+++ b/libbutl/process.mxx
@@ -15,7 +15,7 @@
#ifndef __cpp_lib_modules
#include <string>
#include <vector>
-#include <iosfwd>
+#include <ostream>
#include <cstddef> // size_t
#include <cstdint> // uint32_t
#include <system_error>
@@ -200,7 +200,7 @@ LIBBUTL_MODEXPORT namespace butl
description () const;
};
- // Print canonical exit status diagnostics:
+ // Canonical exit status description:
//
// "terminated abnormally: <...> (core dumped)"
// "exited with code <...>"
@@ -209,8 +209,14 @@ LIBBUTL_MODEXPORT namespace butl
//
// cerr << "process " << args[0] << " " << *pr.exit << endl;
//
- LIBBUTL_SYMEXPORT std::ostream&
- operator<< (std::ostream&, process_exit);
+ LIBBUTL_SYMEXPORT std::string
+ to_string (process_exit);
+
+ inline std::ostream&
+ operator<< (std::ostream& os, process_exit pe)
+ {
+ return os << to_string (pe);
+ }
class LIBBUTL_SYMEXPORT process
{