X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..92c0fc34c104c8d7c12d6a3b78ea232690fc23f4:/interface/wx/uri.h diff --git a/interface/wx/uri.h b/interface/wx/uri.h index 82b38b4bb8..a9b8a70214 100644 --- a/interface/wx/uri.h +++ b/interface/wx/uri.h @@ -2,8 +2,7 @@ // Name: uri.h // Purpose: interface of wxURI // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -20,11 +19,9 @@ enum wxURIHostType /** @class wxURI - wxURI is used to extract information from a URI (Uniform Resource - Identifier). + wxURI is used to extract information from a URI (Uniform Resource Identifier). - For information about URIs, see RFC 3986 - . + For information about URIs, see RFC 3986 (http://www.ietf.org/rfc/rfc3986.txt). In short, a URL is a URI. In other words, URL is a subset of a URI - all acceptable URLs are also acceptable URIs. @@ -33,7 +30,7 @@ enum wxURIHostType chance of wxURI "failing" on construction/creation. wxURI supports copy construction and standard assignment operators. wxURI - can also be inherited from to provide furthur functionality. + can also be inherited from to provide further functionality. To obtain individual components you can use one of the GetXXX() methods. However, you should check HasXXX() before calling a get method, which @@ -42,21 +39,20 @@ enum wxURIHostType to a @NULL C string. Example: - @code - //protocol will hold the http protocol (i.e. "http") - wxString protocol; - wxURI myuri("http://mysite.com"); - if( myuri.HasScheme() ) - protocol = myuri.GetScheme(); + // protocol will hold the http protocol (i.e. "http") + wxString protocol; + wxURI myuri("http://mysite.com"); + if( myuri.HasScheme() ) + protocol = myuri.GetScheme(); @endcode @note On URIs with a "file" scheme wxURI does not parse the userinfo, - server, or port portion. This is to keep compatability with + server, or port portion. This is to keep compatibility with wxFileSystem, the old wxURL, and older url specifications. @library{wxbase} - @category{data} + @category{net} @see wxURL */ @@ -67,13 +63,15 @@ public: Creates an empty URI. */ wxURI(); + /** Constructor for quick creation. @param uri URI (Uniform Resource Identifier) to initialize with. */ - wxURI(const wxChar* uri); + wxURI(const wxString& uri); + /** Copies this URI from another URI. @@ -104,13 +102,12 @@ public: /** Creates this URI from the @a uri string. - Returns the position at which parsing stopped (there is no such thing - as an "invalid" wxURI). + Returns @true if this instance was correctly initialized. @param uri String to initialize from. */ - const wxChar* Create(const wxString uri); + bool Create(const wxString& uri); /** Obtains the fragment of this URI. @@ -125,7 +122,7 @@ public: /** Obtains the host type of this URI, which is one of wxURIHostType. */ - const wxURIHostType& GetHostType() const; + wxURIHostType GetHostType() const; /** Returns the password part of the userinfo component of this URI. Note @@ -134,7 +131,7 @@ public: @c "http://:@mysite.com/mypath" */ - const wxString& GetPassword() const; + wxString GetPassword() const; /** Returns the (normalized) path of the URI. @@ -199,7 +196,7 @@ public: @c "http://:@mysite.com/mypath" */ - const wxString& GetUser() const; + wxString GetUser() const; /** Returns the UserInfo component of the URI. @@ -244,7 +241,7 @@ public: /** Returns @true if the User component of the URI exists. */ - bool HasUser() const; + bool HasUserInfo() const; /** Returns @true if a valid [absolute] URI, otherwise this URI is a URI @@ -275,8 +272,7 @@ public: void Resolve(const wxURI& base, int flags = wxURI_STRICT); /** - Translates all escape sequences (normal characters and returns the - result. + Translates all escape sequences (normal characters and returns the result. If you want to unescape an entire wxURI, use BuildUnescapedURI() instead, as it performs some optimizations over this method. @@ -284,7 +280,7 @@ public: @param uri String with escaped characters to convert. */ - wxString Unescape(const wxString& uri); + static wxString Unescape(const wxString& uri); /** Compares this URI to another URI, and returns @true if this URI equals @@ -293,6 +289,6 @@ public: @param uricomp URI to compare to. */ - void operator ==(const wxURI& uricomp); + bool operator==(const wxURI& uricomp) const; };