Zhenkai Zhu | 43eb273 | 2012-12-28 00:48:26 -0800 | [diff] [blame^] | 1 | #ifndef CCNX_CONTENT_OBJECT_H |
| 2 | #define CCNX_CONTENT_OBJECT_H |
| 3 | |
| 4 | #include <boost/exception/all.hpp> |
| 5 | #include <boost/shared_ptr.hpp> |
| 6 | #include "ccnx-wrapper.h" |
| 7 | |
| 8 | using namespace std; |
| 9 | |
| 10 | namespace Ccnx { |
| 11 | |
| 12 | struct MisformedContentObjectException : virtual boost::exception, virtual exception { }; |
| 13 | |
| 14 | class ParsedContentObject |
| 15 | { |
| 16 | public: |
| 17 | ParsedContentObject(const unsigned char *data, size_t len); |
| 18 | ParsedContentObject(const Bytes &bytes); |
| 19 | ParsedContentObject(const ParsedContentObject &other); |
| 20 | virtual ~ParsedContentObject(); |
| 21 | |
| 22 | Bytes |
| 23 | content(); |
| 24 | |
| 25 | string |
| 26 | name(); |
| 27 | |
| 28 | protected: |
| 29 | ccn_parsed_ContentObject m_pco; |
| 30 | ccn_indexbuf *m_comps; |
| 31 | Bytes m_bytes; |
| 32 | }; |
| 33 | |
| 34 | typedef boost::shared_ptr<ParsedContentObject> PcoPtr; |
| 35 | |
| 36 | } |
| 37 | |
| 38 | #endif // CCNX_CONTENT_OBJECT_H |