\membersection{wxURI::Resolve}\label{wxuriresolve}
-\func{void}{Resolve}{\param{const wxURI\& }{base}, \param{const bool\& }{bStrict = true}}
+\func{void}{Resolve}{\param{const wxURI\& }{base}, \param{int }{flags = \texttt{wxURI\_STRICT}}}
Inherits this URI from a base URI - components that do not
exist in this URI are copied from the base, and if this URI's
"http://mysite.com/john/mydir".
\docparam{base}{Base URI to inherit from. Must be a full URI and not a reference}
-\docparam{bStrict}{If false, some compatability layers are enabled to allow
- loopholes from RFCs prior to 2396}
+\docparam{flags}{Currently either \texttt{wxURI\_STRICT} or $0$, in non strict
+mode some compatability layers are enabled to allow loopholes from RFCs prior
+to 2396}
// Licence: wxWindows
/////////////////////////////////////////////////////////////////////////////
-#ifndef _WX_URIH__
-#define _WX_URIH__
+#ifndef _WX_URI_H_
+#define _WX_URI_H_
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "uri.h"
#include "wx/string.h"
// Host Type that the server can be
-typedef enum
+enum wxURIHostType
{
wxURI_REGNAME,
wxURI_IPV4ADDRESS,
wxURI_IPV6ADDRESS,
wxURI_IPVFUTURE
-} wxURIHostType;
+};
// Component Flags
-typedef enum
+enum wxURIFieldType
{
wxURI_SCHEME = 1,
wxURI_USER = 2,
wxURI_PATH = 16,
wxURI_QUERY = 32,
wxURI_FRAGMENT = 64
-} wxURIFieldType;
+};
+
+// Miscellaneous other flags
+enum wxURIFlags
+{
+ wxURI_STRICT = 1
+};
+
// Generic class for parsing URIs.
//
wxURI(const wxString& uri);
wxURI(const wxURI& uri);
- ~wxURI();
+ virtual ~wxURI();
void Create(const wxString& uri);
wxString Get() const;
- void Resolve(const wxURI& base, const bool& bStrict = true);
+ void Resolve(const wxURI& base, int flags = wxURI_STRICT);
bool IsReference() const;
wxURI& operator = (const wxURI& uri);
const wxChar* ParseUser (const wxChar* uri);
const wxChar* ParseServer (const wxChar* uri);
const wxChar* ParsePort (const wxChar* uri);
- const wxChar* ParsePath (const wxChar* uri, const bool& bReference = false,
- const bool& bNormalize = true);
+ const wxChar* ParsePath (const wxChar* uri,
+ bool bReference = false,
+ bool bNormalize = true);
const wxChar* ParseQuery (const wxChar* uri);
const wxChar* ParseFragment (const wxChar* uri);
static bool ParseIPvFuture(const wxChar*& uri);
- static void Normalize(wxChar* uri, const bool& bIgnoreLeads = false);
+ static void Normalize(wxChar* uri, bool bIgnoreLeads = false);
static void UpTree(const wxChar* uristart, const wxChar*& uri);
- static void Unescape(const wxChar*& s, wxChar& c);
+ static wxChar Unescape(const wxChar* s);
static void Escape (wxString& s, const wxChar& c);
static bool IsEscape(const wxChar*& uri);
size_t m_fields;
DECLARE_DYNAMIC_CLASS(wxURI)
-};//end of wxURI
+};
+
+#endif // _WX_URI_H_
-#endif //_WX_URIH__
// if it does, then it moves the input string past the escape sequence
// ---------------------------------------------------------------------------
-void wxURI::Unescape(const wxChar*& s, wxChar& c)
+wxChar wxURI::Unescape(const wxChar* s)
{
wxASSERT_MSG(IsHex(*s) && IsHex(*(s+1)), wxT("Invalid escape!"));
- c = CharToHex(*s) * 0x10 + CharToHex(*++s);
+
+ return CharToHex(*s) * 0x10 + CharToHex(*++s);
}
void wxURI::Escape(wxString& s, const wxChar& c)
return uri;
}
-const wxChar* wxURI::ParsePath(const wxChar* uri, const bool& bReference, const bool& bNormalize)
+const wxChar* wxURI::ParsePath(const wxChar* uri, bool bReference, bool bNormalize)
{
wxASSERT(uri != NULL);
// (it is shown in comments)
// ---------------------------------------------------------------------------
-void wxURI::Resolve(const wxURI& base, const bool& bStrict)
+void wxURI::Resolve(const wxURI& base, int flags)
{
wxASSERT_MSG(!base.IsReference(),
wxT("wxURI to inherit from must not be a reference!"));
// loophole that allows this uri to inherit other
// properties from the base uri - even if the scheme
// is defined
- if (!bStrict &&
- HasScheme() && base.HasScheme() &&
- this->m_scheme == base.m_scheme )
+ if ( !(flags & wxURI_STRICT) &&
+ HasScheme() && base.HasScheme() &&
+ m_scheme == base.m_scheme )
{
m_fields -= wxURI_SCHEME;
}
//!!!//
}
-void wxURI::Normalize(wxChar* s, const bool& bIgnoreLeads)
+void wxURI::Normalize(wxChar* s, bool bIgnoreLeads)
{
wxChar* cp = s;
wxChar* bp = s;