WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

@mozilla.org/network/util;1

This component implements the following interfaces:

Constants

PRUint32 nsINetUtil.ESCAPE_ALL = 0
PRUint32 nsINetUtil.ESCAPE_XALPHAS = 1
Leave alphanumeric characters intact, convert spaces to '+',
PRUint32 nsINetUtil.ESCAPE_XPALPHAS = 2
Leave alphanumeric characters and forward slashes intact,
PRUint32 nsINetUtil.ESCAPE_URL_PATH = 4
PRUint32 nsINetUtil.ESCAPE_URL_SCHEME = 1
PRUint32 nsINetUtil.ESCAPE_URL_USERNAME = 2
PRUint32 nsINetUtil.ESCAPE_URL_PASSWORD = 4
PRUint32 nsINetUtil.ESCAPE_URL_HOST = 8
PRUint32 nsINetUtil.ESCAPE_URL_DIRECTORY = 16
PRUint32 nsINetUtil.ESCAPE_URL_FILE_BASENAME = 32
PRUint32 nsINetUtil.ESCAPE_URL_FILE_EXTENSION = 64
PRUint32 nsINetUtil.ESCAPE_URL_PARAM = 128
PRUint32 nsINetUtil.ESCAPE_URL_QUERY = 256
PRUint32 nsINetUtil.ESCAPE_URL_REF = 512
PRUint32 nsINetUtil.ESCAPE_URL_FILEPATH = 112
PRUint32 nsINetUtil.ESCAPE_URL_MINIMAL = 1023
PRUint32 nsINetUtil.ESCAPE_URL_FORCED = 1024
PRUint32 nsINetUtil.ESCAPE_URL_ONLY_ASCII = 2048
Skip graphic octets (0x20-0x7E) when escaping Skips all ASCII octets (0x00-0x7F) when unescaping
PRUint32 nsINetUtil.ESCAPE_URL_ONLY_NONASCII = 4096
PRUint32 nsINetUtil.ESCAPE_URL_COLON = 16384
PRUint32 nsINetUtil.ESCAPE_URL_SKIP_CONTROL = 32768

Properties

PRBool nsIIOService.offline

Returns true if networking is in "offline" mode. When in offline mode, attempts to access the network will fail (although this does not necessarily correlate with whether there is actually a network available -- that's hard to detect without causing the dialer to come up).

Changing this fires observer notifications ... see below.

Methods

InterfaceMethod
nsIIOService PRBool allowPort ( PRInt32 port , char* scheme )
nsINetUtil ACString escapeString ( ACString string , PRUint32 escapeType )
nsINetUtil ACString escapeURL ( ACString str , PRUint32 flags )
nsINetUtil PRBool extractCharsetFromContentType ( AUTF8String typeHeader , out AUTF8String charset , out PRInt32 charsetStart , out PRInt32 charsetEnd )
nsIIOService ACString extractScheme ( AUTF8String urlString )
nsIIOService PRUint32 getProtocolFlags ( char* scheme )
nsIIOService nsIProtocolHandler getProtocolHandler ( char* scheme )
nsISupportsWeakReference nsIWeakReference GetWeakReference ( )
nsIIOService nsIChannel newChannel ( AUTF8String spec , char* originCharset , nsIURI baseURI )
nsIIOService nsIChannel newChannelFromURI ( nsIURI URI )
nsIIOService nsIURI newFileURI ( nsIFile file )
nsIIOService nsIURI newURI ( AUTF8String spec , char* originCharset , nsIURI baseURI )
nsIObserver void observe ( nsISupports subject , char* topic , PRUnichar* data )
nsINetUtil AUTF8String parseContentType ( AUTF8String typeHeader , out AUTF8String charset , out PRBool hadCharset )
nsINetUtil PRBool protocolHasFlags ( nsIURI URI , PRUint32 flag )
nsINetUtil nsIURI toImmutableURI ( nsIURI URI )
nsINetUtil ACString unescapeString ( ACString str , PRUint32 flags )
nsINetUtil PRBool URIChainHasFlags ( nsIURI URI , PRUint32 flags )

Reference documentation is generated from Mozilla's source.

Copyright © 1999-2006 XULPlanet.com