Jeff Thompson | aa4e6db | 2013-07-15 17:25:23 -0700 | [diff] [blame] | 1 | /** |
| 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 | |
| 11 | namespace ndn { |
| 12 | |
| 13 | void 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 | } |