Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

WBXML Encoder
[WBXML Library]


Files

file  wbxml_encoder.c
 WBXML Encoder - Encodes a WBXML Tree to WBXML or to XML.

file  wbxml_encoder.h
 WBXML Encoder - Encodes a WBXML Tree to WBXML or to XML.


Defines

#define wbxml_encoder_create()   wbxml_mem_cleam(wbxml_encoder_create_real())

Typedefs

typedef WBXMLEncoder_s WBXMLEncoder
 WBXML Encoder.

typedef enum WBXMLEncoderXMLGenType_e WBXMLEncoderXMLGenType
 Type of XML Generation.


Enumerations

enum  WBXMLEncoderXMLGenType_e { WBXML_ENCODER_XML_GEN_COMPACT = 0, WBXML_ENCODER_XML_GEN_INDENT, WBXML_ENCODER_XML_GEN_CANONICAL }
 Type of XML Generation. More...


Functions

WBXMLEncoderwbxml_encoder_create_real (void)
 Create a WBXML Encoder
Returns:
Return the newly created WBXMLEncoder, or NULL if not enough memory.


void wbxml_encoder_destroy (WBXMLEncoder *encoder)
 Destroy a WBXML Encoder.

void wbxml_encoder_set_ignore_empty_text (WBXMLEncoder *encoder, WB_BOOL set_ignore)
 Set the WBXML Encoder to ignore empty texts (ie: ignorable Whitespaces) [Default: FALSE].

void wbxml_encoder_set_remove_text_blanks (WBXMLEncoder *encoder, WB_BOOL set_remove)
 Set the WBXML Encoder to remove leading and trailing blanks in texts [Default: FALSE].

void wbxml_encoder_set_use_strtbl (WBXMLEncoder *encoder, WB_BOOL use_strtbl)
 Set if we use String Table when Encoding into WBXML [Default: TRUE].

void wbxml_encoder_set_wbxml_version (WBXMLEncoder *encoder, WBXMLVersion version)
 Set the WBXML Version of the output document, when generating WBXML [Default: 'WBXML_VERSION_TOKEN_13' (1.3)].

void wbxml_encoder_set_xml_gen_type (WBXMLEncoder *encoder, WBXMLEncoderXMLGenType gen_type)
 Set the WBXML Encoder XML Generation Type, when generating XML [Default: WBXML_ENCODER_XML_GEN_COMPACT].

void wbxml_encoder_set_indent (WBXMLEncoder *encoder, WB_UTINY indent)
 Set the WBXML Encoder indent, when generating XML in WBXML_ENCODER_XML_GEN_INDENT mode [Default: 0].

void wbxml_encoder_set_tree (WBXMLEncoder *encoder, WBXMLTree *tree)
 Set the WBXML Tree to encode.

WBXMLError wbxml_encoder_encode_to_wbxml (WBXMLEncoder *encoder, WB_UTINY **wbxml, WB_ULONG *wbxml_len)
 Encode a WBXML Tree to WBXML.

WBXMLError wbxml_encoder_encode_to_xml (WBXMLEncoder *encoder, WB_UTINY **xml)
 Encode a WBXML Tree to XML.


Define Documentation

 
#define wbxml_encoder_create      wbxml_mem_cleam(wbxml_encoder_create_real())
 

Definition at line 70 of file wbxml_encoder.h.

Referenced by wbxml_conv_wbxml2xml(), and wbxml_conv_xml2wbxml().


Typedef Documentation

typedef struct WBXMLEncoder_s WBXMLEncoder
 

WBXML Encoder.

Definition at line 49 of file wbxml_encoder.h.

typedef enum WBXMLEncoderXMLGenType_e WBXMLEncoderXMLGenType
 

Type of XML Generation.

Note:
Canonical Form is defined here: http://www.jclark.com/xml/canonxml.html

Referenced by wbxml_encoder_set_xml_gen_type().


Enumeration Type Documentation

enum WBXMLEncoderXMLGenType_e
 

Type of XML Generation.

Note:
Canonical Form is defined here: http://www.jclark.com/xml/canonxml.html
Enumeration values:
WBXML_ENCODER_XML_GEN_COMPACT  Compact XML generation
WBXML_ENCODER_XML_GEN_INDENT  Indented XML generation
WBXML_ENCODER_XML_GEN_CANONICAL  Canonical XML generation

Definition at line 55 of file wbxml_encoder.h.


Function Documentation

WBXMLEncoder* wbxml_encoder_create_real void   
 

Create a WBXML Encoder

Returns:
Return the newly created WBXMLEncoder, or NULL if not enough memory.

Warning:
Do NOT use this function directly, use wbxml_encoder_create() macro instead

Definition at line 306 of file wbxml_encoder.c.

References WBXMLEncoder_s::attrCodePage, WBXMLEncoder_s::current_attr, WBXMLEncoder_s::current_tag, FALSE, WBXMLEncoder_s::ignore_empty_text, WBXMLEncoder_s::in_content, WBXMLEncoder_s::indent, WBXMLEncoder_s::indent_delta, NULL, WBXMLEncoder_s::output, WBXMLEncoder_s::output_type, WBXMLEncoder_s::remove_text_blanks, WBXMLEncoder_s::tagCodePage, WBXMLEncoder_s::tree, TRUE, WBXML_ENCODER_OUTPUT_WBXML, WBXML_ENCODER_XML_GEN_COMPACT, wbxml_free(), wbxml_list_create, wbxml_malloc(), WBXMLEncoder_s::wbxml_version, WBXML_VERSION_13, WBXMLEncoder_s::xml_encode_header, and WBXMLEncoder_s::xml_gen_type.

void wbxml_encoder_destroy WBXMLEncoder   encoder
 

