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