From ce12e1d64d6b0b62609f061d3773a7e8b35849c3 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 30 Nov 2021 16:50:05 -0500 Subject: Auto flush for streams for stdin/out in slang-test (#2035) * #include an absolute path didn't work - because paths were taken to always be relative. * Move StreamType from Process to StdStreamType in slang-stream.h * Disable buffering for stdout/stderr for slang-test. * Improve comment. --- source/core/slang-stream.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/core/slang-stream.h') diff --git a/source/core/slang-stream.h b/source/core/slang-stream.h index a163a0c5d..388b178c9 100644 --- a/source/core/slang-stream.h +++ b/source/core/slang-stream.h @@ -6,6 +6,14 @@ namespace Slang { +enum class StdStreamType +{ + ErrorOut, + Out, + In, + CountOf, +}; + enum class SeekOrigin { Start, ///< Seek from the start of the stream @@ -236,6 +244,13 @@ protected: RefPtr m_stream; ///< Stream that is being read from }; +enum class StreamBufferStyle +{ + None, + Line, + Full, +}; + struct StreamUtil { /// Appends all bytes that can be read from stream into bytes @@ -251,6 +266,8 @@ struct StreamUtil static SlangResult readOrDiscard(Stream* stream, size_t readSize, List* ioBytes); static SlangResult readOrDiscardAll(Stream* stream, size_t readSize, List* ioBytes); + + static SlangResult setStreamBufferStyle(StdStreamType stdStream, StreamBufferStyle style); }; -- cgit v1.2.3