From 76280cfc114e489f4b596dc2b0e2a560b7f13a55 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 12 Dec 2018 15:17:54 -0500 Subject: Remove the valist from the ISlangWriter interface. Replace with begin/endAppendBuffer. (#751) --- slang.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'slang.h') diff --git a/slang.h b/slang.h index 5ea1d13f8..23bc830e7 100644 --- a/slang.h +++ b/slang.h @@ -352,8 +352,6 @@ convention for interface methods. #include #endif // ! SLANG_NO_STDDEF -#include - #ifdef __cplusplus extern "C" { @@ -851,17 +849,23 @@ extern "C" struct ISlangWriter : public ISlangUnknown { public: - /** Write the formatted string with the used args. If returns SLANG_E_NOT_IMPLEMENTED, will use a default internal implementation, and call write with result - @param format Format string - @param args The arguments - @return SLANG_E_NOT_IMPLEMENTED if not implemented, SLANG_OK on success */ - virtual SLANG_NO_THROW SlangResult SLANG_MCALL writeVaList(const char* format, va_list args) = 0; + /** Begin an append buffer. + NOTE! Only one append buffer can be active at any time. + @param maxNumChars The maximum of chars that will be appended + @returns The start of the buffer for appending to. */ + virtual SLANG_NO_THROW char* SLANG_MCALL beginAppendBuffer(size_t maxNumChars) = 0; + /** Ends the append buffer, and is equivalent to a write of the append buffer. + NOTE! That an endAppendBuffer is not necessary if there are no characters to write. + @param buffer is the start of the data to append and must be identical to last value returned from beginAppendBuffer + @param numChars must be a value less than or equal to what was returned from last call to beginAppendBuffer + @returns Result, will be SLANG_OK on success */ + virtual SLANG_NO_THROW SlangResult SLANG_MCALL endAppendBuffer(char* buffer, size_t numChars) = 0; /** Write text to the writer @param chars The characters to write out @param numChars The amount of characters @returns SLANG_OK on success */ virtual SLANG_NO_THROW SlangResult SLANG_MCALL write(const char* chars, size_t numChars) = 0; - /** Flushes any content to the ouput */ + /** Flushes any content to the output */ virtual SLANG_NO_THROW void SLANG_MCALL flush() = 0; /** Determines if the writer stream is to the console, and can be used to alter the output @returns Returns true if is a console writer */ -- cgit v1.2.3