Bug 1867190 - Add prefs for PHC probablities r=glandium
[gecko.git] / xpcom / io / nsIConverterInputStream.idl
blobad1f9bfbc41fe08fd86504ab090843f74a7ced43
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsIUnicharInputStream.idl"
8 interface nsIInputStream;
10 /**
11 * A unichar input stream that wraps an input stream.
12 * This allows reading unicode strings from a stream, automatically converting
13 * the bytes from a selected character encoding.
15 [scriptable, uuid(FC66FFB6-5404-4908-A4A3-27F92FA0579D)]
16 interface nsIConverterInputStream : nsIUnicharInputStream {
17 /**
18 * Default replacement char value, U+FFFD REPLACEMENT CHARACTER.
20 const char16_t DEFAULT_REPLACEMENT_CHARACTER = 0xFFFD;
22 /**
23 * Special replacement character value that requests errors to
24 * be treated as fatal.
26 const char16_t ERRORS_ARE_FATAL = 0;
28 /**
29 * Initialize this stream.
30 * @param aStream
31 * The underlying stream to read from.
32 * @param aCharset
33 * The character encoding to use for converting the bytes of the
34 * stream. A null charset will be interpreted as UTF-8.
35 * @param aBufferSize
36 * How many bytes to buffer.
37 * @param aReplacementChar
38 * The character to replace unknown byte sequences in the stream
39 * with. The standard replacement character is U+FFFD.
40 * A value of 0x0000 will cause an exception to be thrown if unknown
41 * byte sequences are encountered in the stream.
43 void init (in nsIInputStream aStream, in string aCharset,
44 in long aBufferSize, in char16_t aReplacementChar);