Struct xpcom::interfaces::nsIConverterInputStream
[−]
[src]
#[repr(C)]pub struct nsIConverterInputStream { /* fields omitted */ }
interface nsIConverterInputStream : nsIUnicharInputStream
/**
* 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.
*/
Methods
impl nsIConverterInputStream
[src]
pub fn coerce<T: nsIConverterInputStreamCoerce>(&self) -> &T
[src]
Cast this nsIConverterInputStream
to one of its base interfaces.
impl nsIConverterInputStream
[src]
pub const DEFAULT_REPLACEMENT_CHARACTER: i64
DEFAULT_REPLACEMENT_CHARACTER: i64 = 65533
/**
* Default replacement char value, U+FFFD REPLACEMENT CHARACTER.
*/
pub unsafe fn Init(
&self,
aStream: *const nsIInputStream,
aCharset: *const c_char,
aBufferSize: int32_t,
aReplacementChar: char16_t
) -> nsresult
[src]
&self,
aStream: *const nsIInputStream,
aCharset: *const c_char,
aBufferSize: int32_t,
aReplacementChar: char16_t
) -> nsresult
/**
* 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, in long aBufferSize, in char16_t aReplacementChar);
Methods from Deref<Target = nsIUnicharInputStream>
pub fn coerce<T: nsIUnicharInputStreamCoerce>(&self) -> &T
[src]
Cast this nsIUnicharInputStream
to one of its base interfaces.
pub unsafe fn Read(
&self,
aBuf: *mut char16_t,
aCount: uint32_t,
_retval: *mut uint32_t
) -> nsresult
[src]
&self,
aBuf: *mut char16_t,
aCount: uint32_t,
_retval: *mut uint32_t
) -> nsresult
/**
* Abstract unicode character input stream
* @see nsIInputStream
*/
/**
* Reads into a caller-provided character array.
*
* @return The number of characters that were successfully read. May be less
* than aCount, even if there is more data in the input stream.
* A return value of 0 means EOF.
*
* @note To read more than 2^32 characters, call this method multiple times.
*/
[noscript] unsigned long read ([array, size_is (aCount)] in char16_t aBuf, in unsigned long aCount);
pub unsafe fn ReadString(
&self,
aCount: uint32_t,
aString: &mut nsAString,
_retval: *mut uint32_t
) -> nsresult
[src]
&self,
aCount: uint32_t,
aString: &mut nsAString,
_retval: *mut uint32_t
) -> nsresult
/**
* Read into a string object.
* @param aCount The number of characters that should be read
* @return The number of characters that were read.
*/
unsigned long readString (in unsigned long aCount, out AString aString);
pub unsafe fn Close(&self) -> nsresult
[src]
/**
* Close the stream and free associated resources. This also closes the
* underlying stream, if any.
*/
void close ();
Trait Implementations
impl XpCom for nsIConverterInputStream
[src]
const IID: nsIID
IID: nsIID = nsID(4234608566, 21508, 18696, [164, 163, 39, 249, 47, 160, 87, 157])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsIConverterInputStream
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIConverterInputStream
[src]
type Target = nsIUnicharInputStream
The resulting type after dereferencing.
fn deref(&self) -> &nsIUnicharInputStream
[src]
Dereferences the value.