Added decodeInterest.
diff --git a/ndn-cpp/encoding/BinaryXMLWireFormat.cpp b/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
index e56673b..5789394 100644
--- a/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
+++ b/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
@@ -6,7 +6,8 @@
#include <stdexcept>
#include "../c/encoding/BinaryXMLName.h"
-#include "../Name.hpp"
+#include "../c/encoding/BinaryXMLInterest.h"
+#include "../Interest.hpp"
#include "BinaryXMLEncoder.hpp"
#include "BinaryXMLWireFormat.hpp"
@@ -42,4 +43,17 @@
name.set(nameStruct);
}
+void BinaryXMLWireFormat::decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength)
+{
+ struct ndn_NameComponent components[100];
+ struct ndn_Interest interestStruct;
+ ndn_Interest_init(&interestStruct, components, sizeof(components) / sizeof(components[0]));
+
+ char *error;
+ if (error = ndn_decodeBinaryXMLInterest(&interestStruct, (unsigned char *)input, inputLength))
+ throw std::runtime_error(error);
+
+ interest.set(interestStruct);
+}
+
}