From 97bb82ebcdf8f1391b9d93b5a8d7b1dfc4e88e52 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 4 Oct 2021 14:15:51 -0400 Subject: Removing exceptions from core/compiler-core (#1953) * #include an absolute path didn't work - because paths were taken to always be relative. * Refactor Stream. Working on all tests. * Split out CharEncode. * Make method names lower camel. m_prefix in Writer/Reader * Tidy up around CharEncode interface. * Small improvements around encode/decode. * Better use of types. * Remove readLine from TextReader. * Remove exceptions from Stream/Text handling. * Fix some typos. * Fix tabbing. * Fix missing override. * Remove remaining exception throw/catch via using signal mechanism. * Remove exceptions that are not used anymore. * Document the Stream interface. * Remove index for decoding 'get byte' function. * Fix CharReader -> ByteReader. --- source/slang/slang.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 0fc5f6122..6fe778435 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -269,11 +269,14 @@ SlangResult Session::compileStdLib(slang::CompileStdLibFlags compileFlags) { String fileName("stdlib-doc.md"); - StreamWriter writer(new FileStream(fileName, FileMode::Create)); + RefPtr stream = new FileStream; + SLANG_RETURN_ON_FAIL(stream->init(fileName, FileMode::Create)); + StreamWriter writer; + SLANG_RETURN_ON_FAIL(writer.init(stream)); for (auto& docString : docStrings) { - writer.Write(docString); + SLANG_RETURN_ON_FAIL(writer.write(docString)); } } } -- cgit v1.2.3