Make decode take unsigned char *input, unsigned int inputLength
diff --git a/ndn-cpp/Name.hpp b/ndn-cpp/Name.hpp
index 7346df4..1faba76 100644
--- a/ndn-cpp/Name.hpp
+++ b/ndn-cpp/Name.hpp
@@ -24,11 +24,11 @@
void encode(std::vector<unsigned char> &output) {
encode(output, BinaryXMLWireFormat::instance());
}
- void decode(std::vector<unsigned char> &input, WireFormat &wireFormat) {
- wireFormat.decodeName(*this, input);
+ void decode(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat) {
+ wireFormat.decodeName(*this, input, inputLength);
}
- void decode(std::vector<unsigned char> &input) {
- decode(input, BinaryXMLWireFormat::instance());
+ void decode(const unsigned char *input, unsigned int inputLength) {
+ decode(input, inputLength, BinaryXMLWireFormat::instance());
}
private:
diff --git a/ndn-cpp/encoding/BinaryXMLWireFormat.hpp b/ndn-cpp/encoding/BinaryXMLWireFormat.hpp
index f8cf1eb..c757103 100644
--- a/ndn-cpp/encoding/BinaryXMLWireFormat.hpp
+++ b/ndn-cpp/encoding/BinaryXMLWireFormat.hpp
@@ -15,10 +15,10 @@
class BinaryXMLWireFormat : public WireFormat {
public:
virtual void encodeName(Name &name, std::vector<unsigned char> &output);
- virtual void decodeName(Name &name, std::vector<unsigned char> &input);
+ virtual void decodeName(Name &name, const unsigned char *input, unsigned int inputLength);
virtual void encodeInterest(Interest &interest, std::vector<unsigned char> &output);
- virtual void decodeInterest(Interest &interest, std::vector<unsigned char> &input);
+ virtual void decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength);
static BinaryXMLWireFormat &instance() { return instance_; }
diff --git a/ndn-cpp/encoding/WireFormat.cpp b/ndn-cpp/encoding/WireFormat.cpp
index a66abb0..f9694f5 100644
--- a/ndn-cpp/encoding/WireFormat.cpp
+++ b/ndn-cpp/encoding/WireFormat.cpp
@@ -15,7 +15,7 @@
{
throw logic_error("unimplemented");
}
-void WireFormat::decodeName(Name &name, vector<unsigned char> &input)
+void WireFormat::decodeName(Name &name, const unsigned char *input, unsigned int inputLength)
{
throw logic_error("unimplemented");
}
@@ -24,7 +24,7 @@
{
throw logic_error("unimplemented");
}
-void WireFormat::decodeInterest(Interest &interest, vector<unsigned char> &input)
+void WireFormat::decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength)
{
throw logic_error("unimplemented");
}
diff --git a/ndn-cpp/encoding/WireFormat.hpp b/ndn-cpp/encoding/WireFormat.hpp
index 2c90c1b..2e56a2e 100644
--- a/ndn-cpp/encoding/WireFormat.hpp
+++ b/ndn-cpp/encoding/WireFormat.hpp
@@ -18,10 +18,10 @@
class WireFormat {
public:
virtual void encodeName(Name &name, std::vector<unsigned char> &output);
- virtual void decodeName(Name &name, std::vector<unsigned char> &input);
+ virtual void decodeName(Name &name, const unsigned char *input, unsigned int inputLength);
virtual void encodeInterest(Interest &interest, std::vector<unsigned char> &output);
- virtual void decodeInterest(Interest &interest, std::vector<unsigned char> &input);
+ virtual void decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength);
// etc. for each type of object.
};