1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2007 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
18 enum UriToStringFlags
{
19 UriHidePasswd
= 1 << 0,
20 UriHideFragment
= 1 << 1,
21 UriHideQuery
= 1 << 2,
26 /* @Namespace=System */
34 /* @GenerateCBinding,GeneratePInvoke */
35 bool Parse (const char *uri
, bool allow_trailing_sep
= false);
36 void Combine (const char *relative_path
);
37 void Combine (const Uri
*relative_uri
);
39 /* @GenerateCBinding,GeneratePInvoke */
42 char *ToString (UriToStringFlags flags
) const;
43 char *ToString () const { return ToString ((UriToStringFlags
) 0); }
45 static void Copy (const Uri
*from
, Uri
*to
);
47 bool operator== (const Uri
&v
) const;
49 /* @GenerateCBinding */
50 static bool Equals (const Uri
*left
, const Uri
*right
);
51 static bool IsNullOrEmpty (const Uri
*uri
);
52 static bool SameSiteOfOrigin (const Uri
*left
, const Uri
*right
);
54 /* @GenerateCBinding */
57 bool IsScheme (const char *scheme
) const;
58 bool IsAbsolute () const { return isAbsolute
; }
60 bool IsInvalidPath () { return path
&& (path
[0] == '.' || path
[0] == '\\') && path
[1] == '\\'; }
61 bool IsUncPath () { return path
&& path
[0] == '\\' && path
[1] == '\\'; }
63 const char *GetScheme () const { return scheme
; }
64 const char *GetHost () const { return host
; }
65 int GetPort () const { return port
; }
66 const char *GetUser () const { return user
; }
67 const char *GetAuth () const { return auth
; }
68 const char *GetPasswd () const { return passwd
; }
69 const char *GetFragment () const { return fragment
; }
70 const char *GetPath () const { return path
; }
71 const char *GetQuery () const { return query
; }
95 #endif /* __URI_H__ */