pleyo.com

BC::BCXML Class Reference

#include <BCXML.h>

Inheritance diagram for BC::BCXML:

BAL::BIXML

List of all members.

Public Member Functions

 BCXML ()
 ~BCXML ()
void * xmlMalloc (int size)
 xmlMalloc: : number of bytes to allocate
void xmlFreeDoc (BAL::BTXMLDoc *doc)
 xmlFreeDoc : Free up all the structures used by a document, tree included.
BAL::BTXMLDocxmlReadMemory (const char *buffer, int size, const char *URL, const char *encoding, int options)
 xmlReadMemory: parse an XML in-memory document and build a tree.
BAL::BTXMLAttrxmlGetID (BAL::BTXMLDoc *doc, const unsigned char *ID)
 xmlGetID: Search the attribute declaring the given ID doc: pointer to the document ID: the ID value Returns: NULL if not found, otherwise the BTXMLAttrPtr defining the ID
void xmlFree (void *mem)
 xmlFree: free the memory
unsigned char * xmlNodeGetBase (BAL::BTXMLDoc *doc, BTXMLNode *cur)
 xmlNodeGetBase: Searches for the BASE URL.
unsigned char * xmlBuildURI (const unsigned char *URI, const unsigned char *base)
 xmlBuildURI: Computes he final URI of the reference done by checking that the given URI is valid, and building the final URI using the base URI.
int xmlStrEqual (const unsigned char *str1, const unsigned char *str2)
 xmlStrEqual: Check if both strings are equal of have same content.
void xmlSetGenericErrorFunc (void *ctx, BTXMLGenericErrorFunc handler)
 xmlSetGenericErrorFunc: Function to reset the handler and the error context for out of context error messages.
BTXMLOutputBufferxmlAllocOutputBuffer (BTXMLCharEncodingHandler *encoder)
 xmlAllocOutputBuffer: Create a buffered parser output encoder: the encoding converter or NULL Returns: the new parser output or NULL
void xmlOutputBufferClose (BTXMLOutputBuffer *outputBuf)
 xmlOutputBufferClose: flushes and close the output I/O channel and free up all the associated resources out: a buffered output Returns: the number of byte written or -1 in case of error.
BTXMLHashTablexmlHashCreate (int size)
 xmlHashCreate: Create a new BTXMLHashTable * size: the size of the hash table Returns: the newly created object, or NULL if an error occured.
unsigned char * xmlStrdup (const unsigned char *buf)
 xmlStrdup: a strdup for array of xmlChar's.
unsigned char * xmlStrndup (const unsigned char *buf, int size)
 xmlStrndup a strndup for array of xmlChar's cur: the input xmlChar * len: the len of Returns: a new xmlChar * or NULL
void xmlInitParser (void)
 xmlInitParser Initialization function for the XML parser.
BTXMLParserCtxtxmlCreatePushParserCtxt (BTXMLSAXHandler *sax)
 xmlCreatePushParserCtxt: Create a parser context for using the XML parser in push mode.
int xmlRegisterInputCallbacks (BTXMLInputMatchCallback matchFunc, BTXMLInputOpenCallback openFunc, BTXMLInputReadCallback readFunc, BTXMLInputCloseCallback closeFunc)
 xmlRegisterInputCallbacks: Register a new set of I/O callback for handling parser input.
int xmlRegisterOutputCallbacks (BTXMLOutputMatchCallback matchFunc, BTXMLOutputOpenCallback openFunc, BTXMLOutputWriteCallback writeFunc, BTXMLOutputCloseCallback closeFunc)
 xmlRegisterOutputCallbacks: Register a new set of I/O callback for handling output.
BTXMLParserCtxtxmlSwitchEncoding (BTXMLParserCtxt *ctxt, int enc)
 xmlSwitchEncoding: change the input functions when discovering the character encoding of a given entity.
