XML file operations.
More...
#include <zeda/zeda_misc.h>
#include <libxml/parser.h>
Go to the source code of this file.
|
#define | zXMLInit() LIBXML_TEST_VERSION |
|
#define | zXMLCheckStr(str1, str2) ( strcmp( (char*)(str1), (str2) ) == 0 ) |
|
#define | zXMLGetString(node) ( (char *)xmlNodeListGetString( (node)->doc, node, 1 ) ) |
|
#define | zXMLGetInt(node) atoi( zXMLGetString( node ) ) |
|
#define | zXMLGetContent(node) ( (char *)xmlNodeGetContent( node ) ) |
|
#define | zXMLForEachNode(node, np) for( (np)=(node); (np); (np)=(np)->next ) |
|
#define | zXMLCheckElement(node, str) ( (node)->type == XML_ELEMENT_NODE && zXMLCheckStr( (node)->name, str ) ) |
|
#define | zXMLCheckElementAndExec(node, name, op) if( zXMLCheckElement(node,name) ){ if( !op ) return false; } |
|
#define | zXMLFindNodeAttr(node, name) ( (char *)xmlGetProp( node, (xmlChar*)name ) ) |
|
#define | zXMLAddNodeAttr(node, name, val) xmlNewProp( node, (xmlChar *)name, (xmlChar *)val ) |
|
#define | zXMLReplaceNodeAttr(node, name, val) xmlSetProp( node, (xmlChar *)name, (xmlChar *)val ) |
|
#define | zXMLGetAttrVal(attr) ( (char *)xmlNodeListGetString( (attr)->doc, (attr)->children, 1 ) ) |
|
#define | zXMLGetAttrInt(attr) atoi( zXMLGetAttrVal( attr ) ) |
|
#define | zXMLGetAttrDouble(attr) atof( zXMLGetAttrVal( attr ) ) |
|
#define | zXMLForEachAttr(node, attr) for( (attr)=(node)->properties; (attr); (attr)=(attr)->next ) |
|
#define | zXMLCheckAttr(attr, str) zXMLCheckStr( (attr)->name, str ) |
|
#define | zXMLCheckAttrAndExec(attr, str, op) if( zXMLCheckStr( (attr)->name, str ) ){ (op); } |
|
XML file operations.
- Author
- Zhidao
◆ zXMLInit
#define zXMLInit |
( |
| ) |
LIBXML_TEST_VERSION |
◆ zXMLCheckStr
#define zXMLCheckStr |
( |
|
str1, |
|
|
|
str2 |
|
) |
| ( strcmp( (char*)(str1), (str2) ) == 0 ) |
◆ zXMLGetString
#define zXMLGetString |
( |
|
node | ) |
( (char *)xmlNodeListGetString( (node)->doc, node, 1 ) ) |
◆ zXMLGetInt
◆ zXMLGetContent
#define zXMLGetContent |
( |
|
node | ) |
( (char *)xmlNodeGetContent( node ) ) |
◆ zXMLForEachNode
#define zXMLForEachNode |
( |
|
node, |
|
|
|
np |
|
) |
| for( (np)=(node); (np); (np)=(np)->next ) |
◆ zXMLCheckElement
#define zXMLCheckElement |
( |
|
node, |
|
|
|
str |
|
) |
| ( (node)->type == XML_ELEMENT_NODE && zXMLCheckStr( (node)->name, str ) ) |
◆ zXMLCheckElementAndExec
#define zXMLCheckElementAndExec |
( |
|
node, |
|
|
|
name, |
|
|
|
op |
|
) |
| if( zXMLCheckElement(node,name) ){ if( !op ) return false; } |
◆ zXMLFindNodeAttr
#define zXMLFindNodeAttr |
( |
|
node, |
|
|
|
name |
|
) |
| ( (char *)xmlGetProp( node, (xmlChar*)name ) ) |
◆ zXMLAddNodeAttr
#define zXMLAddNodeAttr |
( |
|
node, |
|
|
|
name, |
|
|
|
val |
|
) |
| xmlNewProp( node, (xmlChar *)name, (xmlChar *)val ) |
◆ zXMLReplaceNodeAttr
#define zXMLReplaceNodeAttr |
( |
|
node, |
|
|
|
name, |
|
|
|
val |
|
) |
| xmlSetProp( node, (xmlChar *)name, (xmlChar *)val ) |
◆ zXMLGetAttrVal
#define zXMLGetAttrVal |
( |
|
attr | ) |
( (char *)xmlNodeListGetString( (attr)->doc, (attr)->children, 1 ) ) |
◆ zXMLGetAttrInt
◆ zXMLGetAttrDouble
◆ zXMLForEachAttr
#define zXMLForEachAttr |
( |
|
node, |
|
|
|
attr |
|
) |
| for( (attr)=(node)->properties; (attr); (attr)=(attr)->next ) |
◆ zXMLCheckAttr
#define zXMLCheckAttr |
( |
|
attr, |
|
|
|
str |
|
) |
| zXMLCheckStr( (attr)->name, str ) |
◆ zXMLCheckAttrAndExec
#define zXMLCheckAttrAndExec |
( |
|
attr, |
|
|
|
str, |
|
|
|
op |
|
) |
| if( zXMLCheckStr( (attr)->name, str ) ){ (op); } |
◆ zXMLFindNodeElement()
xmlNode* zXMLFindNodeElement |
( |
xmlNode * |
node, |
|
|
char * |
name |
|
) |
| |
◆ zXMLCheckAttrVal()
bool zXMLCheckAttrVal |
( |
xmlAttr * |
attr, |
|
|
char * |
name, |
|
|
char * |
str |
|
) |
| |