nsISupports
Last changed in Gecko 1.7 void parseAuthority(in string authority, in long authorityLen, out unsigned long usernamePos, out long usernameLen, out unsigned long passwordPos, out long passwordLen, out unsigned long hostnamePos, out long hostnameLen, out long port); |
void parseFileName(in string filename, in long filenameLen, out unsigned long basenamePos, out long basenameLen, out unsigned long extensionPos, out long extensionLen); |
void parseFilePath(in string filepath, in long filepathLen, out unsigned long directoryPos, out long directoryLen, out unsigned long basenamePos, out long basenameLen, out unsigned long extensionPos, out long extensionLen); |
void parsePath(in string path, in long pathLen, out unsigned long filepathPos, out long filepathLen, out unsigned long paramPos, out long paramLen, out unsigned long queryPos, out long queryLen, out unsigned long refPos, out long refLen); |
void parseServerInfo(in string serverinfo, in long serverinfoLen, out unsigned long hostnamePos, out long hostnameLen, out long port); |
void parseURL(in string spec, in long specLen, out unsigned long schemePos, out long schemeLen, out unsigned long authorityPos, out long authorityLen, out unsigned long pathPos, out long pathLen); |
void parseUserInfo(in string userinfo, in long userinfoLen, out unsigned long usernamePos, out long usernameLen, out unsigned long passwordPos, out long passwordLen); |
The string to parse in the methods may be given as a null
terminated string, in which case the length argument should be -1.
Out parameters of the methods are all optional (that is the caller may pass-in a null
value if the corresponding results are not needed). Signed out parameters may hold a value of -1 if the corresponding result is not part of the string being parsed.
The parsing routines attempt to be as forgiving as possible.
Breaks the authority string up into its 4 components: username, password, hostname, and hostport.
auth = <username>:<password>@<hostname>:<port>
void parseAuthority( in string authority, in long authorityLen, out unsigned long usernamePos, out long usernameLen, out unsigned long passwordPos, out long passwordLen, out unsigned long hostnamePos, out long hostnameLen, out long port );
authority
authorityLen
usernamePos
usernameLen
passwordPos
passwordLen
hostnamePos
hostnameLen
port
filename = <basename>.<extension>
void parseFileName( in string filename, in long filenameLen, out unsigned long basenamePos, out long basenameLen, out unsigned long extensionPos, out long extensionLen );
filename
filenameLen
basenamePos
basenameLen
extensionPos
extensionLen
Breaks the file path string up into: the directory portion, file base name, and file extension.
filepath = <directory><basename>.<extension>
void parseFilePath( in string filepath, in long filepathLen, out unsigned long directoryPos, out long directoryLen, out unsigned long basenamePos, out long basenameLen, out unsigned long extensionPos, out long extensionLen );
filepath
filepathLen
directoryPos
directoryLen
basenamePos
basenameLen
extensionPos
extensionLen
Breaks the path string up into its 4 major components: a file path, a param string, a query string, and a reference string.
path = <filepath>;<param>?<query>#<ref>
void parsePath( in string path, in long pathLen, out unsigned long filepathPos, out long filepathLen, out unsigned long paramPos, // Removed in Gecko 9.0 out long paramLen, // Removed in Gecko 9.0 out unsigned long queryPos, out long queryLen, out unsigned long refPos, out long refLen );
path
pathLen
filepathPos
filepathLen
paramPos
Obsolete since Gecko 9.0paramLen
Obsolete since Gecko 9.0queryPos
queryLen
refPos
refLen
serverinfo = <hostname>:<port>
void parseServerInfo( in string serverinfo, in long serverinfoLen, out unsigned long hostnamePos, out long hostnameLen, out long port );
serverinfo
serverinfoLen
hostnamePos
hostnameLen
port
Breaks the URL string up into its 3 major components: a scheme, an authority section (hostname, and so on.), and a path.
spec = <scheme>://<authority><path>
void parseURL( in string spec, in long specLen, out unsigned long schemePos, out long schemeLen, out unsigned long authorityPos, out long authorityLen, out unsigned long pathPos, out long pathLen );
spec
specLen
schemePos
schemeLen
authorityPos
authorityLen
pathPos
pathLen
userinfo = <username>:<password>
void parseUserInfo( in string userinfo, in long userinfoLen, out unsigned long usernamePos, out long usernameLen, out unsigned long passwordPos, out long passwordLen );
userinfo
userinfoLen
usernamePos
usernameLen
passwordPos
passwordLen
Starting in Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6), this no longer treats the semicolon as a "parameter string" marker. This was never a valid part of a URL, and is now no longer supported. This makes URLs with semicolons in them work correctly.