michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIUnicharInputStream.idl" michael@0: michael@0: interface nsIInputStream; michael@0: michael@0: /** michael@0: * A unichar input stream that wraps an input stream. michael@0: * This allows reading unicode strings from a stream, automatically converting michael@0: * the bytes from a selected character encoding. michael@0: */ michael@0: [scriptable, uuid(FC66FFB6-5404-4908-A4A3-27F92FA0579D)] michael@0: interface nsIConverterInputStream : nsIUnicharInputStream { michael@0: /** michael@0: * Default replacement char value, U+FFFD REPLACEMENT CHARACTER. michael@0: */ michael@0: const char16_t DEFAULT_REPLACEMENT_CHARACTER = 0xFFFD; michael@0: michael@0: /** michael@0: * Initialize this stream. michael@0: * @param aStream michael@0: * The underlying stream to read from. michael@0: * @param aCharset michael@0: * The character encoding to use for converting the bytes of the michael@0: * stream. A null charset will be interpreted as UTF-8. michael@0: * @param aBufferSize michael@0: * How many bytes to buffer. michael@0: * @param aReplacementChar michael@0: * The character to replace unknown byte sequences in the stream michael@0: * with. The standard replacement character is U+FFFD. michael@0: * A value of 0x0000 will cause an exception to be thrown if unknown michael@0: * byte sequences are encountered in the stream. michael@0: */ michael@0: void init (in nsIInputStream aStream, in string aCharset, michael@0: in long aBufferSize, in char16_t aReplacementChar); michael@0: }; michael@0: