|
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_TLATE_VALUE_HH |
|---|
| 21 | #define GUARD_TLATE_VALUE_HH |
|---|
| 22 | |
|---|
| 23 | #include <boost/shared_ptr.hpp> |
|---|
| 24 | #include <string> |
|---|
| 25 | #include <sstream> |
|---|
| 26 | |
|---|
| 27 | namespace tlate |
|---|
| 28 | { |
|---|
| 29 | class sequential_value; |
|---|
| 30 | class value |
|---|
| 31 | { |
|---|
| 32 | protected: |
|---|
| 33 | value() {} |
|---|
| 34 | value(const value &) {} |
|---|
| 35 | value &operator=(const value &); |
|---|
| 36 | public: |
|---|
| 37 | typedef boost::shared_ptr<value> ptr; |
|---|
| 38 | typedef boost::shared_ptr<const value> const_ptr; |
|---|
| 39 | |
|---|
| 40 | virtual ~value() {} |
|---|
| 41 | virtual bool is_missing() const { return false; } |
|---|
| 42 | virtual |
|---|
| 43 | value::const_ptr call(boost::shared_ptr<sequential_value>, |
|---|
| 44 | std::string , int ) |
|---|
| 45 | const { |
|---|
| 46 | return value::ptr(); |
|---|
| 47 | } |
|---|
| 48 | virtual void print(std::ostream &) const = 0; |
|---|
| 49 | std::string to_string() const { |
|---|
| 50 | std::ostringstream ss; |
|---|
| 51 | print(ss); |
|---|
| 52 | return ss.str(); |
|---|
| 53 | } |
|---|
| 54 | }; |
|---|
| 55 | |
|---|
| 56 | inline std::ostream &operator<<(std::ostream &os, value::const_ptr v) |
|---|
| 57 | { |
|---|
| 58 | if (v) v->print(os); |
|---|
| 59 | return os; |
|---|
| 60 | } |
|---|
| 61 | } |
|---|
| 62 | |
|---|
| 63 | #endif |
|---|