summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-08-16 14:56:59 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-18 10:55:47 +0200
commitbc7e940f6ba181e19f27cc472c3dcaff1eb66fa8 (patch)
tree46cddcd66d3b8ae06d3215af0d36e72d5dcd36f1 /src/corelib/io
parent1bf5865a4137c615e7b9b10fd157a32e2bf61274 (diff)
Bring back the documentation on QUrl deprecated methods
The deprecated query methods were removed along with their documentation in commit 1c2144c39fa0069bf496e8f77389a9c2f8a31acf, so restore it from before that commit. The rest of the encoded methods were removed along with their documentation in commit 1372d60bde04a31c8036601076d1093a67c6bd46. Restore their documentation from the previous commit to that one. All the documentation from this commit is brought back unchanged, except for the addition of \deprecated. Change-Id: I1851b0dc922c681e1623359b35dfd0f505d258d2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qurl.cpp433
1 files changed, 433 insertions, 0 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 5fd3dcf55b..a3fbf333e7 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -1565,6 +1565,20 @@ void QUrl::setUrl(const QString &url, ParsingMode parsingMode)
}
}
+/*!
+ \fn void QUrl::setEncodedUrl(const QByteArray &encodedUrl, ParsingMode parsingMode)
+ \deprecated
+ Constructs a URL by parsing the contents of \a encodedUrl.
+
+ \a encodedUrl is assumed to be a URL string in percent encoded
+ form, containing only ASCII characters.
+
+ The parsing mode \a parsingMode is used for parsing \a encodedUrl.
+
+ \obsolete Use setUrl(QString::fromUtf8(encodedUrl), parsingMode)
+
+ \sa setUrl()
+*/
/*!
Sets the scheme of the URL to \a scheme. As a scheme can only
@@ -1804,6 +1818,35 @@ QString QUrl::userName(ComponentFormattingOptions options) const
}
/*!
+ \fn void QUrl::setEncodedUserName(const QByteArray &userName)
+ \deprecated
+ \since 4.4
+
+ Sets the URL's user name to the percent-encoded \a userName. The \a
+ userName is part of the user info element in the authority of the
+ URL, as described in setUserInfo().
+
+ Note: this function does not verify that \a userName is properly
+ encoded. It is the caller's responsibility to ensure that the any
+ delimiters (such as colons or slashes) are properly encoded.
+
+ \sa setUserName(), encodedUserName(), setUserInfo()
+*/
+
+/*!
+ \fn QByteArray QUrl::encodedUserName() const
+ \deprecated
+ \since 4.4
+
+ Returns the user name of the URL if it is defined; otherwise
+ an empty string is returned. The returned value will have its
+ non-ASCII and other control characters percent-encoded, as in
+ toEncoded().
+
+ \sa setEncodedUserName()
+*/
+
+/*!
Sets the URL's password to \a password. The \a password is part of
the user info element in the authority of the URL, as described in
setUserInfo().
@@ -1865,6 +1908,35 @@ QString QUrl::password(ComponentFormattingOptions options) const
}
/*!
+ \fn void QUrl::setEncodedPassword(const QByteArray &password)
+ \deprecated
+ \since 4.4
+
+ Sets the URL's password to the percent-encoded \a password. The \a
+ password is part of the user info element in the authority of the
+ URL, as described in setUserInfo().
+
+ Note: this function does not verify that \a password is properly
+ encoded. It is the caller's responsibility to ensure that the any
+ delimiters (such as colons or slashes) are properly encoded.
+
+ \sa setPassword(), encodedPassword(), setUserInfo()
+*/
+
+/*!
+ \fn QByteArray QUrl::encodedPassword() const
+ \deprecated
+ \since 4.4
+
+ Returns the password of the URL if it is defined; otherwise an
+ empty string is returned. The returned value will have its
+ non-ASCII and other control characters percent-encoded, as in
+ toEncoded().
+
+ \sa setEncodedPassword(), toEncoded()
+*/
+
+/*!
Sets the host of the URL to \a host. The host is part of the
authority.
@@ -1942,6 +2014,36 @@ QString QUrl::host(ComponentFormattingOptions options) const
}
/*!
+ \fn void QUrl::setEncodedHost(const QByteArray &host)
+ \deprecated
+ \since 4.4
+
+ Sets the URL's host to the ACE- or percent-encoded \a host. The \a
+ host is part of the user info element in the authority of the
+ URL, as described in setAuthority().
+
+ \sa setHost(), encodedHost(), setAuthority(), fromAce()
+*/
+
+/*!
+ \fn QByteArray QUrl::encodedHost() const
+ \deprecated
+ \since 4.4
+
+ Returns the host part of the URL if it is defined; otherwise
+ an empty string is returned.
+
+ 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().
+
+ \sa setEncodedHost()
+*/
+
+/*!
Sets the port of the URL to \a port. The port is part of the
authority of the URL, as described in setAuthority().
@@ -2047,6 +2149,42 @@ QString QUrl::path(ComponentFormattingOptions options) const
}
/*!
+ \fn void QUrl::setEncodedPath(const QByteArray &path)
+ \deprecated
+ \since 4.4
+
+ Sets the URL's path to the percent-encoded \a path. The path is
+ the part of the URL that comes after the authority but before the
+ query string.
+
+ \image qurl-ftppath.png
+
+ For non-hierarchical schemes, the path will be everything
+ following the scheme declaration, as in the following example:
+
+ \image qurl-mailtopath.png
+
+ Note: this function does not verify that \a path is properly
+ encoded. It is the caller's responsibility to ensure that the any
+ delimiters (such as '?' and '#') are properly encoded.
+
+ \sa setPath(), encodedPath(), setUserInfo()
+*/
+
+/*!
+ \fn QByteArray QUrl::encodedPath() const
+ \deprecated
+ \since 4.4
+
+ Returns the path of the URL if it is defined; otherwise an
+ empty string is returned. The returned value will have its
+ non-ASCII and other control characters percent-encoded, as in
+ toEncoded().
+
+ \sa setEncodedPath(), toEncoded()
+*/
+
+/*!
\since 4.2
Returns true if this URL contains a Query (i.e., if ? was seen on it).
@@ -2106,6 +2244,28 @@ void QUrl::setQuery(const QString &query, ParsingMode mode)
}
/*!
+ \fn void QUrl::setEncodedQuery(const QByteArray &query)
+ \deprecated
+
+ Sets the query string of the URL to \a query. The string is
+ inserted as-is, and no further encoding is performed when calling
+ 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 \a 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 "?".
+
+ \sa encodedQuery(), hasQuery()
+*/
+
+
+/*!
\overload
\since 5.0
Sets the query string of the URL to \a query.
@@ -2129,6 +2289,244 @@ void QUrl::setQuery(const QUrlQuery &query)
}
/*!
+ \fn void QUrl::setQueryItems(const QList<QPair<QString, QString> > &query)
+ \deprecated
+
+ Sets the query string of the URL to an encoded version of \a
+ query. The contents of \a query are converted to a string
+ internally, each pair delimited by the character returned by
+ pairDelimiter(), and the key and value are delimited by
+ valueDelimiter().
+
+ \note This method does not encode spaces (ASCII 0x20) as plus (+) signs,
+ like HTML forms do. If you need that kind of encoding, you must encode
+ the value yourself and use QUrl::setEncodedQueryItems.
+
+ \sa setQueryDelimiters(), queryItems(), setEncodedQueryItems()
+*/
+
+/*!
+ \fn void QUrl::setEncodedQueryItems(const QList<QPair<QByteArray, QByteArray> > &query)
+ \deprecated
+ \since 4.4
+
+ Sets the query string of the URL to the encoded version of \a
+ query. The contents of \a query are converted to a string
+ internally, each pair delimited by the character returned by
+ 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.
+
+ \sa setQueryDelimiters(), encodedQueryItems(), setQueryItems()
+*/
+
+/*!
+ \fn void QUrl::addQueryItem(const QString &key, const QString &value)
+ \deprecated
+
+ Inserts the pair \a key = \a value into the query string of the
+ URL.
+
+ The key/value pair is encoded before it is added to the query. The
+ pair is converted into separate strings internally. The \a key and
+ \a value is first encoded into UTF-8 and then delimited by the
+ character returned by valueDelimiter(). Each key/value pair is
+ delimited by the character returned by pairDelimiter().
+
+ \note This method does not encode spaces (ASCII 0x20) as plus (+) signs,
+ like HTML forms do. If you need that kind of encoding, you must encode
+ the value yourself and use QUrl::addEncodedQueryItem.
+
+ \sa addEncodedQueryItem()
+*/
+
+/*!
+ \fn void QUrl::addEncodedQueryItem(const QByteArray &key, const QByteArray &value)
+ \deprecated
+ \since 4.4
+
+ Inserts the pair \a key = \a value into the query string of the
+ URL.
+
+ Note: this function does not verify that either \a key or \a value
+ are properly encoded. It is the caller's responsibility to ensure
+ that the query delimiters are properly encoded, if any.
+
+ \sa addQueryItem(), setQueryDelimiters()
+*/
+
+/*!
+ \fn QList<QPair<QString, QString> > QUrl::queryItems() const
+ \deprecated
+
+ Returns the query string of the URL, as a map of keys and values.
+
+ \note This method does not decode spaces plus (+) signs as spaces (ASCII
+ 0x20), like HTML forms do. If you need that kind of decoding, you must
+ use QUrl::encodedQueryItems and decode the data yourself.
+
+ \sa setQueryItems(), setEncodedQuery()
+*/
+
+/*!
+ \fn QList<QPair<QByteArray, QByteArray> > QUrl::encodedQueryItems() const
+ \deprecated
+ \since 4.4
+
+ Returns the query string of the URL, as a map of encoded keys and values.
+
+ \sa setEncodedQueryItems(), setQueryItems(), setEncodedQuery()
+*/
+
+/*!
+ \fn bool QUrl::hasQueryItem(const QString &key) const
+ \deprecated
+
+ Returns true if there is a query string pair whose key is equal
+ to \a key from the URL.
+
+ \sa hasEncodedQueryItem()
+*/
+
+/*!
+ \fn bool QUrl::hasEncodedQueryItem(const QByteArray &key) const
+ \deprecated
+ \since 4.4
+
+ Returns true if there is a query string pair whose key is equal
+ to \a key from the URL.
+
+ Note: if the encoded \a 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 \a key = "%73earch" will return false.
+
+ \sa hasQueryItem()
+*/
+
+/*!
+ \fn QString QUrl::queryItemValue(const QString &key) const
+ \deprecated
+
+ Returns the first query string value whose key is equal to \a key
+ from the URL.
+
+ \note This method does not decode spaces plus (+) signs as spaces (ASCII
+ 0x20), like HTML forms do. If you need that kind of decoding, you must
+ use QUrl::encodedQueryItemValue and decode the data yourself.
+
+ \sa allQueryItemValues()
+*/
+
+/*!
+ \fn QByteArray QUrl::encodedQueryItemValue(const QByteArray &key) const
+ \deprecated
+ \since 4.4
+
+ Returns the first query string value whose key is equal to \a key
+ from the URL.
+
+ Note: if the encoded \a 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 \a key = "%73earch" will return an empty string.
+
+ \sa queryItemValue(), allQueryItemValues()
+*/
+
+/*!
+ \fn QStringList QUrl::allQueryItemValues(const QString &key) const
+ \deprecated
+
+ Returns the a list of query string values whose key is equal to
+ \a key from the URL.
+
+ \note This method does not decode spaces plus (+) signs as spaces (ASCII
+ 0x20), like HTML forms do. If you need that kind of decoding, you must
+ use QUrl::allEncodedQueryItemValues and decode the data yourself.
+
+ \sa queryItemValue()
+*/
+
+/*!
+ \fn QList<QByteArray> QUrl::allEncodedQueryItemValues(const QByteArray &key) const
+ \deprecated
+ \since 4.4
+
+ Returns the a list of query string values whose key is equal to
+ \a key from the URL.
+
+ Note: if the encoded \a 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 \a key = "%73earch" will return an empty list.
+
+ \sa allQueryItemValues(), queryItemValue(), encodedQueryItemValue()
+*/
+
+/*!
+ \fn void QUrl::removeQueryItem(const QString &key)
+ \deprecated
+
+ Removes the first query string pair whose key is equal to \a key
+ from the URL.
+
+ \sa removeAllQueryItems()
+*/
+
+/*!
+ \fn void QUrl::removeEncodedQueryItem(const QByteArray &key)
+ \deprecated
+ \since 4.4
+
+ Removes the first query string pair whose key is equal to \a key
+ from the URL.
+
+ Note: if the encoded \a 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 \a key = "%73earch" will do nothing.
+
+ \sa removeQueryItem(), removeAllQueryItems()
+*/
+
+/*!
+ \fn void QUrl::removeAllQueryItems(const QString &key)
+ \deprecated
+
+ Removes all the query string pairs whose key is equal to \a key
+ from the URL.
+
+ \sa removeQueryItem()
+*/
+
+/*!
+ \fn void QUrl::removeAllEncodedQueryItems(const QByteArray &key)
+ \deprecated
+ \since 4.4
+
+ Removes all the query string pairs whose key is equal to \a key
+ from the URL.
+
+ Note: if the encoded \a 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 \a key = "%73earch" will do nothing.
+
+ \sa removeQueryItem()
+*/
+
+/*!
+ \fn QByteArray QUrl::encodedQuery() const
+ \deprecated
+
+ Returns the query string of the URL in percent encoded form.
+*/
+
+/*!
Returns the query string of the URL if there's a query string, or an empty
result if not. To determine if the parsed URL contained a query string, use
hasQuery().
@@ -2228,6 +2626,41 @@ QString QUrl::fragment(ComponentFormattingOptions options) const
}
/*!
+ \fn void QUrl::setEncodedFragment(const QByteArray &fragment)
+ \deprecated
+ \since 4.4
+
+ Sets the URL's fragment to the percent-encoded \a fragment. The fragment is the
+ last part of the URL, represented by a '#' followed by a string of
+ characters. It is typically used in HTTP for referring to a
+ certain link or point on a page:
+
+ \image qurl-fragment.png
+
+ The fragment is sometimes also referred to as the URL "reference".
+
+ 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 "#").
+
+ \sa setFragment(), encodedFragment()
+*/
+
+/*!
+ \fn QByteArray QUrl::encodedFragment() const
+ \deprecated
+ \since 4.4
+
+ Returns the fragment of the URL if it is defined; otherwise an
+ empty string is returned. The returned value will have its
+ non-ASCII and other control characters percent-encoded, as in
+ toEncoded().
+
+ \sa setEncodedFragment(), toEncoded()
+*/
+
+/*!
\since 4.2
Returns true if this URL contains a fragment (i.e., if # was seen on it).