]> git.tdb.fi Git - libs/net.git/blob - source/utils.h
Use maputils.h
[libs/net.git] / source / utils.h
1 #ifndef MSP_HTTP_UTILS_H_
2 #define MSP_HTTP_UTILS_H_
3
4 #include <map>
5 #include <string>
6
7 namespace Msp {
8 namespace Http {
9
10 enum EncodeLevel
11 {
12         MINIMAL,
13         SAFE,
14         PARANOID
15 };
16
17 struct Url
18 {
19         std::string scheme;
20         std::string host;
21         std::string path;
22         std::string query;
23         std::string fragment;
24 };
25
26 typedef std::map<std::string, std::string> Query;
27
28 std::string urlencode(const std::string &, EncodeLevel =SAFE);
29 std::string urlencode_plus(const std::string &, EncodeLevel =SAFE);
30 std::string urldecode(const std::string &);
31 Url parse_url(const std::string &);
32 std::string build_url(const Url &);
33 Query parse_query(const std::string &);
34 std::string build_query(const Query &);
35
36 } // namespace Http
37 } // namespace Msp
38
39 #endif