openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
uri.h
Go to the documentation of this file.
1
#ifndef __network_uri_h
2
#define __network_uri_h
3
4
#include <ctype.h>
5
6
#include <string>
7
#include <map>
8
9
/*
10
* URI parser based on http://draft.scyphus.co.jp/lang/c/url_parser.html
11
*/
12
13
class
URI
14
{
15
private
:
16
bool
m_valid;
17
std::string m_url;
18
std::string m_scheme;
19
std::string m_host;
20
std::string m_port;
21
std::string m_path;
22
std::string m_query;
23
std::string m_fragment;
24
std::string m_username;
25
std::string m_password;
26
std::map<std::string,std::string> m_parameters;
27
/*
28
* Check whether the character is permitted in scheme string
29
*/
30
static
inline
int
is_scheme_char(
int
c)
31
{
32
return
(!isalpha(c) &&
'+'
!= c &&
'-'
!= c &&
'.'
!= c) ? 0 : 1;
33
};
34
public
:
35
URI
();
36
URI
(
const
std::string &);
37
bool
Parse
(
const
std::string &);
38
bool
Valid
() {
return
m_valid; };
39
std::string
Scheme
() {
return
m_scheme; };
40
std::string
Host
() {
return
m_host; };
41
std::string
Port
() {
return
m_port; };
42
std::string
Path
() {
return
m_path; };
43
std::string
Query
() {
return
m_query; };
44
std::string
Fragment
() {
return
m_fragment; };
45
std::string
Username
() {
return
m_username; };
46
std::string
Password
() {
return
m_password; };
47
std::string
Query
(
const
std::string &);
48
};
49
50
#endif
/* __network_uri_h */
URI
Definition:
uri.h:14
URI::Parse
bool Parse(const std::string &)
Definition:
uri.cpp:19
URI::Host
std::string Host()
Definition:
uri.h:40
URI::Path
std::string Path()
Definition:
uri.h:42
URI::Fragment
std::string Fragment()
Definition:
uri.h:44
URI::Password
std::string Password()
Definition:
uri.h:46
URI::Valid
bool Valid()
Definition:
uri.h:38
URI::Port
std::string Port()
Definition:
uri.h:41
URI::Username
std::string Username()
Definition:
uri.h:45
URI::Query
std::string Query()
Definition:
uri.h:43
URI::Scheme
std::string Scheme()
Definition:
uri.h:39
URI::URI
URI()
Definition:
uri.cpp:9
lib
network
uri.h
Generated by
1.9.1