BTXMLParserCtxtxmlParseChunk (BTXMLParserCtxt *ctxt, const char *chunk, int size, int terminate)
 xmlParseChunk: Parse a Chunk of memory ctxt: an XML parser context chunk: an char array size: the size in byte of the chunk terminate: last chunk indicator Returns: zero if no error, the Errors otherwise.
BTXMLEntityxmlGetPredefinedEntity (const unsigned char *name)
 xmlGetPredefinedEntity: Check whether this name is an predefined entity.
BTXMLEntityxmlGetDocEntity (BTXMLDoc *doc, const unsigned char *name)
 xmlGetDocEntity: Do an entity lookup in the document entity hash table doc: the document referencing the entity name: the entity name Returns: the corresponding entity, otherwise a lookup is done in the predefined entities too.
void xmlSAX2InternalSubset (void *ctx, const unsigned char *name, const unsigned char *ExternalID, const unsigned char *SystemID)
 xmlSAX2InternalSubset: Callback on internal subset declaration.
void xmlFreeParserCtxt (BTXMLParserCtxt *ctxt)
 xmlFreeParserCtxt Free all the memory used by a parser context.
void xmlStopParser (BTXMLParserCtxt *ctxt)
 xmlStopParser: Blocks further parser processing ctxt: an XML parser context
int xmlParseBalancedChunkMemory (void *user_data, const unsigned char *string)
 xmlParseBalancedChunkMemory: Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)* doc: the document the chunk pertains to sax: the SAX handler bloc (possibly NULL) user_data: The user data returned on SAX callbacks (possibly NULL) depth: Used for loop detection, use 0 string: the input string in UTF8 or ISO-Latin (zero terminated) lst: the return value for the set of parsed nodes Returns: 0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise
void * getXMLGenericErrorContext ()
 getXMLGenericErrorContext: return the GenericErrorContext
BTXMLSAXHandlersetSaxHandler (BTErrorSAXFunc error, BTFatalErrorSAXFunc fatalError, BTCharactersSAXFunc characters, BTProcessingInstructionSAXFunc processingInstruction, BTCdataBlockSAXFunc cdataBlock, BTCommentSAXFunc comment, BTWarningSAXFunc warning, BTStartElementNsSAX2Func startElementNs, BTEndElementNsSAX2Func endElementNs, BTGetEntitySAXFunc getEntity, BTInternalSubsetSAXFunc internalSubset, BTExternalSubsetSAXFunc externalSubset, BTIgnorableWhitespaceSAXFunc ignorableWhitespace)
 BTXMLSAXHandler: setSaxHandler: set all handler to parse the document.
BTXMLGenericErrorFunc getXMLGenericError ()
 BTXMLGenericErrorFunc: return a BTXMLGenericErrorFunc.
BTXMLDocconvertDoc (xmlDoc *doc)
BTXMLNodeconvertNode (xmlNode *node)
BTXMLNsconvertNS (xmlNs *ns)
BTXMLAttrconvertAttr (xmlAttr *attr)
BTXMLCharEncodingHandlerconvertEncoding (xmlCharEncodingHandler *m_enc)
BTXMLOutputBufferconvertOutPut (xmlOutputBuffer *out)
BTXMLEntityconvertEntity (xmlEntity *entity)
BTXMLParserCtxtconvertParser (xmlParserCtxt *parser)
BTXMLParserInputconvertParserInput (xmlParserInput *input)
xmlDoc * convertXmlDoc (xmlDoc *d, BTXMLDoc *doc)
xmlNode * convertXmlNode (BTXMLNode *node)
xmlNs * convertXmlNS (xmlNode *node, BTXMLNs *ns)
xmlOutputBuffer * convertXmlOutPut (BTXMLOutputBuffer *out)
xmlParserCtxt * convertXmlParser (xmlParserCtxt *p, BTXMLParserCtxt *parser)
xmlParserInput * convertXmlParserInput (xmlParserInput *in, BTXMLParserInput *input)

Static Public Member Functions

