From 9c2d1766ea33101b551ac521ddc39516b98b6641 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 23 Oct 2019 09:28:58 -0400 Subject: Expose more repro in API, support output params. (#1087) * Added spEnableReproCapture to the API. * Added MemoryStreamBase - which can be used to read from without copyin the data. Added the missing Repro API functions - spEnableReproCapture and spExtractRepro. Added support for serializing output filenames. * Improved naming around Stream. Brought Stream and sub types closer to code conventions. * Renamed content -> contents in Stream. --- source/core/slang-text-io.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/core/slang-text-io.cpp') diff --git a/source/core/slang-text-io.cpp b/source/core/slang-text-io.cpp index 18039e41b..4e989b627 100644 --- a/source/core/slang-text-io.cpp +++ b/source/core/slang-text-io.cpp @@ -126,11 +126,11 @@ namespace Slang this->encoding = encoding; if (encoding == Encoding::UTF16) { - this->stream->Write(&Utf16Header, 2); + this->stream->write(&Utf16Header, 2); } else if (encoding == Encoding::UTF16Reversed) { - this->stream->Write(&Utf16ReversedHeader, 2); + this->stream->write(&Utf16ReversedHeader, 2); } } StreamWriter::StreamWriter(RefPtr stream, Encoding * encoding) @@ -139,11 +139,11 @@ namespace Slang this->encoding = encoding; if (encoding == Encoding::UTF16) { - this->stream->Write(&Utf16Header, 2); + this->stream->write(&Utf16Header, 2); } else if (encoding == Encoding::UTF16Reversed) { - this->stream->Write(&Utf16ReversedHeader, 2); + this->stream->write(&Utf16ReversedHeader, 2); } } void StreamWriter::Write(const String & str) @@ -169,7 +169,7 @@ namespace Slang sb << str[i]; } encoding->GetBytes(encodingBuffer, sb.ProduceString()); - stream->Write(encodingBuffer.getBuffer(), encodingBuffer.getCount()); + stream->write(encodingBuffer.getBuffer(), encodingBuffer.getCount()); } void StreamWriter::Write(const char * str) { @@ -237,7 +237,7 @@ namespace Slang { buffer.setCount(4096); memset(buffer.getBuffer(), 0, buffer.getCount() * sizeof(buffer[0])); - auto len = stream->Read(buffer.getBuffer(), buffer.getCount()); + auto len = stream->read(buffer.getBuffer(), buffer.getCount()); buffer.setCount((int)len); ptr = 0; } @@ -248,7 +248,7 @@ namespace Slang { return buffer[ptr++]; } - if (!stream->IsEnd()) + if (!stream->isEnd()) ReadBuffer(); if (ptr