Added appendTo.
diff --git a/ndn-cpp/encoding/BinaryXMLEncoder.hpp b/ndn-cpp/encoding/BinaryXMLEncoder.hpp
index de00a97..1fd4244 100644
--- a/ndn-cpp/encoding/BinaryXMLEncoder.hpp
+++ b/ndn-cpp/encoding/BinaryXMLEncoder.hpp
@@ -9,6 +9,7 @@
#include <cstdlib>
#include <stdexcept>
+#include <vector>
#include "../c/encoding/BinaryXMLEncoder.h"
namespace ndn {
@@ -44,6 +45,15 @@
*/
struct ndn_BinaryXMLEncoder *getEncoder() { return &base_; }
+ /**
+ * Copy the encoded bytes to the end of the buffer.
+ * @param buffer a vector to receive the copy
+ */
+ void appendTo(std::vector<unsigned char> &buffer)
+ {
+ buffer.insert(buffer.end(), base_.output.array, base_.output.array + base_.offset);
+ }
+
private:
struct ndn_BinaryXMLEncoder base_;
};