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

wbxml_parser.h File Reference

WBXML Parser - Parse a WBXML document and call user defined Callbacks. More...

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Typedefs

typedef WBXMLParser_s WBXMLParser

Functions

WBXMLParserwbxml_parser_create (void)
 Create a WBXML Parser.

void wbxml_parser_destroy (WBXMLParser *parser)
 Destroy a WBXML Parser.

WBXMLError wbxml_parser_parse (WBXMLParser *parser, WB_UTINY *wbxml, WB_ULONG wbxml_len)
 Parse a WBXML document, using User Defined callbacks Return WBXML_OK if no error, an error code otherwise.

void wbxml_parser_set_user_data (WBXMLParser *parser, void *user_data)
 Set User Data for a WBXML Parser.

void wbxml_parser_set_content_handler (WBXMLParser *parser, WBXMLContentHandler *content_handler)
 Set Content Handler for a WBXML Parser.

void wbxml_parser_set_main_table (WBXMLParser *parser, const WBXMLLangEntry *main_table)
 Set Main WBXML Languages Table.

WB_BOOL wbxml_parser_set_language (WBXMLParser *parser, WBXMLLanguage lang)
 Force to parse the Document of a given Language.

WB_ULONG wbxml_parser_get_wbxml_public_id (WBXMLParser *parser)
 Get WBXML Public ID.

const WB_UTINY * wbxml_parser_get_xml_public_id (WBXMLParser *parser)
 Get XML Public ID.

WBXMLVersion wbxml_parser_get_wbxml_version (WBXMLParser *parser)
 Get WBXML Version.

WB_LONG wbxml_parser_get_current_byte_index (WBXMLParser *parser)
 Return current parsing position in WBXML.


Detailed Description

WBXML Parser - Parse a WBXML document and call user defined Callbacks.

Author:
Aymerick Jéhanne <libwbxml@jehanne.org>
Date:
02/03/12

Definition in file wbxml_parser.h.


Function Documentation

WBXMLParser* wbxml_parser_create void   
 

Create a WBXML Parser.

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

Definition at line 176 of file wbxml_parser.c.

References WBXMLParser_s::attrCodePage, WBXMLParser_s::charset, WBXMLParser_s::content_hdl, WBXMLParser_s::current_tag, WBXMLParser_s::lang_forced, WBXMLParser_s::langTable, WBXMLParser_s::mainTable, NULL, WBXMLParser_s::pos, WBXMLParser_s::public_id, WBXMLParser_s::public_id_index, WBXMLParser_s::strstbl, WBXMLParser_s::tagCodePage, WBXMLParser_s::user_data, WBXMLParser_s::version, WBXMLParser_s::wbxml, WBXML_LANG_UNKNOWN, wbxml_malloc(), WBXML_PUBLIC_ID_UNKNOWN, wbxml_tables_get_main(), and WBXML_VERSION_UNKNOWN.

Referenced by wbxml_tree_from_wbxml().

void wbxml_parser_destroy WBXMLParser   parser
 

Destroy a WBXML Parser.

Parameters:
parser The WBXMLParser to destroy

Definition at line 210 of file wbxml_parser.c.

References NULL, WBXMLParser_s::strstbl, WBXMLParser_s::wbxml, wbxml_buffer_destroy(), and wbxml_free().

Referenced by wbxml_tree_from_wbxml().

WB_LONG wbxml_parser_get_current_byte_index WBXMLParser   parser
 

Return current parsing position in WBXML.

Parameters:
parser The WBXML Parser
Returns:
The parsing position in WBXML

Definition at line 347 of file wbxml_parser.c.

References NULL, WBXMLParser_s::pos, and WB_LONG.

Referenced by wbxml_tree_from_wbxml().

WB_ULONG wbxml_parser_get_wbxml_public_id WBXMLParser   parser
 

Get WBXML Public ID.

Parameters:
parser The WBXML Parser
Returns:
The WBXML Public ID of current parsing document

Definition at line 320 of file wbxml_parser.c.

References WBXMLParser_s::langTable, NULL, WBXMLLangEntry_s::publicID, WB_ULONG, WBXML_PUBLIC_ID_UNKNOWN, and WBXMLPublicIDEntry_s::wbxmlPublicID.

WBXMLVersion wbxml_parser_get_wbxml_version WBXMLParser   parser
 

Get WBXML Version.

Parameters:
parser The WBXML Parser
Returns:
The WBXML Version of current parsing document

Definition at line 338 of file wbxml_parser.c.

References NULL, WBXMLParser_s::version, WBXML_VERSION_UNKNOWN, and WBXMLVersion.

const WB_UTINY* wbxml_parser_get_xml_public_id WBXMLParser   parser
 

Get XML Public ID.

Parameters:
parser The WBXML Parser
Returns:
The XML Public ID of current parsing document, or NULL if not found

Definition at line 329 of file wbxml_parser.c.

References WBXMLParser_s::langTable, NULL, WBXMLLangEntry_s::publicID, WB_UTINY, and WBXMLPublicIDEntry_s::xmlPublicID.

void wbxml_parser_set_content_handler WBXMLParser   parser,
WBXMLContentHandler   content_handler
 

Set Content Handler for a WBXML Parser.

Parameters:
parser The WBXML Parser
content_handler The Content Handler structure

Definition at line 295 of file wbxml_parser.c.

References WBXMLParser_s::content_hdl, and NULL.

Referenced by wbxml_tree_from_wbxml().

WB_BOOL wbxml_parser_set_language WBXMLParser   parser,
WBXMLLanguage    lang
 

Force to parse the Document of a given Language.

Parameters:
parser The WBXML Parser
lang The Language
Returns:
TRUE if Language is set, FALSE otherwise
Note:
This permits to force the WBXML Parser to parse a WBXML Document of a given LanguageD. If this fonction is used, the internal Public ID of the WBXML Document is ignored. It is sometimes needed for documents that don't have any WBXML Public ID.

Definition at line 309 of file wbxml_parser.c.

References FALSE, WBXMLParser_s::lang_forced, NULL, TRUE, WB_BOOL, and WBXMLLanguage.

Referenced by wbxml_tree_from_wbxml().

void wbxml_parser_set_main_table WBXMLParser   parser,
const WBXMLLangEntry   main_table
 

Set Main WBXML Languages Table.

Parameters:
parser The WBXML Parser
main_table The Main WBXML Languages Table to set

Definition at line 302 of file wbxml_parser.c.

References WBXMLParser_s::mainTable, and NULL.

void wbxml_parser_set_user_data WBXMLParser   parser,
void *    user_data
 

Set User Data for a WBXML Parser.

Parameters:
parser The WBXML Parser
user_data User data (returned as a parameter in every Content Handler callbacks)

Definition at line 288 of file wbxml_parser.c.

References NULL, and WBXMLParser_s::user_data.

Referenced by wbxml_tree_from_wbxml().


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