]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/uri.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxURI - Class for parsing/validating URIs
9 /////////////////////////////////////////////////////////////////////////////
14 #if defined(__GNUG__) && !defined(__APPLE__)
15 #pragma interface "uri.h"
19 #include "wx/object.h"
20 #include "wx/string.h"
22 // Host Type that the server can be
43 // Miscellaneous other flags
50 // Generic class for parsing URIs.
52 // Originally based off of RFC 2396 - then
53 // extended to meet the newer RFC 2396.bis
55 class wxURI
: public wxObject
59 wxURI(const wxString
& uri
);
60 wxURI(const wxURI
& uri
);
64 void Create(const wxString
& uri
);
66 bool HasScheme() const;
68 bool HasServer() const;
71 bool HasQuery() const;
72 bool HasFragment() const;
74 const wxString
& GetScheme() const;
75 const wxString
& GetPath() const;
76 const wxString
& GetQuery() const;
77 const wxString
& GetFragment() const;
78 const wxString
& GetPort() const;
79 const wxString
& GetUser() const;
80 const wxString
& GetServer() const;
81 const wxURIHostType
& GetHostType() const;
85 void Resolve(const wxURI
& base
, int flags
= wxURI_STRICT
);
86 bool IsReference() const;
88 wxURI
& operator = (const wxURI
& uri
);
89 wxURI
& operator = (const wxChar
* string
);
90 bool operator == (const wxURI
& uri
) const;
96 const wxChar
* Parse (const wxChar
* uri
);
97 const wxChar
* ParseAuthority (const wxChar
* uri
);
98 const wxChar
* ParseScheme (const wxChar
* uri
);
99 const wxChar
* ParseUser (const wxChar
* uri
);
100 const wxChar
* ParseServer (const wxChar
* uri
);
101 const wxChar
* ParsePort (const wxChar
* uri
);
102 const wxChar
* ParsePath (const wxChar
* uri
,
103 bool bReference
= false,
104 bool bNormalize
= true);
105 const wxChar
* ParseQuery (const wxChar
* uri
);
106 const wxChar
* ParseFragment (const wxChar
* uri
);
109 static bool ParseH16(const wxChar
*& uri
);
110 static bool ParseIPv4address(const wxChar
*& uri
);
111 static bool ParseIPv6address(const wxChar
*& uri
);
112 static bool ParseIPvFuture(const wxChar
*& uri
);
115 static void Normalize(wxChar
* uri
, bool bIgnoreLeads
= false);
116 static void UpTree(const wxChar
* uristart
, const wxChar
*& uri
);
118 static wxChar
Unescape(const wxChar
* s
);
119 static void Escape (wxString
& s
, const wxChar
& c
);
120 static bool IsEscape(const wxChar
*& uri
);
122 static int CharToHex(const wxChar
& c
);
125 static bool IsUnreserved (const wxChar
& c
);
126 static bool IsReserved (const wxChar
& c
);
127 static bool IsGenDelim (const wxChar
& c
);
128 static bool IsSubDelim (const wxChar
& c
);
129 static bool IsHex(const wxChar
& c
);
130 static bool IsAlpha(const wxChar
& c
);
131 static bool IsDigit(const wxChar
& c
);
142 wxURIHostType m_hostType
;
146 DECLARE_DYNAMIC_CLASS(wxURI
)