more comments & todos
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20202 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+18
-1
@@ -16,6 +16,7 @@
|
|||||||
#define HANDLE_BESHARE
|
#define HANDLE_BESHARE
|
||||||
//#define HANDLE_IM
|
//#define HANDLE_IM
|
||||||
#define HANDLE_VLC
|
#define HANDLE_VLC
|
||||||
|
#define HANDLE_AUDIO
|
||||||
|
|
||||||
const char *kAppSig = "application/x-vnd.haiku.urlwrapper";
|
const char *kAppSig = "application/x-vnd.haiku.urlwrapper";
|
||||||
const char *kTrackerSig = "application/x-vnd.Be-TRAK";
|
const char *kTrackerSig = "application/x-vnd.Be-TRAK";
|
||||||
@@ -38,7 +39,7 @@ const char *kIMSig = "application/x-vnd.m_eiman.sample_im_client";
|
|||||||
const char *kVLCSig = "application/x-vnd.videolan-vlc";
|
const char *kVLCSig = "application/x-vnd.videolan-vlc";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: make a Url class
|
// TODO: make a public BUrl class for use by apps ?
|
||||||
class Url : public BString {
|
class Url : public BString {
|
||||||
public:
|
public:
|
||||||
Url(const char *url) : BString(url) { fStatus = ParseAndSplit(); };
|
Url(const char *url) : BString(url) { fStatus = ParseAndSplit(); };
|
||||||
@@ -93,8 +94,12 @@ status_t Url::ParseAndSplit()
|
|||||||
if (v < 0)
|
if (v < 0)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
|
||||||
|
// TODO: proto and host should be lowercased.
|
||||||
|
// see http://en.wikipedia.org/wiki/URL_normalization
|
||||||
|
|
||||||
CopyInto(proto, 0, v);
|
CopyInto(proto, 0, v);
|
||||||
CopyInto(left, v + 1, Length() - v);
|
CopyInto(left, v + 1, Length() - v);
|
||||||
|
// TODO: RFC1738 says the // part should indicate the uri follows the u:p@h:p/path convention, so it should be used to check for special cases.
|
||||||
if (left.FindFirst("//") == 0)
|
if (left.FindFirst("//") == 0)
|
||||||
left.RemoveFirst("//");
|
left.RemoveFirst("//");
|
||||||
full = left;
|
full = left;
|
||||||
@@ -131,6 +136,7 @@ status_t Url::ParseAndSplit()
|
|||||||
}
|
}
|
||||||
} else if (proto == "finger") {
|
} else if (proto == "finger") {
|
||||||
// single component implies user
|
// single component implies user
|
||||||
|
// see also: http://www.subir.com/lynx/lynx_help/lynx_url_support.html
|
||||||
user = left;
|
user = left;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -250,6 +256,7 @@ void UrlWrapperApp::ArgvReceived(int32 argc, char **argv)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// see draft: http://tools.ietf.org/wg/secsh/draft-ietf-secsh-scp-sftp-ssh-uri/
|
||||||
if (u.proto == "ssh") {
|
if (u.proto == "ssh") {
|
||||||
BString cmd("ssh ");
|
BString cmd("ssh ");
|
||||||
|
|
||||||
@@ -391,6 +398,10 @@ void UrlWrapperApp::ArgvReceived(int32 argc, char **argv)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HANDLE_AUDIO
|
||||||
|
// TODO
|
||||||
|
#endif
|
||||||
|
|
||||||
// vnc: ?
|
// vnc: ?
|
||||||
// irc: ?
|
// irc: ?
|
||||||
@@ -399,6 +410,12 @@ void UrlWrapperApp::ArgvReceived(int32 argc, char **argv)
|
|||||||
// cvs: ?
|
// cvs: ?
|
||||||
// smb: cifsmount ?
|
// smb: cifsmount ?
|
||||||
// nfs: mount_nfs ?
|
// nfs: mount_nfs ?
|
||||||
|
//
|
||||||
|
// mailto: ? but BeMail & Beam both handle it already (not fully though).
|
||||||
|
//
|
||||||
|
// itps: pcast: podcast: s//http/ + parse xml to get url to mp3 stream...
|
||||||
|
// audio: s//http:/ + default MediaPlayer -- see http://forums.winamp.com/showthread.php?threadid=233130
|
||||||
|
//
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user