| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef _TVG_SIMPLE_XML_PARSER_H_ |
| 24 |
#define _TVG_SIMPLE_XML_PARSER_H_ |
| 25 |
|
| 26 |
#include "tvgSvgLoaderCommon.h" |
| 27 |
|
| 28 |
#define NUMBER_OF_XML_ENTITIES 9 |
| 29 |
const char* const xmlEntity[] = {" ", """, " ", "'", "&", "<", ">", "#", "'"}; |
| 30 |
const int xmlEntityLength[] = {5, 6, 6, 6, 5, 4, 4, 6, 6}; |
| 31 |
|
| 32 |
enum class SimpleXMLType |
| 33 |
{ |
| 34 |
Open = 0, |
| 35 |
OpenEmpty, |
| 36 |
Close, |
| 37 |
Data, |
| 38 |
CData, |
| 39 |
Error, |
| 40 |
Processing, |
| 41 |
Doctype, |
| 42 |
Comment, |
| 43 |
Ignored, |
| 44 |
DoctypeChild |
| 45 |
}; |
| 46 |
|
| 47 |
typedef bool (*simpleXMLCb)(void* data, SimpleXMLType type, const char* content, unsigned int length); |
| 48 |
typedef bool (*simpleXMLAttributeCb)(void* data, const char* key, const char* value); |
| 49 |
|
| 50 |
bool simpleXmlParseAttributes(const char* buf, unsigned bufLength, simpleXMLAttributeCb func, const void* data); |
| 51 |
bool simpleXmlParse(const char* buf, unsigned bufLength, bool strip, simpleXMLCb func, const void* data); |
| 52 |
bool simpleXmlParseW3CAttribute(const char* buf, unsigned bufLength, simpleXMLAttributeCb func, const void* data); |
| 53 |
const char* simpleXmlParseCSSAttribute(const char* buf, unsigned bufLength, char** tag, char** name, const char** attrs, unsigned* attrsLength); |
| 54 |
const char* simpleXmlFindAttributesTag(const char* buf, unsigned bufLength); |
| 55 |
bool isIgnoreUnsupportedLogElements(const char* tagName); |
| 56 |
const char* simpleXmlNodeTypeToString(SvgNodeType type); |
| 57 |
|
| 58 |
#endif |