@mozilla.org/network/standard-url;1
This component implements the following interfaces:
Constants
Properties
readonly ACString nsIURI.asciiHost
The URI host with an ASCII compatible encoding. Follows the IDNA draft spec for converting internationalized domain names (UTF-8) to ASCII for compatibility with existing internet infrasture.
readonly ACString nsIURI.asciiSpec
The URI spec with an ASCII compatible encoding. Host portion follows the IDNA draft spec. Other parts are URL-escaped per the rules of RFC2396. The result is strictly ASCII.
AUTF8String nsIURL.directory
Returns the directory portion of a URL. If the URL denotes a path to a directory and not a file, e.g. http://host/foo/bar/, then the Directory attribute accesses the complete /foo/bar/ portion, and the FileName is the empty string. If the trailing slash is omitted, then the Directory is /foo/ and the file is bar (i.e. this is a syntactic, not a semantic breakdown of the Path). And hence don't rely on this for something to be a definitely be a file. But you can get just the leading directory portion for sure.
Some characters may be escaped.
AUTF8String nsIURL.fileBaseName
Returns the file basename portion of a filename in a url.
Some characters may be escaped.
AUTF8String nsIURL.fileExtension
Returns the file extension portion of a filename in a url. If a file extension does not exist, the empty string is returned.
Some characters may be escaped.
AUTF8String nsIURL.fileName
Returns the file name portion of a URL. If the URL denotes a path to a directory and not a file, e.g. http://host/foo/bar/, then the Directory attribute accesses the complete /foo/bar/ portion, and the FileName is the empty string. Note that this is purely based on searching for the last trailing slash. And hence don't rely on this to be a definite file.
Some characters may be escaped.
AUTF8String nsIURL.filePath
Returns a path including the directory and file portions of a URL. For example, the filePath of "http://host/foo/bar.html#baz" is "/foo/bar.html".
Some characters may be escaped.
AUTF8String nsIURI.host
The host is the internet domain name to which this URI refers. It could be an IPv4 (or IPv6) address literal. If supported, it could be a non-ASCII internationalized domain name.
Characters are NOT escaped.
AUTF8String nsIURI.hostPort
The host:port (or simply the host, if port == -1).
Characters are NOT escaped.
PRBool nsIMutable.mutable
Control whether or not this object can be modified. If the flag is false, no modification is allowed. Once the flag has been set to false, it cannot be reset back to true -- attempts to do so throw NS_ERROR_INVALID_ARG.
readonly ACString nsIURI.originCharset
The charset of the document from which this URI originated. An empty value implies UTF-8.
If this value is something other than UTF-8 then the URI components (e.g., spec, prePath, username, etc.) will all be fully URL-escaped. Otherwise, the URI components may contain unescaped multibyte UTF-8 characters.
AUTF8String nsIURL.param
Returns the parameters specified after the ; in the URL.
Some characters may be escaped.
AUTF8String nsIURI.password
AUTF8String nsIURI.path
The path, typically including at least a leading '/' (but may also be empty, depending on the protocol).
Some characters may be escaped.
PRInt32 nsIURI.port
A port value of -1 corresponds to the protocol's default port (eg. -1 implies port 80 for http URIs).
readonly AUTF8String nsIURI.prePath
The prePath (eg. scheme://user:password@host:port) returns the string before the path. This is useful for authentication or managing sessions.
Some characters may be escaped.
AUTF8String nsIURL.query
Returns the query portion (the part after the "?") of the URL. If there isn't one, an empty string is returned.
Some characters may be escaped.
AUTF8String nsIURL.ref
Returns the reference portion (the part after the "#") of the URL. If there isn't one, an empty string is returned.
Some characters may be escaped.
ACString nsIURI.scheme
The Scheme is the protocol to which this URI refers. The scheme is restricted to the US-ASCII charset per RFC2396.
AUTF8String nsIURI.spec
Returns a string representation of the URI. Setting the spec causes the new spec to be parsed, initializing the URI.
Some characters may be escaped.
AUTF8String nsIURI.username
The optional username and password, assuming the preHost consists of username:password.
Some characters may be escaped.
AUTF8String nsIURI.userPass
The username:password (or username only if value doesn't contain a ':')
Some characters may be escaped.
Methods
| Interface | Method |
|---|---|
| nsIURI |
nsIURI clone ( )
|
| nsIURI |
PRBool equals ( nsIURI other )
|
| nsIURL |
AUTF8String getCommonBaseSpec ( nsIURI URIToCompare )
|
| nsIURL |
AUTF8String getRelativeSpec ( nsIURI URIToCompare )
|
| nsIStandardURL |
void init ( PRUint32 urlType , PRInt32 defaultPort , AUTF8String spec , char* originCharset , nsIURI baseURI )
|
| nsISerializable |
void read ( nsIObjectInputStream inputStream )
|
| nsIURI |
AUTF8String resolve ( AUTF8String relativePath )
|
| nsIURI |
PRBool schemeIs ( char* scheme )
|
| nsISerializable |
void write ( nsIObjectOutputStream outputStream )
|
Reference documentation is generated from Mozilla's source.
