Added decode that takes a vector &
diff --git a/ndn-cpp/Name.hpp b/ndn-cpp/Name.hpp
index 3ec6511..48dd706 100644
--- a/ndn-cpp/Name.hpp
+++ b/ndn-cpp/Name.hpp
@@ -44,18 +44,30 @@
}
Name(const char *uri);
- void encode(std::vector<unsigned char> &output, WireFormat &wireFormat) {
+ void encode(std::vector<unsigned char> &output, WireFormat &wireFormat)
+ {
wireFormat.encodeName(*this, output);
}
- void encode(std::vector<unsigned char> &output) {
+ void encode(std::vector<unsigned char> &output)
+ {
encode(output, BinaryXMLWireFormat::instance());
}
- void decode(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat) {
+ void decode(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat)
+ {
wireFormat.decodeName(*this, input, inputLength);
}
- void decode(const unsigned char *input, unsigned int inputLength) {
+ void decode(const unsigned char *input, unsigned int inputLength)
+ {
decode(input, inputLength, BinaryXMLWireFormat::instance());
}
+ void decode(const std::vector<unsigned char> &input, WireFormat &wireFormat)
+ {
+ decode(&input[0], input.size(), wireFormat);
+ }
+ void decode(const std::vector<unsigned char> &input)
+ {
+ decode(&input[0], input.size());
+ }
/**
* Set the nameStruct to point to the components in this name, without copying any memory.