nsINetUtil
| IID: | 57322c6f-f4ec-4e46-8253-b74be220de16 |
| Inherits From: | nsISupports |
nsINetUtil provides various network-related utility methods.
This interface is implemented by the following components:
Constants
Methods
ACString escapeString ( ACString string , PRUint32 escapeType )
ACString escapeURL ( ACString str , PRUint32 flags )
PRBool extractCharsetFromContentType ( AUTF8String typeHeader , out AUTF8String charset , out PRInt32 charsetStart , out PRInt32 charsetEnd )
AUTF8String parseContentType ( AUTF8String typeHeader , out AUTF8String charset , out PRBool hadCharset )
PRBool protocolHasFlags ( nsIURI URI , PRUint32 flag )
nsIURI toImmutableURI ( nsIURI URI )
ACString unescapeString ( ACString str , PRUint32 flags )
PRBool URIChainHasFlags ( nsIURI URI , PRUint32 flags )
ACString escapeString ( ACString string , PRUint32 escapeType )
Escape a string with %00-style escaping
- Arguments:
- string
- escapeType
ACString escapeURL ( ACString str , PRUint32 flags )
%XX-Escape invalid chars in a URL segment.
- Arguments:
- str: the URL to be escaped
- flags: the URL segment type flags
- Returns:
- the escaped string (the string itself if escaping did not happen)
PRBool extractCharsetFromContentType ( AUTF8String typeHeader , out AUTF8String charset , out PRInt32 charsetStart , out PRInt32 charsetEnd )
Extract the charset parameter location and value from a content-type header.
- Arguments:
- typeHeader: the header string to parse
- charset
- charsetStart
- charsetEnd
- Returns:
- whether a charset parameter was found. This can be false even in cases when parseContentType would claim to have a charset, if the type that won out does not have a charset parameter specified, because in this case setting the charset does in fact correspond to appending to the string.
AUTF8String parseContentType ( AUTF8String typeHeader , out AUTF8String charset , out PRBool hadCharset )
Parse a content-type header and return the content type and charset (if any).
- Arguments:
- typeHeader: the header string to parse
- charset
- hadCharset
- Returns:
- the MIME type specified in the header, in lower-case.
PRBool protocolHasFlags ( nsIURI URI , PRUint32 flag )
Test whether the given URI's handler has the given protocol flags.
- Arguments:
- URI: the URI in question
- flag
- Returns:
- whether the protocol handler for aURI has all the flags in aFlags.
nsIURI toImmutableURI ( nsIURI URI )
Take uRI and produce an immutable version of it for the caller. If uRI is immutable this will be uRI itself; otherwise this will be a clone, marked immutable if possible. Passing null to this method is allowed; in that case it will return null.
- Arguments:
- URI
ACString unescapeString ( ACString str , PRUint32 flags )
Expands URL escape sequences
- Arguments:
- str: the URL to be unescaped
- flags: only ESCAPE_URL_ONLY_NONASCII and ESCAPE_URL_SKIP_CONTROL are recognized. If |flags| is 0 all escape sequences are unescaped
- Returns:
- unescaped string
PRBool URIChainHasFlags ( nsIURI URI , PRUint32 flags )
Test whether the protocol handler for this URI or that for any of its inner URIs has the given protocol flags. This will QI uRI to nsINestedURI and walk the nested URI chain.
- Arguments:
- URI: the URI in question
- flags: the flags we're testing for.
- Returns:
- whether any of the protocol handlers involved have all the flags in aFlags.
Reference documentation is generated from Mozilla's source.
