aboutsummaryrefslogtreecommitdiff
path: root/libbutl/process-io.mxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-09-22 23:32:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-09-22 23:32:28 +0200
commitc09cd7512491cee1e82c1ad8128ce9fd4bc3f79b (patch)
treea659ed768d849130ab5780a11b7f791a463a1a91 /libbutl/process-io.mxx
parent2a00871f07067f8f9e2de08bb9c8f50e1bf6a650 (diff)
Initial modularization with both Clang and VC hacks
Note: gave up on VC about half way though.
Diffstat (limited to 'libbutl/process-io.mxx')
-rw-r--r--libbutl/process-io.mxx44
1 files changed, 44 insertions, 0 deletions
diff --git a/libbutl/process-io.mxx b/libbutl/process-io.mxx
new file mode 100644
index 0000000..dfd2221
--- /dev/null
+++ b/libbutl/process-io.mxx
@@ -0,0 +1,44 @@
+// file : libbutl/process-io.mxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#ifndef __cpp_modules
+#pragma once
+#endif
+
+// C includes.
+
+#ifndef __cpp_lib_modules
+#include <ostream>
+#endif
+
+// Other includes.
+
+#ifdef __cpp_modules
+export module butl.process_io;
+#ifdef __cpp_lib_modules
+import std.core; //@@ MOD TMP (should not be needed).
+import std.io;
+#endif
+import butl.process;
+#else
+#include <libbutl/process.mxx>
+#endif
+
+#include <libbutl/export.hxx>
+
+LIBBUTL_MODEXPORT namespace butl
+{
+ inline std::ostream&
+ operator<< (std::ostream& o, const process_path& p)
+ {
+ return o << p.recall_string ();
+ }
+
+ inline std::ostream&
+ operator<< (std::ostream& o, const process_args& a)
+ {
+ process::print (o, a.argv, a.argc);
+ return o;
+ }
+}