From 6028efa3ff56b58ce70d5b8fdb53030185149028 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 5 Sep 2011 23:17:21 +0200 Subject: 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 --- src/corelib/io/qurl.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/corelib/io/qurl.h') 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 -- cgit v1.2.3