static xmlEntity * convertXmlEntity (BTXMLEntity *entity)
static xmlDoc * convertXmlDocS (BTXMLDoc *doc)

Public Attributes

BTErrorSAXFunc m_error
BTFatalErrorSAXFunc m_fatalError
BTCharactersSAXFunc m_characters
BTProcessingInstructionSAXFunc m_processingInstruction
BTCdataBlockSAXFunc m_cdataBlock
BTCommentSAXFunc m_comment
BTWarningSAXFunc m_warning
BTStartElementNsSAX2Func m_startElementNs
BTEndElementNsSAX2Func m_endElementNs
BTGetEntitySAXFunc m_getEntity
BTInternalSubsetSAXFunc m_internalSubset
BTExternalSubsetSAXFunc m_externalSubset
BTIgnorableWhitespaceSAXFunc m_ignorableWhitespace
xmlParserCtxt * m_parser
xmlDoc * m_doc
xmlNode * m_node
xmlOutputBuffer * m_outbuf


Detailed Description

the XML Implementation

Constructor & Destructor Documentation

BCXML::BCXML (  ) 

BCXML::~BCXML (  ) 


Member Function Documentation

void * BCXML::xmlMalloc ( int  size  )  [virtual]

xmlMalloc: : number of bytes to allocate

Returns the pointer to the allocated area or NULL in case of error

Implements BAL::BIXML.

void BCXML::xmlFreeDoc ( BAL::BTXMLDoc doc  )  [virtual]

xmlFreeDoc : Free up all the structures used by a document, tree included.

cur: pointer to the document

Implements BAL::BIXML.

BAL::BTXMLDoc * BCXML::xmlReadMemory ( const char *  buffer,
int  size,
const char *  URL,
const char *  encoding,
int  options 
) [virtual]

xmlReadMemory: parse an XML in-memory document and build a tree.

buffer: a pointer to a char array size: the size of the array URL: the base URL to use for the document encoding: the document encoding, or NULL options: a combination of xmlParserOption Returns: the resulting document tree

Implements BAL::BIXML.

BAL::BTXMLAttr * BCXML::xmlGetID ( BAL::BTXMLDoc doc,
const unsigned char *  ID 
) [virtual]

xmlGetID: Search the attribute declaring the given ID doc: pointer to the document ID: the ID value Returns: NULL if not found, otherwise the BTXMLAttrPtr defining the ID

Implements BAL::BIXML.

void BCXML::xmlFree ( void *  mem  )  [virtual]

xmlFree: free the memory

Implements BAL::BIXML.

unsigned char * BCXML::xmlNodeGetBase ( BAL::BTXMLDoc doc,
BTXMLNode cur 
) [virtual]

xmlNodeGetBase: Searches for the BASE URL.

The code should work on both XML and HTML document even if base mechanisms are completely different. It returns the base as defined in RFC 2396 sections 5.1.1. Base URI within Document Content and 5.1.2. Base URI from the Encapsulating Entity However it does not return the document base (5.1.3). doc: the document the node pertains to cur: the node being checked Returns: a pointer to the base URL, or NULL if not found It's up to the caller to free the memory with xmlFree().

Implements BAL::BIXML.

unsigned char * BCXML::xmlBuildURI ( const unsigned char *  URI,
const unsigned char *  base 
) [virtual]

xmlBuildURI: Computes he final URI of the reference done by checking that the given URI is valid, and building the final URI using the base URI.

This is processed according to section 5.2 of the RFC 2396 5.2. Resolving Relative References to Absolute Form URI: the URI instance found in the document base: the base value Returns: a new URI string (to be freed by the caller) or NULL in case of error.

Implements BAL::BIXML.

int BCXML::xmlStrEqual ( const unsigned char *  str1,
const unsigned char *  str2 
) [virtual]

xmlStrEqual: Check if both strings are equal of have same content.

