dmlite
0.6
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
dmlite
cpp
utils
urls.h
Go to the documentation of this file.
1
/// @file include/dmlite/cpp/utils/urls.h
2
/// @brief Common methods and functions for URL and path.
3
/// @author Alejandro Álvarez Ayllón <aalvarez@cern.ch>
4
#ifndef DMLITE_CPP_UTILS_URLS_H
5
#define DMLITE_CPP_UTILS_URLS_H
6
7
#include <string>
8
#include <vector>
9
#include "
extensible.h
"
10
11
namespace
dmlite {
12
13
struct
Url
{
14
std::string
scheme
;
15
std::string
domain
;
16
unsigned
port
;
17
std::string
path
;
18
Extensible
query
;
19
20
Url
() throw();
21
explicit
Url
(const std::
string
& url) throw ();
22
Url
(const
Url
& _u);
23
24
// Operators
25
bool
operator == (const
Url
&) const;
26
bool
operator != (const
Url
&) const;
27
bool
operator < (const
Url
&) const;
28
bool
operator > (const
Url
&) const;
29
30
Url
& operator = (const
Url
& _u);
31
32
std::
string
queryToString
(
void
) const;
33
void
queryFromString
(const std::
string
& str);
34
35
36
std::
string
toString
(
void
) const;
37
38
/// Split a path into a list of components.
39
/// @param path The path to split.
40
/// @return A list with the extracted components.
41
static std::vector<std::
string
>
splitPath
(const std::
string
&
path
) throw ();
42
43
/// Build a path from a list of components
44
static std::
string
joinPath
(const std::vector<std::
string
>& components) throw();
45
46
/// Remove multiple slashes.
47
static std::
string
normalizePath
(const std::
string
&
path
, const
bool
add_trailing_slash = true) throw ();
48
49
};
50
};
51
52
#endif // DMLITE_CPP_UTILS_URLS_H
Generated on Tue Nov 18 2014 16:48:49 for dmlite by
1.8.3.1