SPTK Home Page
sptk5
net
URL.h
1
/*
2
╔══════════════════════════════════════════════════════════════════════════════╗
3
║ SIMPLY POWERFUL TOOLKIT (SPTK) ║
4
╟──────────────────────────────────────────────────────────────────────────────╢
5
║ copyright © 1999-2022 Alexey Parshin. All rights reserved. ║
6
║ email alexeyp@gmail.com ║
7
╚══════════════════════════════════════════════════════════════════════════════╝
8
┌──────────────────────────────────────────────────────────────────────────────┐
9
│ This library is free software; you can redistribute it and/or modify it │
10
│ under the terms of the GNU Library General Public License as published by │
11
│ the Free Software Foundation; either version 2 of the License, or (at your │
12
│ option) any later version. │
13
│ │
14
│ This library is distributed in the hope that it will be useful, but │
15
│ WITHOUT ANY WARRANTY; without even the implied warranty of │
16
│ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library │
17
│ General Public License for more details. │
18
│ │
19
│ You should have received a copy of the GNU Library General Public License │
20
│ along with this library; if not, write to the Free Software Foundation, │
21
│ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. │
22
│ │
23
│ Please report all bugs and problems to alexeyp@gmail.com. │
24
└──────────────────────────────────────────────────────────────────────────────┘
25
*/
26
27
#pragma once
28
29
#include <sptk5/net/HttpParams.h>
30
31
namespace
sptk {
32
33
class
SP_EXPORT
URL
34
{
35
public
:
36
explicit
URL
(
const
String
& url);
37
URL
(
String
protocol,
String
path,
const
HttpParams
& params);
38
URL
(
const
URL
& other) =
default
;
39
40
HttpParams
& params()
41
{
42
return
m_params;
43
}
44
const
HttpParams
& params()
const
45
{
46
return
m_params;
47
}
48
String
protocol()
const
49
{
50
return
m_protocol;
51
}
52
String
username()
const
53
{
54
return
m_username;
55
}
56
String
password()
const
57
{
58
return
m_password;
59
}
60
String
hostAndPort()
const
61
{
62
return
m_hostAndPort;
63
}
64
String
path()
const
65
{
66
return
m_path;
67
}
68
String
location()
const
;
69
String
toString()
const
;
70
71
void
path(
const
String
& path)
72
{
73
m_path = path;
74
}
75
76
private
:
77
String
m_protocol;
78
String
m_username;
79
String
m_password;
80
String
m_hostAndPort;
81
String
m_path;
82
HttpParams
m_params;
83
};
84
85
}
// namespace sptk
sptk::HttpParams
Definition:
HttpParams.h:69
sptk::String
Definition:
String.h:49
sptk::URL
Definition:
URL.h:34
Fri Oct 14 2022 09:58:32: SPTK 5.4.1