Should be a bit more readable and faster than xmlStrcmp() str1: the first xmlChar * str2: the second xmlChar * Returns: 1 if they are equal, 0 if they are different

Implements BAL::BIXML.

void BCXML::xmlSetGenericErrorFunc ( void *  ctx,
BTXMLGenericErrorFunc  handler 
) [virtual]

xmlSetGenericErrorFunc: Function to reset the handler and the error context for out of context error messages.

This simply means that will be called for subsequent error messages while not parsing nor validating. And will be passed as first argument to One can simply force messages to be emitted to another FILE * than stderr by setting to this file handle and to NULL. For multi-threaded applications, this must be set separately for each thread. ctx: the new error handling context handler: the new handler function

Implements BAL::BIXML.

BTXMLOutputBuffer * BCXML::xmlAllocOutputBuffer ( BTXMLCharEncodingHandler encoder  )  [virtual]

xmlAllocOutputBuffer: Create a buffered parser output encoder: the encoding converter or NULL Returns: the new parser output or NULL

Implements BAL::BIXML.

void BCXML::xmlOutputBufferClose ( BTXMLOutputBuffer outputBuf  )  [virtual]

xmlOutputBufferClose: flushes and close the output I/O channel and free up all the associated resources out: a buffered output Returns: the number of byte written or -1 in case of error.

Implements BAL::BIXML.

BTXMLHashTable * BCXML::xmlHashCreate ( int  size  )  [virtual]

xmlHashCreate: Create a new BTXMLHashTable * size: the size of the hash table Returns: the newly created object, or NULL if an error occured.

Implements BAL::BIXML.

unsigned char * BCXML::xmlStrdup ( const unsigned char *  buf  )  [virtual]

xmlStrdup: a strdup for array of xmlChar's.

Since they are supposed to be encoded in UTF-8 or an encoding with 8bit based chars, we assume a termination mark of '0'. cur: the input xmlChar * Returns: a new xmlChar * or NULL

Implements BAL::BIXML.

unsigned char * BCXML::xmlStrndup ( const unsigned char *  buf,
int  size 
) [virtual]

xmlStrndup a strndup for array of xmlChar's cur: the input xmlChar * len: the len of Returns: a new xmlChar * or NULL

Implements BAL::BIXML.

void BCXML::xmlInitParser ( void   )  [virtual]

xmlInitParser Initialization function for the XML parser.

This is not reentrant. Call once before processing in case of use in multithreaded programs.

Implements BAL::BIXML.

BTXMLParserCtxt * BCXML::xmlCreatePushParserCtxt ( BTXMLSAXHandler sax  )  [virtual]

xmlCreatePushParserCtxt: Create a parser context for using the XML parser in push mode.

If and are non-NULL, the data is used to detect the encoding. The remaining characters will be parsed so they don't need to be fed in again through xmlParseChunk. To allow content encoding detection, should be >= 4 The value of is used for fetching external entities and error/warning reports. sax: a SAX handler user_data: The user data returned on SAX callbacks chunk: a pointer to an array of chars size: number of chars in the array filename: an optional file name or URI Returns: the new parser context or NULL

Implements BAL::BIXML.

int BCXML::xmlRegisterInputCallbacks ( BTXMLInputMatchCallback  matchFunc,
BTXMLInputOpenCallback  openFunc,
BTXMLInputReadCallback  readFunc,
BTXMLInputCloseCallback  closeFunc 
) [virtual]

xmlRegisterInputCallbacks: Register a new set of I/O callback for handling parser input.

matchFunc: the BTXMLInputMatchCallback openFunc: the BTXMLInputOpenCallback readFunc: the BTXMLInputReadCallback closeFunc: the BTXMLInputCloseCallback Returns: the registered handler number or -1 in case of error

Implements BAL::BIXML.

int BCXML::xmlRegisterOutputCallbacks ( BTXMLOutputMatchCallback  matchFunc,
BTXMLOutputOpenCallback  openFunc,
BTXMLOutputWriteCallback  writeFunc,
BTXMLOutputCloseCallback  closeFunc 
) [virtual]

