diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2011-10-20 16:23:41 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-30 01:19:59 +0200 |
commit | cff38329aa8635ac8a0696b0aa78782fe5605d16 (patch) | |
tree | 03d1845dd091f58ae72af1af749a6281b9d2014c /src/corelib/io/qurl_p.h | |
parent | 74d2dba46041448c70dbd3049ae2a8277770baf6 (diff) |
Re-introduce support for QUrl::errorString()
Note that QUrl can only remember one error. If the URL contains more
than one error condition, only the latest (in whichever parsing order
URL decides to use) will be reported.
I don't want too keep too much data in QUrlPrivate for validation, so
let's use 4 bytes only.
Change-Id: I2afbf80734d3633f41f779984ab76b3a5ba293a2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/io/qurl_p.h')
-rw-r--r-- | src/corelib/io/qurl_p.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/corelib/io/qurl_p.h b/src/corelib/io/qurl_p.h index 6a0af1c90a..d9207bd809 100644 --- a/src/corelib/io/qurl_p.h +++ b/src/corelib/io/qurl_p.h @@ -57,24 +57,6 @@ QT_BEGIN_NAMESPACE -struct QUrlErrorInfo { - inline QUrlErrorInfo() : _source(0), _message(0), _expected(0), _found(0) - { } - - const char *_source; - const char *_message; - char _expected; - char _found; - - inline void setParams(const char *source, const char *message, char expected, char found) - { - _source = source; - _message = message; - _expected = expected; - _found = found; - } -}; - class QUrlPrivate { public: @@ -92,6 +74,24 @@ public: Fragment = 0x80 }; + enum ErrorCode { + InvalidSchemeError = 0x000, + SchemeEmptyError, + + InvalidRegNameError = 0x800, + InvalidIPv4AddressError, + InvalidIPv6AddressError, + InvalidIPvFutureError, + HostMissingEndBracket, + + InvalidPortError = 0x1000, + PortEmptyError, + + PathContainsColonBeforeSlash = 0x2000, + + NoError = 0xffff + }; + QUrlPrivate(); QUrlPrivate(const QUrlPrivate ©); @@ -143,6 +143,9 @@ public: QString query; QString fragment; + ushort errorCode; + ushort errorSupplement; + // not used for: // - Port (port == -1 means absence) // - Path (there's no path delimiter, so we optimize its use out of existence) @@ -152,9 +155,6 @@ public: // UserName, Password, Path, Query, and Fragment never contain errors in TolerantMode. // Those flags are set only by the strict parser. uchar sectionHasError; - - mutable QUrlErrorInfo errorInfo; - QString createErrorString(); }; |