-
Notifications
You must be signed in to change notification settings - Fork 0
/
Url.h
49 lines (37 loc) · 980 Bytes
/
Url.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* mp3stream - encode /dev/dsp and send it to a shoutcast server
* 2005 - bl0rg.net - public domain
*
* Url.h - url abstraction
*/
#ifndef URL_H__
#define URL_H__
#include <string>
#include "Error.h"
class UrlError : public Error {
public:
UrlError(std::string msg) : Error(msg) { }
virtual ~UrlError() { }
};
class Url {
protected:
std::string protocol;
std::string login;
std::string password;
std::string host;
unsigned short port;
std::string path;
protected:
void parseAuthString(const std::string &str);
void parseLocationString(const std::string &str);
public:
Url(const std::string &string);
~Url();
std::string getProtocol() const { return protocol; }
std::string getLogin() const { return login; }
std::string getPassword() const { return password; }
std::string getHost() const { return host; }
unsigned short getPort() const { return port; }
std::string getPath() const { return path; }
};
#endif /* URL_H__ */