|
Revision cc0a570a9262613f7046938be649f27646987cb8, 2.0 KB
(checked in by Antti-Juhani Kaijanaho <antti-juhani@…>, 2 years ago)
|
|
Add support for Atom feeds, and implement a group feed
Partially addresses #8
Signed-off-by: Antti-Juhani Kaijanaho <antti-juhani@…>
|
-
Property mode set to
100644
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | #ifndef GUARD_HTTP_TEMPLATED_RESOURCE_HH |
|---|
| 21 | #define GUARD_HTTP_TEMPLATED_RESOURCE_HH |
|---|
| 22 | |
|---|
| 23 | #include "resource.hh" |
|---|
| 24 | #include "resource_exception.hh" |
|---|
| 25 | |
|---|
| 26 | #include "../tlate/data_model.hh" |
|---|
| 27 | #include "../tlate/tlate.hh" |
|---|
| 28 | #include "../server.hh" |
|---|
| 29 | |
|---|
| 30 | #include <list> |
|---|
| 31 | |
|---|
| 32 | namespace http |
|---|
| 33 | { |
|---|
| 34 | class session; |
|---|
| 35 | class templated_resource : public resource |
|---|
| 36 | { |
|---|
| 37 | std::string rl; |
|---|
| 38 | boost::shared_ptr<tlate::tlate> tl; |
|---|
| 39 | std::list<std::pair<std::string,std::string> > flds; |
|---|
| 40 | |
|---|
| 41 | protected: |
|---|
| 42 | server::conn_cb cb; |
|---|
| 43 | virtual void set_attributes(boost::shared_ptr<request>, |
|---|
| 44 | tlate::data_model::ptr) |
|---|
| 45 | {} |
|---|
| 46 | public: |
|---|
| 47 | templated_resource(server::conn_cb cb, std::string path, |
|---|
| 48 | std::string rl = "200 Ok"); |
|---|
| 49 | virtual ~templated_resource() {} |
|---|
| 50 | |
|---|
| 51 | void add_header(std::string name, std::string body) { |
|---|
| 52 | flds.push_back(std::make_pair(name, body)); |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | boost::shared_ptr<response> operator() |
|---|
| 56 | (boost::shared_ptr<request>, response::factory); |
|---|
| 57 | }; |
|---|
| 58 | } |
|---|
| 59 | |
|---|
| 60 | #endif |
|---|