-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcwapper.hpp
More file actions
48 lines (36 loc) · 1.11 KB
/
Copy pathcwapper.hpp
File metadata and controls
48 lines (36 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef __CWAPPER_HPP
#define __CWAPPER_HPP
#include <cppcms/application.h>
#include <cppcms/applications_pool.h>
#include <cppcms/service.h>
#include <cppcms/http_response.h>
#include <cppcms/http_request.h>
#include <cppcms/url_mapper.h>
#include <cppcms/url_dispatcher.h>
#include <iostream>
#include <cstdint>
#include <boost/algorithm/string.hpp>
#include <map>
#include <vector>
#include <boost/variant.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/property_tree/exceptions.hpp>
namespace cwapper {
typedef std::vector<std::string> stringarray;
typedef boost::variant<std::string, stringarray> parameter;
typedef std::map<std::string, parameter> qstring;
enum contentType { JSON, XML };
struct data {
contentType type;
boost::property_tree::ptree tree;
data(contentType value = JSON) { type = value; };
std::string mimeType() const {
std::string contentTypes[] = { "application/json", "text/xml" };
return contentTypes[this->type];
};
};
class error: std::exception {};
}
#endif