25#ifndef COMMONCPP_XML_H_
26#define COMMONCPP_XML_H_
28#ifndef COMMONCPP_CONFIG_H_
29#include <commoncpp/config.h>
49 enum {TAG, CDATA, COMMENT, DTD, AMP, NONE, END} state;
51 unsigned bufpos, bufsize;
52 __LOCAL
bool parseTag(
void);
53 __LOCAL
void putBuffer(
char c);
54 __LOCAL
void clearBuffer(
void);
75 virtual void comment(
const caddr_t text,
size_t size);
82 virtual void characters(
const caddr_t text,
size_t size);
116 bool partial(
const char *address,
size_t size);
virtual void startDocument(void)
Notify start of document event.
bool parse(const char *cp)
Parse a stream buffer and return parser document completion flag.
virtual void endDocument(void)
Notify end of document event.
bool partial(const char *address, size_t size)
Parse a chunk of data and return parser completion flag.
bool end(void) const
End of document check.
virtual void startElement(const caddr_t name, caddr_t *attr)=0
Notify start of an element in the document.
virtual ~XMLParser()
Destroy xml parser.
virtual void endElement(const caddr_t name)=0
Notify end of an element in the document.
virtual void characters(const caddr_t text, size_t size)
Virtual to receive character text extracted from the document.
XMLParser(unsigned size=8192)
Create xml parser.
virtual void comment(const caddr_t text, size_t size)
Virtual to receive embedded comments in XML document being parsed.
bool parse(FILE *file)
Parse a file buffer and return parser document completion flag.