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