aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/utility.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/utility.hxx')
-rw-r--r--libbuild2/utility.hxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/libbuild2/utility.hxx b/libbuild2/utility.hxx
index 43b556e..415dc8b 100644
--- a/libbuild2/utility.hxx
+++ b/libbuild2/utility.hxx
@@ -88,6 +88,19 @@ namespace build2
using butl::eof;
+ // Open a file or, if the file name is `-`, stdin/stdout.
+ //
+ // Note that ofdstream::close() should be called explicitly if not stdout
+ // (but harmless to call even if it is). Also note that our overload of
+ // operator<<(path) always translats `-` to `<stdin>` so care must be taken
+ // when issuing diagnostics.
+ //
+ istream&
+ open_file_or_stdin (const path&, ifdstream&);
+
+ ostream&
+ open_file_or_stdout (const path&, ofdstream&);
+
// Diagnostics state (verbosity level, etc; see <libbuild2/diagnostics.hxx>).
//
// Note on naming of values (here and in the global state below) that come