|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QUrl
public class QUrl
The QUrl class provides a convenient interface for working with URLs. It can parse and construct URLs in both encoded and unencoded form. QUrl also has support for internationalized domain names (IDNs).
The most common way to use QUrl is to initialize it via the constructor by passing a QString. Otherwise, setUrl()
and setEncodedUrl()
can also be used.
URLs can be represented in two forms: encoded or unencoded. The unencoded representation is suitable for showing to users, but the encoded representation is typically what you would send to a web server. For example, the unencoded URL "http://bühler.example.com" would be sent to the server as "http://xn--bhler-kva.example.com/List%20of%20applicants.xml".
A URL can also be constructed piece by piece by calling setScheme()
, setUserName()
, setPassword()
, setHost()
, setPort()
, setPath()
, setEncodedQuery()
and setFragment()
. Some convenience functions are also available: setAuthority()
sets the user name, password, host and port. setUserInfo()
sets the user name and password at once.
Call isValid()
to check if the URL is valid. This can be done at any point during the constructing of a URL.
Constructing a query is particularly convenient through the use of setQueryItems()
, addQueryItem()
and removeQueryItem()
. Use setQueryDelimiters()
to customize the delimiters used for generating the query string.
For the convenience of generating encoded URL strings or query strings, there are two static functions called fromPercentEncoding()
and toPercentEncoding()
which deal with percent encoding and decoding of QStrings.
Calling isRelative()
will tell whether or not the URL is relative. A relative URL can be resolved by passing it as argument to resolved()
, which returns an absolute URL. isParentOf()
is used for determining whether one URL is a parent of another.
fromLocalFile()
constructs a QUrl by parsing a local file path. toLocalFile()
converts a URL to a local file path.
The human readable representation of the URL is fetched with toString()
. This representation is appropriate for displaying a URL to a user in unencoded form. The encoded form however, as returned by toEncoded()
, is for internal use, passing to web servers, mail clients and so on.
QUrl conforms to the URI specification from RFC 3986 (Uniform Resource Identifier: Generic Syntax), and includes scheme extensions from RFC 1738 (Uniform Resource Locators). Case folding rules in QUrl conform to RFC 3491 (Nameprep: A Stringprep Profile for Internationalized Domain Names (IDN)).
QUrlInfo
.
Nested Class Summary | |
---|---|
static class |
QUrl.FormattingOption
The formatting options define how the URL is formatted when written out as text. |
static class |
QUrl.FormattingOptions
|
static class |
QUrl.ParsingMode
The parsing mode controls the way QUrl parses strings. |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QUrl()
Constructs an empty QUrl object. |
|
QUrl(QUrl copy)
Constructs a copy of other. |
|
QUrl(java.lang.String url)
Constructs a URL by parsing url. |
|
QUrl(java.lang.String url,
QUrl.ParsingMode mode)
Parses the url using the parser mode parsingMode. |
Method Summary | |
---|---|
void |
addEncodedQueryItem(QByteArray key,
QByteArray value)
Inserts the pair key = value into the query string of the URL. |
void |
addQueryItem(java.lang.String key,
java.lang.String value)
Inserts the pair key = value into the query string of the URL. |
java.util.List |
allEncodedQueryItemValues(QByteArray key)
Returns the a list of query string values whose key is equal to key from the URL. |
java.util.List |
allQueryItemValues(java.lang.String key)
Returns the a list of query string values whose key is equal to key from the URL. |
java.lang.String |
authority()
Returns the authority of the URL if it is defined; otherwise an empty string is returned. |
void |
clear()
Resets the content of the QUrl. |
QUrl |
clone()
This method is reimplemented for internal reasons |
QByteArray |
encodedFragment()
Returns the fragment of the URL if it is defined; otherwise an empty string is returned. |
QByteArray |
encodedHost()
Returns the host part of the URL if it is defined; otherwise an empty string is returned. |
QByteArray |
encodedPassword()
Returns the password of the URL if it is defined; otherwise an empty string is returned. |
QByteArray |
encodedPath()
Returns the path of the URL if it is defined; otherwise an empty string is returned. |
QByteArray |
encodedQuery()
Returns the query string of the URL in percent encoded form. |
java.util.List |
encodedQueryItems()
Returns the query string of the URL, as a map of encoded keys and values. |
QByteArray |
encodedQueryItemValue(QByteArray key)
Returns the first query string value whose key is equal to key from the URL. |
QByteArray |
encodedUserName()
Returns the user name of the URL if it is defined; otherwise an empty string is returned. |
java.lang.String |
errorString()
Returns a text string that explains why an URL is invalid in the case being; otherwise returns an empty string. |
java.lang.String |
fragment()
Returns the fragment of the URL. |
static java.lang.String |
fromAce(QByteArray arg__1)
Returns the Unicode form of the given domain name domain, which is encoded in the ASCII Compatible Encoding (ACE). |
static QUrl |
fromEncoded(QByteArray url)
Parses input and returns the corresponding QUrl. |
static QUrl |
fromEncoded(QByteArray url,
QUrl.ParsingMode mode)
Parses the URL using parsingMode. |
static QUrl |
fromLocalFile(java.lang.String localfile)
Returns a QUrl representation of localFile, interpreted as a local file. |
static java.lang.String |
fromPercentEncoding(QByteArray arg__1)
Returns a decoded copy of input. |
boolean |
hasEncodedQueryItem(QByteArray key)
Returns true if there is a query string pair whose key is equal to key from the URL. |
boolean |
hasFragment()
Returns true if this URL contains a fragment (i. |
boolean |
hasQuery()
Returns true if this URL contains a Query (i. |
boolean |
hasQueryItem(java.lang.String key)
Returns true if there is a query string pair whose key is equal to key from the URL. |
java.lang.String |
host()
Returns the host of the URL if it is defined; otherwise an empty string is returned. |
static java.util.List |
idnWhitelist()
Returns the current whitelist of top-level domains that are allowed to have non-ASCII characters in their compositions. |
boolean |
isEmpty()
Returns true if the URL has no data; otherwise returns false. |
boolean |
isParentOf(QUrl url)
Returns true if this URL is a parent of childUrl. |
boolean |
isRelative()
Returns true if the URL is relative; otherwise returns false. |
boolean |
isValid()
Returns true if the URL is valid; otherwise returns false. |
java.lang.String |
password()
Returns the password of the URL if it is defined; otherwise an empty string is returned. |
java.lang.String |
path()
Returns the path of the URL. |
int |
port()
Returns the port of the URL, or -1 if the port is unspecified. |
int |
port(int defaultPort)
Returns the port of the URL, or defaultPort if the port is unspecified. |
java.util.List |
queryItems()
Returns the query string of the URL, as a map of keys and values. |
java.lang.String |
queryItemValue(java.lang.String key)
Returns the first query string value whose key is equal to key from the URL. |
byte |
queryPairDelimiter()
Returns the character used to delimit between key-value pairs in the query string of the URL. |
byte |
queryValueDelimiter()
Returns the character used to delimit between keys and values in the query string of the URL. |
void |
readFrom(QDataStream arg__1)
|
void |
removeAllEncodedQueryItems(QByteArray key)
Removes all the query string pairs whose key is equal to key from the URL. |
void |
removeAllQueryItems(java.lang.String key)
Removes all the query string pairs whose key is equal to key from the URL. |
void |
removeEncodedQueryItem(QByteArray key)
Removes the first query string pair whose key is equal to key from the URL. |
void |
removeQueryItem(java.lang.String key)
Removes the first query string pair whose key is equal to key from the URL. |
QUrl |
resolved(QUrl relative)
Returns the result of the merge of this URL with relative. |
java.lang.String |
scheme()
Returns the scheme of the URL. |
void |
setAuthority(java.lang.String authority)
Sets the authority of the URL to authority. |
void |
setEncodedFragment(QByteArray fragment)
Sets the URL's fragment to the percent-encoded fragment. |
void |
setEncodedHost(QByteArray host)
Sets the URL's host to the ACE- or percent-encoded host. |
void |
setEncodedPassword(QByteArray password)
Sets the URL's password to the percent-encoded password. |
void |
setEncodedPath(QByteArray path)
Sets the URL's path to the percent-encoded path. |
void |
setEncodedQuery(QByteArray query)
Sets the query string of the URL to query. |
void |
setEncodedQueryItems(java.util.List query)
Sets the query string of the URL to the encoded version of query. |
void |
setEncodedUrl(QByteArray url)
Constructs a URL by parsing the contents of encodedUrl. |
void |
setEncodedUrl(QByteArray url,
QUrl.ParsingMode mode)
Constructs a URL by parsing the contents of encodedUrl using the given parsingMode. |
void |
setEncodedUserName(QByteArray userName)
Sets the URL's user name to the percent-encoded userName. |
void |
setFragment(java.lang.String fragment)
Sets the fragment of the URL to fragment. |
void |
setHost(java.lang.String host)
Sets the host of the URL to host. |
static void |
setIdnWhitelist(java.util.List arg__1)
Sets the whitelist of Top-Level Domains (TLDs) that are allowed to have non-ASCII characters in domains to the value of list. |
void |
setPassword(java.lang.String password)
Sets the URL's password to password. |
void |
setPath(java.lang.String path)
Sets the path of the URL to path. |
void |
setPort(int port)
Sets the port of the URL to port. |
void |
setQueryDelimiters(byte valueDelimiter,
byte pairDelimiter)
Sets the characters used for delimiting between keys and values, and between key-value pairs in the URL's query string. |
void |
setQueryItems(java.util.List query)
Sets the query string of the URL to an encoded version of query. |
void |
setScheme(java.lang.String scheme)
Sets the scheme of the URL to scheme. |
void |
setUrl(java.lang.String url)
Constructs a URL by parsing the contents of url. |
void |
setUrl(java.lang.String url,
QUrl.ParsingMode mode)
Parses url using the parsing mode parsingMode. |
void |
setUserInfo(java.lang.String userInfo)
Sets the user info of the URL to userInfo. |
void |
setUserName(java.lang.String userName)
Sets the URL's user name to userName. |
static QByteArray |
toAce(java.lang.String arg__1)
Returns the ASCII Compatible Encoding of the given domain name domain. |
QByteArray |
toEncoded()
Returns the encoded representation of the URL if it's valid; otherwise an empty QByteArray is returned. |
QByteArray |
toEncoded(QUrl.FormattingOption[] options)
|
QByteArray |
toEncoded(QUrl.FormattingOptions options)
Returns the encoded representation of the URL if it's valid; otherwise an empty QByteArray is returned. |
java.lang.String |
toLocalFile()
Returns the path of this URL formatted as a local file path. |
static QByteArray |
toPercentEncoding(java.lang.String arg__1)
Returns an encoded copy of input. |
static QByteArray |
toPercentEncoding(java.lang.String arg__1,
QByteArray exclude)
Returns an encoded copy of input. |
static QByteArray |
toPercentEncoding(java.lang.String arg__1,
QByteArray exclude,
QByteArray include)
Returns an encoded copy of input. |
java.lang.String |
toString()
|
java.lang.String |
toString(QUrl.FormattingOption[] options)
|
java.lang.String |
toString(QUrl.FormattingOptions options)
|
java.lang.String |
userInfo()
Returns the user info of the URL, or an empty string if the user info is undefined. |
java.lang.String |
userName()
Returns the user name of the URL if it is defined; otherwise an empty string is returned. |
void |
writeTo(QDataStream arg__1)
|
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QUrl()
public QUrl(java.lang.String url)
Example:
QUrl url = new QUrl("http://www.example.com/List of holidays.xml"); // url.toEncoded() == "http://www.example.com/List%20of%20holidays.xml"To construct a URL from an encoded string, call
fromEncoded()
: QUrl url = QUrl.fromEncoded(new QByteArray("http://www.trolltech.com/List%20of%20holidays.xml"));
setUrl()
, setEncodedUrl()
, fromEncoded()
, and TolerantMode
.
public QUrl(java.lang.String url, QUrl.ParsingMode mode)
setUrl()
.
public QUrl(QUrl copy)
Method Detail |
---|
public final void addEncodedQueryItem(QByteArray key, QByteArray value)
Note: this function does not verify that either key or value are properly encoded. It is the caller's responsibility to ensure that the query delimiters are properly encoded, if any.
addQueryItem()
, and setQueryDelimiters()
.
public final void addQueryItem(java.lang.String key, java.lang.String value)
addEncodedQueryItem()
.
public final java.util.List allEncodedQueryItemValues(QByteArray key)
Note: if the encoded key does not match the encoded version of the query, this function will not work. That is, if the encoded query of this URL is "search=Qt%20Rules", calling this function with key = "%73earch" will return an empty list.
allQueryItemValues()
, queryItemValue()
, and encodedQueryItemValue()
.
public final java.util.List allQueryItemValues(java.lang.String key)
queryItemValue()
.
public final java.lang.String authority()
setAuthority()
.
public final void clear()
public final QByteArray encodedFragment()
toEncoded()
. setEncodedFragment()
, and toEncoded()
.
public final QByteArray encodedHost()
Note: encodedHost()
does not return percent-encoded hostnames. Instead, the ACE-encoded (bare ASCII in Punycode encoding) form will be returned for any non-ASCII hostname.
This function is equivalent to calling QUrl::toAce()
on the return value of host()
.
setEncodedHost()
.
public final QByteArray encodedPassword()
toEncoded()
. setEncodedPassword()
, and toEncoded()
.
public final QByteArray encodedPath()
toEncoded()
. setEncodedPath()
, and toEncoded()
.
public final QByteArray encodedQuery()
setEncodedQuery()
.
public final QByteArray encodedQueryItemValue(QByteArray key)
Note: if the encoded key does not match the encoded version of the query, this function will not work. That is, if the encoded query of this URL is "search=Qt%20Rules", calling this function with key = "%73earch" will return an empty string.
queryItemValue()
, and allQueryItemValues()
.
public final java.util.List encodedQueryItems()
setEncodedQueryItems()
, setQueryItems()
, and setEncodedQuery()
.
public final QByteArray encodedUserName()
toEncoded()
. setEncodedUserName()
.
public final java.lang.String errorString()
public final java.lang.String fragment()
setFragment()
.
public final boolean hasEncodedQueryItem(QByteArray key)
Note: if the encoded key does not match the encoded version of the query, this function will return false. That is, if the encoded query of this URL is "search=Qt%20Rules", calling this function with key = "%73earch" will return false.
hasQueryItem()
.
public final boolean hasFragment()
fragment()
, and setFragment()
.
public final boolean hasQuery()
hasQueryItem()
, and encodedQuery()
.
public final boolean hasQueryItem(java.lang.String key)
hasEncodedQueryItem()
.
public final java.lang.String host()
setHost()
.
public final boolean isEmpty()
public final boolean isParentOf(QUrl url)
public final boolean isRelative()
scheme()
.isEmpty()
.
public final boolean isValid()
The URL is run through a conformance test. Every part of the URL must conform to the standard encoding rules of the URI standard for the URL to be reported as valid.
private boolean checkUrl(QUrl url) { if (!url.isValid()) { System.out.println("Invalid URL: " + url); return false; } return true; }
public final void writeTo(QDataStream arg__1)
public final void readFrom(QDataStream arg__1)
public final java.lang.String password()
setPassword()
.
public final java.lang.String path()
setPath()
.
public final int port()
setPort()
.
public final int port(int defaultPort)
Example:
QFtp ftp = new QFtp(); ftp.connectToHost(url.host(), (char)url.port(21));
public final java.lang.String queryItemValue(java.lang.String key)
allQueryItemValues()
.
public final java.util.List queryItems()
setQueryItems()
, and setEncodedQuery()
.
public final byte queryPairDelimiter()
public final byte queryValueDelimiter()
public final void removeAllEncodedQueryItems(QByteArray key)
Note: if the encoded key does not match the encoded version of the query, this function will not work. That is, if the encoded query of this URL is "search=Qt%20Rules", calling this function with key = "%73earch" will do nothing.
removeQueryItem()
.
public final void removeAllQueryItems(java.lang.String key)
removeQueryItem()
.
public final void removeEncodedQueryItem(QByteArray key)
Note: if the encoded key does not match the encoded version of the query, this function will not work. That is, if the encoded query of this URL is "search=Qt%20Rules", calling this function with key = "%73earch" will do nothing.
removeQueryItem()
, and removeAllQueryItems()
.
public final void removeQueryItem(java.lang.String key)
removeAllQueryItems()
.
public final QUrl resolved(QUrl relative)
If relative is not a relative URL, this function will return relative directly. Otherwise, the paths of the two URLs are merged, and the new URL returned has the scheme and authority of the base URL, but with the merged path, as in the following example:
QUrl baseUrl = new QUrl("http://www.trolltech.com/support"); QUrl relativeUrl = new QUrl("../products/solutions"); System.out.println(baseUrl.resolved(relativeUrl).toString()); // prints "http://www.trolltech.com/products/solutions"Calling
resolved()
with ".." returns a QUrl whose directory is one level higher than the original. Similarly, calling resolved()
with "../.." removes two levels from the path. If relative is "/", the path becomes "/". isRelative()
.
public final java.lang.String scheme()
setScheme()
, and isRelative()
.
public final void setAuthority(java.lang.String authority)
The authority of a URL is the combination of user info, a host name and a port. All of these elements are optional; an empty authority is therefore valid.
The user info and host are separated by a '@', and the host and port are separated by a ':'. If the user info is empty, the '@' must be omitted; although a stray ':' is permitted if the port is empty.
The following example shows a valid authority string:
authority()
.
public final void setEncodedFragment(QByteArray fragment)
Passing an argument of QByteArray() (a null QByteArray
) will unset the fragment. Passing an argument of QByteArray
("") (an empty but not null QByteArray
) will set the fragment to an empty string (as if the original URL had a lone "#").
setFragment()
, and encodedFragment()
.
public final void setEncodedHost(QByteArray host)
setAuthority()
. setHost()
, encodedHost()
, setAuthority()
, and fromAce()
.
public final void setEncodedPassword(QByteArray password)
setUserInfo()
. Note: this function does not verify that password is properly encoded. It is the caller's responsibility to ensure that the any delimiters (such as colons or slashes) are properly encoded.
setPassword()
, encodedPassword()
, and setUserInfo()
.
public final void setEncodedPath(QByteArray path)
setPath()
, encodedPath()
, and setUserInfo()
.
public final void setEncodedQuery(QByteArray query)
toEncoded()
. This function is useful if you need to pass a query string that does not fit into the key-value pattern, or that uses a different scheme for encoding special characters than what is suggested by QUrl.
Passing a value of QByteArray() to query (a null QByteArray
) unsets the query completely. However, passing a value of QByteArray
("") will set the query to an empty value, as if the original URL had a lone "?".
encodedQuery()
, and hasQuery()
.
public final void setEncodedQueryItems(java.util.List query)
pairDelimiter()
, and the key and value are delimited by valueDelimiter()
. Note: this function does not verify that the key-value pairs are properly encoded. It is the caller's responsibility to ensure that the query delimiters are properly encoded, if any.
setQueryDelimiters()
, encodedQueryItems()
, and setQueryItems()
.
public final void setEncodedUrl(QByteArray url)
encodedUrl is assumed to be a URL string in percent encoded form, containing only ASCII characters.
Use isValid()
to determine if a valid URL was constructed.
setUrl()
.
public final void setEncodedUrl(QByteArray url, QUrl.ParsingMode mode)
public final void setEncodedUserName(QByteArray userName)
setUserInfo()
. Note: this function does not verify that userName is properly encoded. It is the caller's responsibility to ensure that the any delimiters (such as colons or slashes) are properly encoded.
setUserName()
, encodedUserName()
, and setUserInfo()
.
public final void setFragment(java.lang.String fragment)
Passing an argument of QString() (a null QString) will unset the fragment. Passing an argument of QString("") (an empty but not null QString) will set the fragment to an empty string (as if the original URL had a lone "#").
fragment()
, and hasFragment()
.
public final void setHost(java.lang.String host)
host()
, and setAuthority()
.
public final void setPassword(java.lang.String password)
setUserInfo()
. password()
, and setUserInfo()
.
public final void setPath(java.lang.String path)
path()
.
public final void setPort(int port)
setAuthority()
. port must be between 0 and 65535 inclusive. Setting the port to -1 indicates that the port is unspecified.
port()
.
public final void setQueryDelimiters(byte valueDelimiter, byte pairDelimiter)
If valueDelimiter is set to '-' and pairDelimiter is '/', the above query string would instead be represented like this:
http://www.example.com/cgi-bin/drawgraph.cgi?type-pie/color-greenCalling this function does not change the delimiters of the current query string. It only affects
queryItems()
, setQueryItems()
and addQueryItems().
public final void setQueryItems(java.util.List query)
public final void setScheme(java.lang.String scheme)
The scheme describes the type (or protocol) of the URL. It's represented by one or more ASCII characters at the start the URL, and is followed by a ':'. The following example shows a URL where the scheme is "ftp":
scheme()
, and isRelative()
.
public final void setUrl(java.lang.String url)
url is assumed to be in unicode format, with no percent encoding.
Calling isValid()
will tell whether or not a valid URL was constructed.
setEncodedUrl()
.
public final void setUrl(java.lang.String url, QUrl.ParsingMode mode)
setEncodedUrl()
.
public final void setUserInfo(java.lang.String userInfo)
setAuthority()
. The user info consists of a user name and optionally a password, separated by a ':'. If the password is empty, the colon must be omitted. The following example shows a valid user info string:
userInfo()
, setUserName()
, setPassword()
, and setAuthority()
.
public final void setUserName(java.lang.String userName)
setUserInfo()
. setEncodedUserName()
, userName()
, and setUserInfo()
.
public final QByteArray toEncoded(QUrl.FormattingOption[] options)
public final QByteArray toEncoded()
QByteArray
is returned. The output can be customized by passing flags with options. The user info, path and fragment are all converted to UTF-8, and all non-ASCII characters are then percent encoded. The host name is encoded using Punycode.
public final QByteArray toEncoded(QUrl.FormattingOptions options)
QByteArray
is returned. The output can be customized by passing flags with options. The user info, path and fragment are all converted to UTF-8, and all non-ASCII characters are then percent encoded. The host name is encoded using Punycode.
public final java.lang.String toLocalFile()
fromLocalFile()
.
public final java.lang.String toString(QUrl.FormattingOption[] options)
public final java.lang.String toString()
toString
in class java.lang.Object
public final java.lang.String toString(QUrl.FormattingOptions options)
public final java.lang.String userInfo()
setUserInfo()
.
public final java.lang.String userName()
setUserName()
, and encodedUserName()
.
public static java.lang.String fromAce(QByteArray arg__1)
If the value in domain cannot be encoded, it will be converted to QString and returned.
The ASCII Compatible Encoding (ACE) is defined by RFC 3490, RFC 3491 and RFC 3492. It is part of the Internationalizing Domain Names in Applications (IDNA) specification, which allows for domain names (like "www.trolltech.com") to be written using international characters.
public static QUrl fromEncoded(QByteArray url)
The URL is parsed using TolerantMode
.
toEncoded()
, and setUrl()
.
public static QUrl fromEncoded(QByteArray url, QUrl.ParsingMode mode)
toEncoded()
, and setUrl()
.
public static QUrl fromLocalFile(java.lang.String localfile)
toLocalFile()
.
public static java.lang.String fromPercentEncoding(QByteArray arg__1)
public static java.util.List idnWhitelist()
See setIdnWhitelist()
for the rationale of this list.
setIdnWhitelist()
.
public static void setIdnWhitelist(java.util.List arg__1)
Qt has comes a default list that contains the Internet top-level domains that have published support for Internationalized Domain Names (IDNs) and rules to guarantee that no deception can happen between similarly-looking characters (such as the Latin lowercase letter 'a' and the Cyrillic equivalent, which in most fonts are visually identical).
This list is periodically maintained, as registrars publish new rules.
This function is provided for those who need to manipulate the list, in order to add or remove a TLD. It is not recommended to change its value for purposes other than testing, as it may expose users to security risks.
idnWhitelist()
.
public static QByteArray toAce(java.lang.String arg__1)
The ASCII-Compatible Encoding (ACE) is defined by RFC 3490, RFC 3491 and RFC 3492. It is part of the Internationalizing Domain Names in Applications (IDNA) specification, which allows for domain names (like "www.trolltech.com") to be written using international characters.
public static QByteArray toPercentEncoding(java.lang.String arg__1, QByteArray exclude)
Unreserved is defined as: ALPHA / DIGIT / "-" / "." / "_" / "~"
QByteArray ba = QUrl.toPercentEncoding("{a fishy string?}", new QByteArray("{}"), new QByteArray("s")); System.out.println(ba); // prints "{a fi%73hy %73tring%3F}"
public static QByteArray toPercentEncoding(java.lang.String arg__1)
Unreserved is defined as: ALPHA / DIGIT / "-" / "." / "_" / "~"
QByteArray ba = QUrl.toPercentEncoding("{a fishy string?}", new QByteArray("{}"), new QByteArray("s")); System.out.println(ba); // prints "{a fi%73hy %73tring%3F}"
public static QByteArray toPercentEncoding(java.lang.String arg__1, QByteArray exclude, QByteArray include)
Unreserved is defined as: ALPHA / DIGIT / "-" / "." / "_" / "~"
QByteArray ba = QUrl.toPercentEncoding("{a fishy string?}", new QByteArray("{}"), new QByteArray("s")); System.out.println(ba); // prints "{a fi%73hy %73tring%3F}"
public QUrl clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |