summaryrefslogtreecommitdiff
path: root/source/slang-capture-replay/output-stream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang-capture-replay/output-stream.cpp')
-rw-r--r--source/slang-capture-replay/output-stream.cpp52
1 files changed, 0 insertions, 52 deletions
diff --git a/source/slang-capture-replay/output-stream.cpp b/source/slang-capture-replay/output-stream.cpp
deleted file mode 100644
index 97c4b098b..000000000
--- a/source/slang-capture-replay/output-stream.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-#include "output-stream.h"
-#include "capture_utility.h"
-
-namespace SlangCapture
-{
- FileOutputStream::FileOutputStream(const std::string& filename, bool append)
- {
- Slang::String path(filename.c_str());
- Slang::FileMode fileMode = append ? Slang::FileMode::Append : Slang::FileMode::Create;
- Slang::FileAccess fileAccess = Slang::FileAccess::Write;
- Slang::FileShare fileShare = Slang::FileShare::None;
-
- SlangResult res = m_fileStream.init(path, fileMode, fileAccess, fileShare);
-
- if (res != SLANG_OK)
- {
- SlangCapture::slangCaptureLog(SlangCapture::LogLevel::Error, "Failed to open file %s\n", filename.c_str());
- std::abort();
- }
- }
-
- FileOutputStream::~FileOutputStream()
- {
- m_fileStream.close();
- }
-
- void FileOutputStream::write(const void* data, size_t len)
- {
- SLANG_CAPTURE_CHECK(m_fileStream.write(data, len));
- }
-
- MemoryStream::MemoryStream()
- : m_memoryStream(Slang::FileAccess::Write)
- { }
-
- void FileOutputStream::flush()
- {
- SLANG_CAPTURE_CHECK(m_fileStream.flush());
- }
-
- void MemoryStream::write(const void* data, size_t len)
- {
- SLANG_CAPTURE_CHECK(m_memoryStream.write(data, len));
- }
-
- void MemoryStream::flush()
- {
- // This call will reset the underlying buffer to size 0,
- // and reset the write position to 0.
- m_memoryStream.setContent(nullptr, 0);
- }
-}