|
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/. */ |
|
5 |
|
6 #include "nsIUnicharInputStream.idl" |
|
7 |
|
8 interface nsIInputStream; |
|
9 |
|
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. |
|
14 */ |
|
15 [scriptable, uuid(FC66FFB6-5404-4908-A4A3-27F92FA0579D)] |
|
16 interface nsIConverterInputStream : nsIUnicharInputStream { |
|
17 /** |
|
18 * Default replacement char value, U+FFFD REPLACEMENT CHARACTER. |
|
19 */ |
|
20 const char16_t DEFAULT_REPLACEMENT_CHARACTER = 0xFFFD; |
|
21 |
|
22 /** |
|
23 * Initialize this stream. |
|
24 * @param aStream |
|
25 * The underlying stream to read from. |
|
26 * @param aCharset |
|
27 * The character encoding to use for converting the bytes of the |
|
28 * stream. A null charset will be interpreted as UTF-8. |
|
29 * @param aBufferSize |
|
30 * How many bytes to buffer. |
|
31 * @param aReplacementChar |
|
32 * The character to replace unknown byte sequences in the stream |
|
33 * with. The standard replacement character is U+FFFD. |
|
34 * A value of 0x0000 will cause an exception to be thrown if unknown |
|
35 * byte sequences are encountered in the stream. |
|
36 */ |
|
37 void init (in nsIInputStream aStream, in string aCharset, |
|
38 in long aBufferSize, in char16_t aReplacementChar); |
|
39 }; |
|
40 |