]> git.tdb.fi Git - libs/net.git/blob - source/utils.h
Style update: spaces around assignments
[libs/net.git] / source / utils.h
1 /* $Id$
2
3 This file is part of libmsphttp
4 Copyright © 2009  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_HTTP_UTILS_H_
9 #define MSP_HTTP_UTILS_H_
10
11 #include <map>
12 #include <string>
13
14 namespace Msp {
15 namespace Http {
16
17 enum EncodeLevel
18 {
19         MINIMAL,
20         SAFE,
21         PARANOID
22 };
23
24 struct Url
25 {
26         std::string scheme;
27         std::string host;
28         std::string path;
29         std::string query;
30         std::string fragment;
31 };
32
33 typedef std::map<std::string, std::string> Query;
34
35 std::string urlencode(const std::string &, EncodeLevel =SAFE);
36 std::string urlencode_plus(const std::string &, EncodeLevel =SAFE);
37 std::string urldecode(const std::string &);
38 Url parse_url(const std::string &);
39 std::string build_url(const Url &);
40 Query parse_query(const std::string &);
41 std::string build_query(const Query &);
42
43 } // namespace Http
44 } // namespace Msp
45
46 #endif