21 #ifndef NDN_BINARYXMLENCODER_H
22 #define NDN_BINARYXMLENCODER_H
24 #include <ndn-cpp/c/errors.h>
25 #include "../util/dynamic-uint8-array.h"
26 #include "../util/blob.h"
27 #include "binary-xml.h"
50 self->output = output;
61 ndn_Error ndn_BinaryXmlEncoder_encodeTypeAndValue(
struct ndn_BinaryXmlEncoder *
self,
unsigned int type,
unsigned int value);
69 static __inline ndn_Error ndn_BinaryXmlEncoder_writeElementStartDTag(
struct ndn_BinaryXmlEncoder *
self,
unsigned int tag)
71 return ndn_BinaryXmlEncoder_encodeTypeAndValue(
self, ndn_BinaryXml_DTAG, tag);
106 static __inline ndn_Error ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
110 return ndn_BinaryXmlEncoder_writeBlobDTagElement(
self, tag, value);
112 return NDN_ERROR_success;
140 static __inline ndn_Error ndn_BinaryXmlEncoder_writeOptionalUDataDTagElement
144 return ndn_BinaryXmlEncoder_writeUDataDTagElement(
self, tag, value);
146 return NDN_ERROR_success;
155 ndn_Error ndn_BinaryXmlEncoder_writeUnsignedDecimalInt(
struct ndn_BinaryXmlEncoder *
self,
unsigned int value);
166 ndn_Error ndn_BinaryXmlEncoder_writeUnsignedDecimalIntDTagElement(
struct ndn_BinaryXmlEncoder *
self,
unsigned int tag,
unsigned int value);
175 static __inline ndn_Error ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement(
struct ndn_BinaryXmlEncoder *
self,
unsigned int tag,
int value)
178 return ndn_BinaryXmlEncoder_writeUnsignedDecimalIntDTagElement(
self, tag, (
size_t)value);
180 return NDN_ERROR_success;
190 ndn_Error ndn_BinaryXmlEncoder_writeAbsDoubleBigEndianBlob(
struct ndn_BinaryXmlEncoder *
self,
double value);
201 ndn_Error ndn_BinaryXmlEncoder_writeTimeMillisecondsDTagElement(
struct ndn_BinaryXmlEncoder *
self,
unsigned int tag,
double milliseconds);
210 static __inline ndn_Error ndn_BinaryXmlEncoder_writeOptionalTimeMillisecondsDTagElement
213 if (milliseconds >= 0)
214 return ndn_BinaryXmlEncoder_writeTimeMillisecondsDTagElement(
self, tag, milliseconds);
216 return NDN_ERROR_success;
Copyright (C) 2013-2015 Regents of the University of California.
Definition: binary-xml-encoder.h:36
size_t offset
the offset into output.array for the next encoding
Definition: binary-xml-encoder.h:38
size_t length
the number of bytes in value.
Definition: blob-types.h:35
A struct ndn_DynamicUInt8Array holds a pointer to an allocated array, the length of the allocated arr...
Definition: dynamic-uint8-array-types.h:40
struct ndn_DynamicUInt8Array * output
A pointer to a ndn_DynamicUInt8Array which receives the encoded output.
Definition: binary-xml-encoder.h:37
const uint8_t * value
pointer to the pre-allocated buffer for the value.
Definition: blob-types.h:34
Copyright (C) 2015 Regents of the University of California.
Definition: blob-types.h:33