nsIStandardURL

IID:8793370a-311f-11d4-9876-00c04fa0cf4a
Inherits From:nsISupports
Status:UNDER_REVIEW

nsIStandardURL defines the interface to an URL with the standard file path format common to protocols like http, ftp, and file. It supports initialization from a relative path and provides some customization on how URLs are normalized.

This interface is implemented by the following components:


Constants

Blah:foo/bar => blah://foo/bar blah:/foo/bar => blah:///foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah:///foo/bar
PRUint32 URLTYPE_STANDARD = 1
Blah:foo/bar => blah://foo/bar blah:/foo/bar => blah://foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah://foo/bar
PRUint32 URLTYPE_AUTHORITY = 2
Blah:foo/bar => blah:///foo/bar blah:/foo/bar => blah:///foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah:///foo/bar
PRUint32 URLTYPE_NO_AUTHORITY = 3

Properties

PRBool mutable

Control whether or not this URL can be modified. Protocol handlers can set this flag before handing out an URL to ensure that it is not inadvertently modified.


Methods

void init ( PRUint32 urlType , PRInt32 defaultPort , AUTF8String spec , char* originCharset , nsIURI baseURI )

void init ( PRUint32 urlType , PRInt32 defaultPort , AUTF8String spec , char* originCharset , nsIURI baseURI )

Initialize a standard URL.

Arguments:
urlType: - one of the URLTYPE_ flags listed above.
defaultPort: - if the port parsed from the URL string matches this port, then the port will be removed from the canonical form of the URL.
spec: - URL string.
originCharset: - the charset from which this URI string originated. this corresponds to the charset that should be used when communicating this URI to an origin server, for example. if null, then provide baseURI implements this interface, the origin charset of baseURI will be assumed, otherwise defaulting to UTF-8 (i.e., no charset transformation from spec).
baseURI: - if null, spec must specify an absolute URI. otherwise, spec will be resolved relative to baseURI.

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com