Coconut Data Framework  beta
Functions
CNBinaryData.h File Reference

Define coder function for binary data. More...

#include <CoconutXML/CoconutXML.h>
#include <libxml/tree.h>

Go to the source code of this file.

Functions

xmlNodePtr CNEncodeBinaryData (const xmlChar *elmname, size_t srcsize, const void *srcdata)
 Encode binary data into XML node.
CNBoolean CNDecodeBinaryData (struct CNBuffer *dst, xmlNodePtr src, const xmlChar *elmname, struct CNXMLDecodeError *error)
 Decode XML node and get binary data.

Detailed Description

Define coder function for binary data.

Copyright
Copyright (C) 2012 Steel Wheels Project

Function Documentation

xmlNodePtr CNEncodeBinaryData ( const xmlChar *  elmname,
size_t  srcsize,
const void *  srcdata 
)

Encode binary data into XML node.

Returns:
Encoded node
Parameters:
elmnameElement name for the XML node
srcsizeSize of source data
srcdataSource data
Note
Base64 is used to encode binary data
Note
Use CNDecodeBinaryData() function as decoder
CNBoolean CNDecodeBinaryData ( struct CNBuffer *  dst,
xmlNodePtr  src,
const xmlChar *  elmname,
struct CNXMLDecodeError *  error 
)

Decode XML node and get binary data.

Return values:
TRUEDecode succeeded
FALSEDecode failed
Parameters:
dstDestination buffer to store decode result
srcSource XML node
elmnameElement name for the XML node
errorError information. This is set when the returned value is CNFalse.