Struct xpcom::interfaces::nsISAXXMLReader
[−]
[src]
#[repr(C)]pub struct nsISAXXMLReader { /* fields omitted */ }
interface nsISAXXMLReader : nsIStreamListener
/**
* Interface for reading an XML document using callbacks.
*
* NOTE: This file (and related ones) used to implement a full-featured SAX XML
* parser. But we have few uses of this interface and the ones we have only use
* a fraction of the full SAX functionality. So in bug 1416038 we removed a lot
* of it. See the changes associated with that bug if you need to reintroduce
* any of that functionality.
*
* nsISAXXMLReader is the interface that an XML parser's SAX2
* driver must implement. This interface allows an application to set
* and query features and properties in the parser, to register event
* handlers for document processing, and to initiate a document
* parse.
*/
Methods
impl nsISAXXMLReader
[src]
pub fn coerce<T: nsISAXXMLReaderCoerce>(&self) -> &T
[src]
Cast this nsISAXXMLReader
to one of its base interfaces.
impl nsISAXXMLReader
[src]
pub unsafe fn GetBaseURI(&self, aBaseURI: *mut *const nsIURI) -> nsresult
[src]
/**
* The base URI.
*/
attribute nsIURI baseURI;
pub unsafe fn SetBaseURI(&self, aBaseURI: *const nsIURI) -> nsresult
[src]
/**
* The base URI.
*/
attribute nsIURI baseURI;
pub unsafe fn GetContentHandler(
&self,
aContentHandler: *mut *const nsISAXContentHandler
) -> nsresult
[src]
&self,
aContentHandler: *mut *const nsISAXContentHandler
) -> nsresult
/**
* If the application does not register a content handler, all
* content events reported by the SAX parser will be silently
* ignored.
*
* Applications may register a new or different handler in the
* middle of a parse, and the SAX parser must begin using the new
* handler immediately.
*/
attribute nsISAXContentHandler contentHandler;
pub unsafe fn SetContentHandler(
&self,
aContentHandler: *const nsISAXContentHandler
) -> nsresult
[src]
&self,
aContentHandler: *const nsISAXContentHandler
) -> nsresult
/**
* If the application does not register a content handler, all
* content events reported by the SAX parser will be silently
* ignored.
*
* Applications may register a new or different handler in the
* middle of a parse, and the SAX parser must begin using the new
* handler immediately.
*/
attribute nsISAXContentHandler contentHandler;
pub unsafe fn GetErrorHandler(
&self,
aErrorHandler: *mut *const nsISAXErrorHandler
) -> nsresult
[src]
&self,
aErrorHandler: *mut *const nsISAXErrorHandler
) -> nsresult
/**
* If the application does not register an error handler, all
* error events reported by the SAX parser will be silently ignored;
* however, normal processing may not continue. It is highly
* recommended that all SAX applications implement an error handler
* to avoid unexpected bugs.
*
* Applications may register a new or different handler in the
* middle of a parse, and the SAX parser must begin using the new
* handler immediately.
*/
attribute nsISAXErrorHandler errorHandler;
pub unsafe fn SetErrorHandler(
&self,
aErrorHandler: *const nsISAXErrorHandler
) -> nsresult
[src]
&self,
aErrorHandler: *const nsISAXErrorHandler
) -> nsresult
/**
* If the application does not register an error handler, all
* error events reported by the SAX parser will be silently ignored;
* however, normal processing may not continue. It is highly
* recommended that all SAX applications implement an error handler
* to avoid unexpected bugs.
*
* Applications may register a new or different handler in the
* middle of a parse, and the SAX parser must begin using the new
* handler immediately.
*/
attribute nsISAXErrorHandler errorHandler;
pub unsafe fn ParseFromString(
&self,
str: &nsAString,
contentType: *const c_char
) -> nsresult
[src]
&self,
str: &nsAString,
contentType: *const c_char
) -> nsresult
/**
* @param str The UTF16 string to be parsed
* @param contentType The content type of the string (see parseFromStream)
*/
void parseFromString (in AString str, in string contentType);
pub unsafe fn ParseFromStream(
&self,
stream: *const nsIInputStream,
charset: *const c_char,
contentType: *const c_char
) -> nsresult
[src]
&self,
stream: *const nsIInputStream,
charset: *const c_char,
contentType: *const c_char
) -> nsresult
/**
* @param stream The byte stream whose contents are parsed
* @param charset The character set that was used to encode the byte
* stream. NULL if not specified.
* @param contentType The content type of the string - either text/xml,
* application/xml, or application/xhtml+xml.
* Must not be NULL.
*/
void parseFromStream (in nsIInputStream stream, in string charset, in string contentType);
pub unsafe fn ParseAsync(&self, observer: *const nsIRequestObserver) -> nsresult
[src]
/**
* Begin an asynchronous parse. This method initializes the parser,
* and must be called before any nsIStreamListener methods. It is
* then the caller's duty to call nsIStreamListener methods to drive
* the parser. Once this method is called, the caller must not call
* one of the other parse methods.
*
* @param observer The nsIRequestObserver to notify upon start or stop.
* Can be NULL.
*/
void parseAsync (in nsIRequestObserver observer);
Methods from Deref<Target = nsIStreamListener>
pub fn coerce<T: nsIStreamListenerCoerce>(&self) -> &T
[src]
Cast this nsIStreamListener
to one of its base interfaces.
pub unsafe fn OnDataAvailable(
&self,
aRequest: *const nsIRequest,
aContext: *const nsISupports,
aInputStream: *const nsIInputStream,
aOffset: uint64_t,
aCount: uint32_t
) -> nsresult
[src]
&self,
aRequest: *const nsIRequest,
aContext: *const nsISupports,
aInputStream: *const nsIInputStream,
aOffset: uint64_t,
aCount: uint32_t
) -> nsresult
/**
* Called when the next chunk of data (corresponding to the request) may
* be read without blocking the calling thread. The onDataAvailable impl
* must read exactly |aCount| bytes of data before returning.
*
* @param aRequest request corresponding to the source of the data
* @param aContext user defined context
* @param aInputStream input stream containing the data chunk
* @param aOffset
* Number of bytes that were sent in previous onDataAvailable calls
* for this request. In other words, the sum of all previous count
* parameters.
* @param aCount number of bytes available in the stream
*
* NOTE: The aInputStream parameter must implement readSegments.
*
* An exception thrown from onDataAvailable has the side-effect of
* causing the request to be canceled.
*/
void onDataAvailable (in nsIRequest aRequest, in nsISupports aContext, in nsIInputStream aInputStream, in unsigned long long aOffset, in unsigned long aCount);
Trait Implementations
impl XpCom for nsISAXXMLReader
[src]
const IID: nsIID
IID: nsIID = nsID(1528686594, 37009, 17743, [153, 114, 87, 83, 192, 208, 199, 14])
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 nsISAXXMLReader
[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 nsISAXXMLReader
[src]
type Target = nsIStreamListener
The resulting type after dereferencing.
fn deref(&self) -> &nsIStreamListener
[src]
Dereferences the value.