Destroy a WBXML Encoder.

Parameters:
encoder The WBXMLEncoder to free

Definition at line 352 of file wbxml_encoder.c.

References NULL, WBXMLEncoder_s::output, wbxml_buffer_destroy(), wbxml_free(), and wbxml_list_destroy().

Referenced by wbxml_conv_wbxml2xml(), wbxml_conv_xml2wbxml(), wbxml_encoder_encode_to_wbxml(), and wbxml_encoder_encode_to_xml().

WBXMLError wbxml_encoder_encode_to_wbxml WBXMLEncoder   encoder,
WB_UTINY **    wbxml,
WB_ULONG *    wbxml_len
 

Encode a WBXML Tree to WBXML.

Parameters:
encoder [in] The WBXML Encoder to use
wbxml [out] Resulting WBXML document
wbxml_len [out] The resulting WBXML document length
Returns:
Return WBXML_OK if no error, an error code otherwise
Warning:
The 'encoder->tree' WBXMLLib Tree MUST be already set with a call to wbxml_encoder_set_tree() function

Referenced by wbxml_conv_xml2wbxml().

WBXMLError wbxml_encoder_encode_to_xml WBXMLEncoder   encoder,
WB_UTINY **    xml
 

Encode a WBXML Tree to XML.

Parameters:
encoder [in] The WBXML Encoder to use
xml [out] Resulting XML document
Returns:
Return WBXML_OK if no error, an error code otherwise
Warning:
The 'encoder->tree' WBXMLLib Tree MUST be already set with a call to wbxml_encoder_set_tree() function

Referenced by wbxml_conv_wbxml2xml().

void wbxml_encoder_set_ignore_empty_text WBXMLEncoder   encoder,
WB_BOOL    set_ignore
 

Set the WBXML Encoder to ignore empty texts (ie: ignorable Whitespaces) [Default: FALSE].

Parameters:
encoder [in] The WBXML Encoder to use
set_ignore [in] TRUE if ignore, FALSE otherwise
Warning:
This behaviour can me overriden by the WBXML_ENCODER_XML_GEN_CANONICAL mode (set by wbxml_encoder_set_xml_gen_type())

Referenced by wbxml_conv_wbxml2xml(), and wbxml_conv_xml2wbxml().

void wbxml_encoder_set_indent WBXMLEncoder   encoder,
WB_UTINY    indent
 

Set the WBXML Encoder indent, when generating XML in WBXML_ENCODER_XML_GEN_INDENT mode [Default: 0].

Parameters:
encoder [in] The WBXML Encoder
indent [in] If 'WBXML_ENCODER_XML_GEN_INDENT' type is used, this is the number of spaces for indent

Referenced by wbxml_conv_wbxml2xml().

void wbxml_encoder_set_remove_text_blanks WBXMLEncoder   encoder,
WB_BOOL    set_remove
 

Set the WBXML Encoder to remove leading and trailing blanks in texts [Default: FALSE].

Parameters:
encoder [in] The WBXML Encoder to use
set_remove [in] TRUE if remove, FALSE otherwise
Warning:
This behaviour can me overriden by the WBXML_ENCODER_XML_GEN_CANONICAL mode (set by wbxml_encoder_set_xml_gen_type())

Referenced by wbxml_conv_wbxml2xml(), and wbxml_conv_xml2wbxml().

void wbxml_encoder_set_tree WBXMLEncoder   encoder,
WBXMLTree   tree
 

Set the WBXML Tree to encode.

Parameters:
encoder [in] The WBXML Encoder to use
tree [in] The WBXML Tree to encode
Note:
You MUST call this function before calling following wbxml_encoder_encode() or wbxml_encoder_encode_to_xml() function

Definition at line 432 of file wbxml_encoder.c.

References NULL, and WBXMLEncoder_s::tree.

Referenced by wbxml_conv_wbxml2xml(), and wbxml_conv_xml2wbxml().

void wbxml_encoder_set_use_strtbl WBXMLEncoder   encoder,
WB_BOOL    use_strtbl
 

Set if we use String Table when Encoding into WBXML [Default: TRUE].

Parameters:
encoder [in] The WBXML Encoder
use_strtbl [in] TRUE if we use String Table, FALSE otherwise
Note:
This function has no effect if WBXML_ENCODER_USE_STRTBL compilation flag is not set

Referenced by wbxml_conv_xml2wbxml().

void wbxml_encoder_set_wbxml_version WBXMLEncoder   encoder,
WBXMLVersion    version
 

Set the WBXML Version of the output document, when generating WBXML [Default: 'WBXML_VERSION_TOKEN_13' (1.3)].

Parameters:
encoder [in] The WBXML Encoder
version [in] The WBXML Version

Definition at line 400 of file wbxml_encoder.c.

References NULL, WBXMLEncoder_s::wbxml_version, WBXML_VERSION_UNKNOWN, and WBXMLVersion.

Referenced by wbxml_conv_xml2wbxml().

void wbxml_encoder_set_xml_gen_type WBXMLEncoder   encoder,
WBXMLEncoderXMLGenType    gen_type
 

Set the WBXML Encoder XML Generation Type, when generating XML [Default: WBXML_ENCODER_XML_GEN_COMPACT].

Parameters:
encoder [in] The WBXML Encoder
gen_type [in] Generation Type (cf. WBXMLEncoderXMLGen enum)

Definition at line 412 of file wbxml_encoder.c.

References NULL, WBXMLEncoderXMLGenType, and WBXMLEncoder_s::xml_gen_type.

Referenced by wbxml_conv_wbxml2xml().


Generated on Mon Nov 24 20:09:48 2003 for WBXML Library by doxygen1.3-rc1