xmlRegisterOutputCallbacks: Register a new set of I/O callback for handling output.

matchFunc: the BTXMLOutputMatchCallback openFunc: the BTXMLOutputOpenCallback writeFunc: the BTXMLOutputWriteCallback closeFunc: the BTXMLOutputCloseCallback Returns: the registered handler number or -1 in case of error

Implements BAL::BIXML.

BTXMLParserCtxt * BCXML::xmlSwitchEncoding ( BTXMLParserCtxt ctxt,
int  enc 
) [virtual]

xmlSwitchEncoding: change the input functions when discovering the character encoding of a given entity.

ctxt: the parser context enc: the encoding value (number) Returns: 0 in case of success, -1 otherwise

Implements BAL::BIXML.

BTXMLParserCtxt * BCXML::xmlParseChunk ( BTXMLParserCtxt ctxt,
const char *  chunk,
int  size,
int  terminate 
) [virtual]

xmlParseChunk: Parse a Chunk of memory ctxt: an XML parser context chunk: an char array size: the size in byte of the chunk terminate: last chunk indicator Returns: zero if no error, the Errors otherwise.

Implements BAL::BIXML.

BTXMLEntity * BCXML::xmlGetPredefinedEntity ( const unsigned char *  name  )  [virtual]

xmlGetPredefinedEntity: Check whether this name is an predefined entity.

name: the entity name Returns: NULL if not, otherwise the entity

Implements BAL::BIXML.

BTXMLEntity * BCXML::xmlGetDocEntity ( BTXMLDoc doc,
const unsigned char *  name 
) [virtual]

xmlGetDocEntity: Do an entity lookup in the document entity hash table doc: the document referencing the entity name: the entity name Returns: the corresponding entity, otherwise a lookup is done in the predefined entities too.

Returns A pointer to the entity structure or NULL if not found.

Implements BAL::BIXML.

void BCXML::xmlSAX2InternalSubset ( void *  ctx,
const unsigned char *  name,
const unsigned char *  ExternalID,
const unsigned char *  SystemID 
) [virtual]

xmlSAX2InternalSubset: Callback on internal subset declaration.

ctx: the user data (XML parser context) name: the root element name ExternalID: the external ID SystemID: the SYSTEM ID (e.g. filename or URL)

Implements BAL::BIXML.

void BCXML::xmlFreeParserCtxt ( BTXMLParserCtxt ctxt  )  [virtual]

xmlFreeParserCtxt Free all the memory used by a parser context.

However the parsed document in ctxt->myDoc is not freed. ctxt: an XML parser context

Implements BAL::BIXML.

void BCXML::xmlStopParser ( BTXMLParserCtxt ctxt  )  [virtual]

xmlStopParser: Blocks further parser processing ctxt: an XML parser context

Implements BAL::BIXML.

int BCXML::xmlParseBalancedChunkMemory ( void *  user_data,
const unsigned char *  string 
) [virtual]

xmlParseBalancedChunkMemory: Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)* doc: the document the chunk pertains to sax: the SAX handler bloc (possibly NULL) user_data: The user data returned on SAX callbacks (possibly NULL) depth: Used for loop detection, use 0 string: the input string in UTF8 or ISO-Latin (zero terminated) lst: the return value for the set of parsed nodes Returns: 0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise

Implements BAL::BIXML.

void * BCXML::getXMLGenericErrorContext (  )  [virtual]

getXMLGenericErrorContext: return the GenericErrorContext

Implements BAL::BIXML.

