blob: ba47698d643718985b57ce71678faee28b016745 [file] [log] [blame]
Jeff Thompsonaa4e6db2013-07-15 17:25:23 -07001/**
2 * @author: Jeff Thompson
3 * See COPYING for copyright and distribution information.
4 */
5
6#include "encoding/BinaryXMLDecoder.hpp"
7#include "c/encoding/BinaryXML.h"
8#include "ContentObject.hpp"
9#include "NDN.hpp"
10
11namespace ndn {
12
13void NDN::onReceivedElement(unsigned char *element, unsigned int elementLength)
14{
15 BinaryXMLDecoder decoder(element, elementLength);
16
17 if (decoder.peekDTag(ndn_BinaryXML_DTag_ContentObject)) {
18 ContentObject contentObject;
19 contentObject.decode(element, elementLength);
20
21#if 0
22 cout << "Got content with name " << contentObject.getName().to_uri() << endl;
23 for (unsigned int i = 0; i < contentObject.getContent().size(); ++i)
24 cout << contentObject.getContent()[i];
25 cout << endl;
26#endif
27 }
28}
29
30}