blob: 829e0cc72e6d6d24f007204d05a4903f2c9e5fa1 [file] [log] [blame]
Zhenkai Zhu43eb2732012-12-28 00:48:26 -08001#ifndef CCNX_CONTENT_OBJECT_H
2#define CCNX_CONTENT_OBJECT_H
3
Zhenkai Zhu43eb2732012-12-28 00:48:26 -08004#include "ccnx-wrapper.h"
Zhenkai Zhu974c5a62012-12-28 14:15:30 -08005#include "ccnx-common.h"
Zhenkai Zhu43eb2732012-12-28 00:48:26 -08006
7using namespace std;
8
9namespace Ccnx {
10
11struct MisformedContentObjectException : virtual boost::exception, virtual exception { };
12
Zhenkai Zhu0d8f5d52012-12-30 12:54:07 -080013class ParsedContentObject
Zhenkai Zhu43eb2732012-12-28 00:48:26 -080014{
15public:
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 Zhubad089c2012-12-28 10:28:27 -080022 content() const;
Zhenkai Zhu43eb2732012-12-28 00:48:26 -080023
24 string
Zhenkai Zhubad089c2012-12-28 10:28:27 -080025 name() const;
Zhenkai Zhu43eb2732012-12-28 00:48:26 -080026
27protected:
28 ccn_parsed_ContentObject m_pco;
29 ccn_indexbuf *m_comps;
30 Bytes m_bytes;
31};
32
33typedef boost::shared_ptr<ParsedContentObject> PcoPtr;
34
35}
36
37#endif // CCNX_CONTENT_OBJECT_H