Added class BinaryXMLDecoder
diff --git a/ndn-cpp/encoding/BinaryXMLWireFormat.cpp b/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
index df5ad35..6899924 100644
--- a/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
+++ b/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
@@ -10,7 +10,7 @@
#include "../Interest.hpp"
#include "../ContentObject.hpp"
#include "BinaryXMLEncoder.hpp"
-#include "../c/encoding/BinaryXMLDecoder.h"
+#include "BinaryXMLDecoder.hpp"
#include "BinaryXMLWireFormat.hpp"
using namespace std;
@@ -38,9 +38,7 @@
struct ndn_Name nameStruct;
ndn_Name_init(&nameStruct, components, sizeof(components) / sizeof(components[0]));
- struct ndn_BinaryXMLDecoder decoder;
- ndn_BinaryXMLDecoder_init(&decoder, (unsigned char *)input, inputLength);
-
+ BinaryXMLDecoder decoder(input, inputLength);
ndn_Error error;
if (error = ndn_decodeBinaryXMLName(&nameStruct, &decoder))
throw std::runtime_error(ndn_getErrorString(error));
@@ -73,9 +71,7 @@
(&interestStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]),
excludeEntries, sizeof(excludeEntries) / sizeof(excludeEntries[0]));
- struct ndn_BinaryXMLDecoder decoder;
- ndn_BinaryXMLDecoder_init(&decoder, (unsigned char *)input, inputLength);
-
+ BinaryXMLDecoder decoder(input, inputLength);
ndn_Error error;
if (error = ndn_decodeBinaryXMLInterest(&interestStruct, &decoder))
throw std::runtime_error(ndn_getErrorString(error));
@@ -104,9 +100,7 @@
ndn_ContentObject_init
(&contentObjectStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]));
- struct ndn_BinaryXMLDecoder decoder;
- ndn_BinaryXMLDecoder_init(&decoder, (unsigned char *)input, inputLength);
-
+ BinaryXMLDecoder decoder(input, inputLength);
ndn_Error error;
if (error = ndn_decodeBinaryXMLContentObject(&contentObjectStruct, &decoder))
throw std::runtime_error(ndn_getErrorString(error));