diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2011-09-05 23:17:21 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-30 01:19:59 +0200 |
commit | 6028efa3ff56b58ce70d5b8fdb53030185149028 (patch) | |
tree | d809a79bf11ed92778da5dc81fe45bbe2165ace6 /src/corelib/io/qurl.h | |
parent | 4c7e950aad0ed7b2bc114b3ffd5c73f7a433af52 (diff) |
Add the code that recodes URLs.
This one function is an all-in-one:
- UTF-8 encoder
- UTF-8 decoder
- percent encoder
- percent decoder
The next step is add the ability to modify the behaviour, by telling
the function what else it must encode or decode and what it should
leave untouched.
Change-Id: I997eccfd2f9ad8487305670b18d6c806f4cf6717
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/io/qurl.h')
-rw-r--r-- | src/corelib/io/qurl.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index 7c6cc29618..1600cb8fa3 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -82,6 +82,18 @@ public: }; Q_DECLARE_FLAGS(FormattingOptions, FormattingOption) + enum ComponentFormattingOption { + FullyEncoded = 0x000000, + DecodeSpaces = 0x100000, + DecodeUnambiguousDelimiters = 0x200000, + DecodeAllDelimiters = DecodeUnambiguousDelimiters | 0x400000, + DecodeUnicode = 0x800000, + + PrettyDecoded = DecodeSpaces | DecodeUnambiguousDelimiters | DecodeUnicode, + MostDecoded = PrettyDecoded | DecodeAllDelimiters + }; + Q_DECLARE_FLAGS(ComponentFormattingOptions, ComponentFormattingOption) + QUrl(); #ifdef QT_NO_URL_CAST_FROM_STRING explicit @@ -236,6 +248,7 @@ inline uint qHash(const QUrl &url) Q_DECLARE_TYPEINFO(QUrl, Q_MOVABLE_TYPE); Q_DECLARE_SHARED(QUrl) +Q_DECLARE_OPERATORS_FOR_FLAGS(QUrl::ComponentFormattingOptions) Q_DECLARE_OPERATORS_FOR_FLAGS(QUrl::FormattingOptions) #ifndef QT_NO_DATASTREAM |