BTXMLSAXHandler * BCXML::setSaxHandler ( BTErrorSAXFunc  error,
BTFatalErrorSAXFunc  fatalError,
BTCharactersSAXFunc  characters,
BTProcessingInstructionSAXFunc  processingInstruction,
BTCdataBlockSAXFunc  cdataBlock,
BTCommentSAXFunc  comment,
BTWarningSAXFunc  warning,
BTStartElementNsSAX2Func  startElementNs,
BTEndElementNsSAX2Func  endElementNs,
BTGetEntitySAXFunc  getEntity,
BTInternalSubsetSAXFunc  internalSubset,
BTExternalSubsetSAXFunc  externalSubset,
BTIgnorableWhitespaceSAXFunc  ignorableWhitespace 
) [virtual]

BTXMLSAXHandler: setSaxHandler: set all handler to parse the document.

Implements BAL::BIXML.

BTXMLGenericErrorFunc BCXML::getXMLGenericError (  )  [virtual]

BTXMLGenericErrorFunc: return a BTXMLGenericErrorFunc.

Implements BAL::BIXML.

BTXMLDoc * BCXML::convertDoc ( xmlDoc *  doc  ) 

BTXMLNode * BCXML::convertNode ( xmlNode *  node  ) 

BTXMLNs * BCXML::convertNS ( xmlNs *  ns  ) 

BTXMLAttr * BCXML::convertAttr ( xmlAttr *  attr  ) 

BTXMLCharEncodingHandler * BCXML::convertEncoding ( xmlCharEncodingHandler *  m_enc  ) 

BTXMLOutputBuffer * BCXML::convertOutPut ( xmlOutputBuffer *  out  ) 

BTXMLEntity * BCXML::convertEntity ( xmlEntity *  entity  ) 

BTXMLParserCtxt * BCXML::convertParser ( xmlParserCtxt *  parser  ) 

BTXMLParserInput * BCXML::convertParserInput ( xmlParserInput *  input  ) 

xmlDoc * BCXML::convertXmlDoc ( xmlDoc *  d,
BTXMLDoc doc 
)

xmlNode * BCXML::convertXmlNode ( BTXMLNode node  ) 

xmlNs * BCXML::convertXmlNS ( xmlNode *  node,
BTXMLNs ns 
)

xmlOutputBuffer * BCXML::convertXmlOutPut ( BTXMLOutputBuffer out  ) 

xmlParserCtxt * BCXML::convertXmlParser ( xmlParserCtxt *  p,
BTXMLParserCtxt parser 
)

xmlParserInput * BCXML::convertXmlParserInput ( xmlParserInput *  in,
BTXMLParserInput input 
)

xmlEntity * BCXML::convertXmlEntity ( BTXMLEntity entity  )  [static]

static xmlDoc* BC::BCXML::convertXmlDocS ( BTXMLDoc doc  )  [static]


Member Data Documentation

BTErrorSAXFunc BC::BCXML::m_error

BTFatalErrorSAXFunc BC::BCXML::m_fatalError

BTCharactersSAXFunc BC::BCXML::m_characters

BTProcessingInstructionSAXFunc BC::BCXML::m_processingInstruction

BTCdataBlockSAXFunc BC::BCXML::m_cdataBlock

BTCommentSAXFunc BC::BCXML::m_comment

BTWarningSAXFunc BC::BCXML::m_warning

BTStartElementNsSAX2Func BC::BCXML::m_startElementNs

BTEndElementNsSAX2Func BC::BCXML::m_endElementNs

BTGetEntitySAXFunc BC::BCXML::m_getEntity

BTInternalSubsetSAXFunc BC::BCXML::m_internalSubset

BTExternalSubsetSAXFunc BC::BCXML::m_externalSubset

BTIgnorableWhitespaceSAXFunc BC::BCXML::m_ignorableWhitespace

xmlParserCtxt* BC::BCXML::m_parser

xmlDoc* BC::BCXML::m_doc

xmlNode* BC::BCXML::m_node

xmlOutputBuffer* BC::BCXML::m_outbuf


The documentation for this class was generated from the following files:
Generated on Wed Nov 21 20:04:20 2007 for Origyn Web Browser by Doxygen 1.5.3

pleyo.com
pleyo.com