Added writeUnsignedDecimalIntDTagElement
diff --git a/ndn-cpp/c/encoding/BinaryXMLEncoder.c b/ndn-cpp/c/encoding/BinaryXMLEncoder.c
index 049cc44..a618abf 100644
--- a/ndn-cpp/c/encoding/BinaryXMLEncoder.c
+++ b/ndn-cpp/c/encoding/BinaryXMLEncoder.c
@@ -200,6 +200,7 @@
return error;
// Don't use memcpy to shift because its behavior is not guaranteed when the buffers overlap.
+ // We are shifting forward, so start from the end of the buffer.
unsigned char *source = self->output.array + startOffset + nIntegerBytes - 1;
unsigned char *dest = source + nHeaderBytes;
unsigned char *sourceFinal = self->output.array + startOffset;
@@ -215,3 +216,18 @@
return 0;
}
+
+ndn_Error ndn_BinaryXMLEncoder_writeUnsignedDecimalIntDTagElement(struct ndn_BinaryXMLEncoder *self, unsigned int tag, unsigned int value)
+{
+ ndn_Error error;
+ if (error = ndn_BinaryXMLEncoder_writeElementStartDTag(self, tag))
+ return error;
+
+ if (error = ndn_BinaryXMLEncoder_writeUnsignedDecimalInt(self, value))
+ return error;
+
+ if (error = ndn_BinaryXMLEncoder_writeElementClose(self))
+ return error;
+
+ return 0;
+}