diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-20 13:55:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-20 13:55:58 +0000 |
commit | 04f4e2acfbc82946ca3def654214c08071a87359 (patch) | |
tree | 871e1f476ed5086e8ebbd7e182ea2a89707cc249 /src | |
parent | 24cbc87262dc8856741db8e9f8388c18b16583ad (diff) |
xml api became a set of functions
git-svn-id: http://svn.miranda-ng.org/main/trunk@14288 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/mir_app.def | 55 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 55 | ||||
-rw-r--r-- | src/mir_app/src/utils.cpp | 1 | ||||
-rw-r--r-- | src/mir_app/src/xmlApi.cpp | 261 |
4 files changed, 199 insertions, 173 deletions
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 29a0ddd771..ca4b04ac19 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -142,3 +142,58 @@ Proto_ChainSend @139 Proto_IsProtoOnContact @140
Proto_RegisterModule @141
Proto_RemoveFromContact @142
+xmlAddAttr @143
+xmlAddAttrInt @144
+xmlAddChild @145
+xmlAddChild2 @146
+xmlAddChildEx @147
+xmlAddChildEx2 @148
+xmlAddClear @149
+xmlAddText @150
+xmlCopyNode @151
+xmlCreateNode @152
+xmlDeepCopy @153
+xmlDeleteAttrByIndex @154
+xmlDeleteAttrByName @155
+xmlDeleteClear @156
+xmlDeleteNodeContent @157
+xmlDeleteText @158
+xmlDestroyNode @159
+xmlFree @160
+xmlGetAttr @161
+xmlGetAttrCount @162
+xmlGetAttrName @163
+xmlGetAttrValue @164
+xmlGetChild @165
+xmlGetChildByAttrValue @166
+xmlGetChildByPath @167
+xmlGetChildCount @168
+xmlGetClear @169
+xmlGetClearCount @170
+xmlGetElement @171
+xmlGetElementCount @172
+xmlGetFirstChild @173
+xmlGetName @174
+xmlGetNextChild @175
+xmlGetNextNode @176
+xmlGetNthChild @177
+xmlGetParent @178
+xmlGetText @179
+xmlGetTextByIndex @180
+xmlGetTextCount @181
+xmlIsDeclaration @182
+xmlParseFile @183
+xmlParseString @184
+xmlPositionOfChildByIndex @185
+xmlPositionOfChildByName @186
+xmlPositionOfChildByNode @187
+xmlPositionOfClear @188
+xmlPositionOfText @189
+xmlSetAttrByIndex @190
+xmlSetAttrByName @191
+xmlSetClear @192
+xmlSetText @193
+xmlSetTextByIndex @194
+xmlToFile @195
+xmlToString @196
+xmlToStringWithFormatting @197
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index be37130c97..4bf3102631 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -142,3 +142,58 @@ Proto_ChainSend @139 Proto_IsProtoOnContact @140
Proto_RegisterModule @141
Proto_RemoveFromContact @142
+xmlAddAttr @143
+xmlAddAttrInt @144
+xmlAddChild @145
+xmlAddChild2 @146
+xmlAddChildEx @147
+xmlAddChildEx2 @148
+xmlAddClear @149
+xmlAddText @150
+xmlCopyNode @151
+xmlCreateNode @152
+xmlDeepCopy @153
+xmlDeleteAttrByIndex @154
+xmlDeleteAttrByName @155
+xmlDeleteClear @156
+xmlDeleteNodeContent @157
+xmlDeleteText @158
+xmlDestroyNode @159
+xmlFree @160
+xmlGetAttr @161
+xmlGetAttrCount @162
+xmlGetAttrName @163
+xmlGetAttrValue @164
+xmlGetChild @165
+xmlGetChildByAttrValue @166
+xmlGetChildByPath @167
+xmlGetChildCount @168
+xmlGetClear @169
+xmlGetClearCount @170
+xmlGetElement @171
+xmlGetElementCount @172
+xmlGetFirstChild @173
+xmlGetName @174
+xmlGetNextChild @175
+xmlGetNextNode @176
+xmlGetNthChild @177
+xmlGetParent @178
+xmlGetText @179
+xmlGetTextByIndex @180
+xmlGetTextCount @181
+xmlIsDeclaration @182
+xmlParseFile @183
+xmlParseString @184
+xmlPositionOfChildByIndex @185
+xmlPositionOfChildByName @186
+xmlPositionOfChildByNode @187
+xmlPositionOfClear @188
+xmlPositionOfText @189
+xmlSetAttrByIndex @190
+xmlSetAttrByName @191
+xmlSetClear @192
+xmlSetText @193
+xmlSetTextByIndex @194
+xmlToFile @195
+xmlToString @196
+xmlToStringWithFormatting @197
diff --git a/src/mir_app/src/utils.cpp b/src/mir_app/src/utils.cpp index c5ec173858..a383bbaf2f 100644 --- a/src/mir_app/src/utils.cpp +++ b/src/mir_app/src/utils.cpp @@ -377,7 +377,6 @@ int LoadUtilsModule(void) InitOpenUrl();
InitPathUtils();
- InitXmlApi();
InitCrypt();
return 0;
}
diff --git a/src/mir_app/src/xmlApi.cpp b/src/mir_app/src/xmlApi.cpp index cd0c347987..2e1ad2c3f5 100644 --- a/src/mir_app/src/xmlApi.cpp +++ b/src/mir_app/src/xmlApi.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
#include "xmlParser.h"
-static HXML xmlapiCreateNode(LPCTSTR name, LPCTSTR text, char isDeclaration)
+MIR_APP_DLL(HXML) xmlCreateNode(LPCTSTR name, LPCTSTR text, char isDeclaration)
{
XMLNode result = XMLNode::createXMLTopNode(name, isDeclaration);
if (text)
@@ -33,12 +33,12 @@ static HXML xmlapiCreateNode(LPCTSTR name, LPCTSTR text, char isDeclaration) return result.detach();
}
-static void xmlapiDestroyNode(HXML n)
+MIR_APP_DLL(void) xmlDestroyNode(HXML n)
{
XMLNode tmp; tmp.attach(n);
}
-static HXML xmlapiParseFile(LPCTSTR str, int* datalen, LPCTSTR tag)
+MIR_APP_DLL(HXML) xmlParseFile(LPCTSTR str, int* datalen, LPCTSTR tag)
{
if (str == NULL) return NULL;
@@ -51,7 +51,7 @@ static HXML xmlapiParseFile(LPCTSTR str, int* datalen, LPCTSTR tag) return (res.error == eXMLErrorNone || (tag != NULL && res.error == eXMLErrorMissingEndTag)) ? result.detach() : NULL;
}
-static HXML xmlapiParseString(LPCTSTR str, int* datalen, LPCTSTR tag)
+MIR_APP_DLL(HXML) xmlParseString(LPCTSTR str, int* datalen, LPCTSTR tag)
{
if (str == NULL) return NULL;
@@ -64,7 +64,7 @@ static HXML xmlapiParseString(LPCTSTR str, int* datalen, LPCTSTR tag) return (res.error == eXMLErrorNone || (tag != NULL && res.error == eXMLErrorMissingEndTag)) ? result.detach() : NULL;
}
-static HXML xmlapiAddChild(HXML _n, LPCTSTR name, LPCTSTR text)
+MIR_APP_DLL(HXML) xmlAddChild(HXML _n, LPCTSTR name, LPCTSTR text)
{
XMLNode result = XMLNode(_n).addChild(name);
if (text != NULL)
@@ -72,158 +72,158 @@ static HXML xmlapiAddChild(HXML _n, LPCTSTR name, LPCTSTR text) return result;
}
-static void xmlapiAddChild2(HXML _child, HXML _parent)
+MIR_APP_DLL(void) xmlAddChild2(HXML _child, HXML _parent)
{
XMLNode child(_child), parent(_parent);
parent.addChild(child);
}
-static HXML xmlapiCopyNode(HXML _n)
+MIR_APP_DLL(HXML) xmlCopyNode(HXML _n)
{
XMLNode result = XMLNode(_n);
return result.detach();
}
-static LPCTSTR xmlapiGetAttr(HXML _n, int i)
+MIR_APP_DLL(LPCTSTR) xmlGetAttr(HXML _n, int i)
{
return XMLNode(_n).getAttributeValue(i);
}
-static int xmlapiGetAttrCount(HXML _n)
+MIR_APP_DLL(int) xmlGetAttrCount(HXML _n)
{
return XMLNode(_n).nAttribute();
}
-static LPCTSTR xmlapiGetAttrName(HXML _n, int i)
+MIR_APP_DLL(LPCTSTR) xmlGetAttrName(HXML _n, int i)
{
return XMLNode(_n).getAttributeName(i);
}
-static HXML xmlapiGetChild(HXML _n, int i)
+MIR_APP_DLL(HXML) xmlGetChild(HXML _n, int i)
{
return XMLNode(_n).getChildNode(i);
}
-static HXML xmlapiGetChildByAttrValue(HXML _n, LPCTSTR name, LPCTSTR attrName, LPCTSTR attrValue)
+MIR_APP_DLL(HXML) xmlGetChildByAttrValue(HXML _n, LPCTSTR name, LPCTSTR attrName, LPCTSTR attrValue)
{
return XMLNode(_n).getChildNodeWithAttribute(name, attrName, attrValue);
}
-static int xmlapiGetChildCount(HXML _n)
+MIR_APP_DLL(int) xmlGetChildCount(HXML _n)
{
return XMLNode(_n).nChildNode();
}
-static HXML xmlapiGetFirstChild(HXML _n)
+MIR_APP_DLL(HXML) xmlGetFirstChild(HXML _n)
{
return XMLNode(_n).getChildNode(0);
}
-static HXML xmlapiGetNthChild(HXML _n, LPCTSTR name, int i)
+MIR_APP_DLL(HXML) xmlGetNthChild(HXML _n, LPCTSTR name, int i)
{
return XMLNode(_n).getChildNode(name, i);
}
-static HXML xmlapiGetNextChild(HXML _n, LPCTSTR name, int* i)
+MIR_APP_DLL(HXML) xmlGetNextChild(HXML _n, LPCTSTR name, int* i)
{
return XMLNode(_n).getChildNode(name, i);
}
-static HXML xmlapiGetNextNode(HXML _n)
+MIR_APP_DLL(HXML) xmlGetNextNode(HXML _n)
{
return XMLNode(_n).getNextNode();
}
-static HXML xmlapiGetChildByPath(HXML _n, LPCTSTR path, char createNodeIfMissing)
+MIR_APP_DLL(HXML) xmlGetChildByPath(HXML _n, LPCTSTR path, char createNodeIfMissing)
{
return XMLNode(_n).getChildNodeByPath(path, createNodeIfMissing);
}
-static LPCTSTR xmlapiGetName(HXML _n)
+MIR_APP_DLL(LPCTSTR) xmlGetName(HXML _n)
{
return XMLNode(_n).getName();
}
-static HXML xmlapiGetParent(HXML _n)
+MIR_APP_DLL(HXML) xmlGetParent(HXML _n)
{
return XMLNode(_n).getParentNode();
}
-static LPCTSTR xmlapiGetText(HXML _n)
+MIR_APP_DLL(LPCTSTR) xmlGetText(HXML _n)
{
return XMLNode(_n).getInnerText();
}
-static LPCTSTR xmlapiGetAttrValue(HXML _n, LPCTSTR attrName)
+MIR_APP_DLL(LPCTSTR) xmlGetAttrValue(HXML _n, LPCTSTR attrName)
{
return XMLNode(_n).getAttribute(attrName);
}
-static void xmlapiSetText(HXML _n, LPCTSTR _text)
+MIR_APP_DLL(void) xmlSetText(HXML _n, LPCTSTR _text)
{
XMLNode(_n).updateText(_text);
}
-static LPTSTR xmlapiToString(HXML _n, int* datalen)
+MIR_APP_DLL(LPTSTR) xmlToString(HXML _n, int* datalen)
{
return XMLNode(_n).createXMLString(0, datalen);
}
-static XMLError xmlapiToFile(HXML _n, LPCTSTR filename, int withformatting)
+MIR_APP_DLL(XMLError) xmlToFile(HXML _n, LPCTSTR filename, int withformatting)
{
return XMLNode(_n).writeToFile(filename, NULL, withformatting);
}
-static void xmlapiAddAttr(HXML _n, LPCTSTR attrName, LPCTSTR attrValue)
+MIR_APP_DLL(void) xmlAddAttr(HXML _n, LPCTSTR attrName, LPCTSTR attrValue)
{
if (attrName != NULL && attrValue != NULL)
XMLNode(_n).addAttribute(attrName, attrValue);
}
-static void xmlapiAddAttrInt(HXML _n, LPCTSTR attrName, int attrValue)
+MIR_APP_DLL(void) xmlAddAttrInt(HXML _n, LPCTSTR attrName, int attrValue)
{
TCHAR buf[40];
_itot(attrValue, buf, 10);
XMLNode(_n).addAttribute(attrName, buf);
}
-static void xmlapiFree(void* p)
+MIR_APP_DLL(void) xmlFree(void* p)
{
free(p);
}
-// XML API v2 methods
-static int xmlapiGetTextCount(HXML _n)
+//) xml API v2 methods
+MIR_APP_DLL(int) xmlGetTextCount(HXML _n)
{
return XMLNode(_n).nText();
}
-static LPCTSTR xmlapiGetTextByIndex(HXML _n, int i)
+MIR_APP_DLL(LPCTSTR) xmlGetTextByIndex(HXML _n, int i)
{
return XMLNode(_n).getText(i);
}
-static void xmlapiSetTextByIndex(HXML _n, int i, LPCTSTR value)
+MIR_APP_DLL(void) xmlSetTextByIndex(HXML _n, int i, LPCTSTR value)
{
XMLNode(_n).updateText(value, i);
}
-static void xmlapiAddText(HXML _n, LPCTSTR value, XML_ELEMENT_POS pos)
+MIR_APP_DLL(void) xmlAddText(HXML _n, LPCTSTR value, XML_ELEMENT_POS pos)
{
XMLNode(_n).addText(value, (XMLElementPosition)pos);
}
-static LPTSTR xmlapiToStringWithFormatting(HXML _n, int* datalen)
+MIR_APP_DLL(LPTSTR) xmlToStringWithFormatting(HXML _n, int* datalen)
{
return XMLNode(_n).createXMLString(1, datalen);
}
-static int xmlapiGetClearCount(HXML _n)
+MIR_APP_DLL(int) xmlGetClearCount(HXML _n)
{
return XMLNode(_n).nClear();
}
-static LPCTSTR xmlapiGetClear(HXML _n, int i, LPCTSTR *openTag, LPCTSTR *closeTag)
+MIR_APP_DLL(LPCTSTR) xmlGetClear(HXML _n, int i, LPCTSTR *openTag, LPCTSTR *closeTag)
{
XMLClear c = XMLNode(_n).getClear(i);
if (openTag)
@@ -233,17 +233,17 @@ static LPCTSTR xmlapiGetClear(HXML _n, int i, LPCTSTR *openTag, LPCTSTR *closeTa return c.lpszValue;
}
-static void xmlapiAddClear(HXML _n, LPCTSTR lpszValue, LPCTSTR openTag, LPCTSTR closeTag, XML_ELEMENT_POS pos)
+MIR_APP_DLL(void) xmlAddClear(HXML _n, LPCTSTR lpszValue, LPCTSTR openTag, LPCTSTR closeTag, XML_ELEMENT_POS pos)
{
XMLNode(_n).addClear(lpszValue, openTag, closeTag, (XMLElementPosition)pos);
}
-static void xmlapiSetClear(HXML _n, int i, LPCTSTR lpszValue)
+MIR_APP_DLL(void) xmlSetClear(HXML _n, int i, LPCTSTR lpszValue)
{
XMLNode(_n).updateClear(lpszValue, i);
}
-static int xmlapiGetElement(HXML _n, XML_ELEMENT_POS pos, XML_ELEMENT_TYPE *type, HXML *child, LPCTSTR *value, LPCTSTR *name, LPCTSTR *openTag, LPCTSTR *closeTag)
+MIR_APP_DLL(int) xmlGetElement(HXML _n, XML_ELEMENT_POS pos, XML_ELEMENT_TYPE *type, HXML *child, LPCTSTR *value, LPCTSTR *name, LPCTSTR *openTag, LPCTSTR *closeTag)
{
// reset all values
if (child)
@@ -259,209 +259,126 @@ static int xmlapiGetElement(HXML _n, XML_ELEMENT_POS pos, XML_ELEMENT_TYPE *type if (!type || pos >= XMLNode(_n).nElement())
return false;
+
XMLNodeContents c(XMLNode(_n).enumContents((XMLElementPosition)pos));
switch (c.etype) {
- case eNodeChild:
- {
- *type = XML_ELEM_TYPE_CHILD;
- if (child)
- *child = c.child;
- } break;
- case eNodeAttribute:
- {
- *type = XML_ELEM_TYPE_ATTRIBUTE;
- if (name)
- *name = c.attrib.lpszName;
- if (value)
- *value = c.attrib.lpszValue;
- } break;
- case eNodeText:
- {
- *type = XML_ELEM_TYPE_TEXT;
- if (value)
- *value = c.text;
- } break;
- case eNodeClear:
- {
- *type = XML_ELEM_TYPE_CLEAR;
- if (value)
- *value = c.clear.lpszValue;
- if (openTag)
- *openTag = c.clear.lpszOpenTag;
- if (closeTag)
- *closeTag = c.clear.lpszCloseTag;
- } break;
- case eNodeNULL:
- {
- return false;
- } break;
+ case eNodeChild:
+ *type = XML_ELEM_TYPE_CHILD;
+ if (child)
+ *child = c.child;
+ break;
+
+ case eNodeAttribute:
+ *type = XML_ELEM_TYPE_ATTRIBUTE;
+ if (name)
+ *name = c.attrib.lpszName;
+ if (value)
+ *value = c.attrib.lpszValue;
+ break;
+
+ case eNodeText:
+ *type = XML_ELEM_TYPE_TEXT;
+ if (value)
+ *value = c.text;
+ break;
+
+ case eNodeClear:
+ *type = XML_ELEM_TYPE_CLEAR;
+ if (value)
+ *value = c.clear.lpszValue;
+ if (openTag)
+ *openTag = c.clear.lpszOpenTag;
+ if (closeTag)
+ *closeTag = c.clear.lpszCloseTag;
+ break;
+
+ case eNodeNULL:
+ return false;
}
return true;
}
-static int xmlapiGetElementCount(HXML _n)
+MIR_APP_DLL(int) xmlGetElementCount(HXML _n)
{
return XMLNode(_n).nElement();
}
-static char xmlapiIsDeclaration(HXML _n)
+MIR_APP_DLL(char) xmlIsDeclaration(HXML _n)
{
return XMLNode(_n).isDeclaration();
}
-static HXML xmlapiDeepCopy(HXML _n)
+MIR_APP_DLL(HXML) xmlDeepCopy(HXML _n)
{
return XMLNode(_n).deepCopy().detach();
}
-static HXML xmlapiAddChildEx(HXML _n, LPCTSTR name, char isDeclaration, XML_ELEMENT_POS pos)
+MIR_APP_DLL(HXML) xmlAddChildEx(HXML _n, LPCTSTR name, char isDeclaration, XML_ELEMENT_POS pos)
{
return XMLNode(_n).addChild(name, isDeclaration, (XMLElementPosition)pos);
}
-static void xmlapiAddChildEx2(HXML _n, HXML parent, XML_ELEMENT_POS pos)
+MIR_APP_DLL(void) xmlAddChildEx2(HXML _n, HXML parent, XML_ELEMENT_POS pos)
{
XMLNode(_n).addChild(parent, (XMLElementPosition)pos);
}
-static void xmlapiSetAttrByIndex(HXML _n, int i, LPCTSTR value)
+MIR_APP_DLL(void) xmlSetAttrByIndex(HXML _n, int i, LPCTSTR value)
{
XMLNode(_n).updateAttribute(value, NULL, i);
}
-static void xmlapiSetAttrByName(HXML _n, LPCTSTR name, LPCTSTR value)
+MIR_APP_DLL(void) xmlSetAttrByName(HXML _n, LPCTSTR name, LPCTSTR value)
{
XMLNode(_n).updateAttribute(value, NULL, name);
}
-static void xmlapiDeleteNodeContent(HXML _n)
+MIR_APP_DLL(void) xmlDeleteNodeContent(HXML _n)
{
XMLNode(_n).deleteNodeContent();
}
-static void xmlapiDeleteAttrByIndex(HXML _n, int i)
+MIR_APP_DLL(void) xmlDeleteAttrByIndex(HXML _n, int i)
{
XMLNode(_n).deleteAttribute(i);
}
-static void xmlapiDeleteAttrByName(HXML _n, LPCTSTR name)
+MIR_APP_DLL(void) xmlDeleteAttrByName(HXML _n, LPCTSTR name)
{
XMLNode(_n).deleteAttribute(name);
}
-static void xmlapiDeleteText(HXML _n, int i)
+MIR_APP_DLL(void) xmlDeleteText(HXML _n, int i)
{
XMLNode(_n).deleteText(i);
}
-static void xmlapiDeleteClear(HXML _n, int i)
+MIR_APP_DLL(void) xmlDeleteClear(HXML _n, int i)
{
XMLNode(_n).deleteClear(i);
}
-static XML_ELEMENT_POS xmlapiPositionOfText(HXML _n, int i)
+MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfText(HXML _n, int i)
{
return (XML_ELEMENT_POS)XMLNode(_n).positionOfText(i);
}
-static XML_ELEMENT_POS xmlapiPositionOfClear(HXML _n, int i)
+MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfClear(HXML _n, int i)
{
return (XML_ELEMENT_POS)XMLNode(_n).positionOfClear(i);
}
-static XML_ELEMENT_POS xmlapiPositionOfChildByIndex(HXML _n, int i)
+MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfChildByIndex(HXML _n, int i)
{
return (XML_ELEMENT_POS)XMLNode(_n).positionOfChildNode(i);
}
-static XML_ELEMENT_POS xmlapiPositionOfChildByNode(HXML _n, HXML child)
+MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfChildByNode(HXML _n, HXML child)
{
return (XML_ELEMENT_POS)XMLNode(_n).positionOfChildNode(child);
}
-static XML_ELEMENT_POS xmlapiPositionOfChildByName(HXML _n, LPCTSTR name, int i)
+MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfChildByName(HXML _n, LPCTSTR name, int i)
{
return (XML_ELEMENT_POS)XMLNode(_n).positionOfChildNode(name, i);
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR GetXmlApi(WPARAM, LPARAM lParam)
-{
- XML_API* xi = (XML_API*)lParam;
- if (xi == NULL)
- return FALSE;
-
- if (xi->cbSize != XML_API_SIZEOF_V1 && xi->cbSize != sizeof(XML_API))
- return FALSE;
-
- xi->createNode = xmlapiCreateNode;
- xi->destroyNode = xmlapiDestroyNode;
-
- xi->parseString = xmlapiParseString;
- xi->toString = xmlapiToString;
- xi->freeMem = xmlapiFree;
- xi->parseFile = xmlapiParseFile;
- xi->toFile = xmlapiToFile;
-
- xi->addChild = xmlapiAddChild;
- xi->addChild2 = xmlapiAddChild2;
- xi->copyNode = xmlapiCopyNode;
- xi->getChild = xmlapiGetChild;
- xi->getChildByAttrValue = xmlapiGetChildByAttrValue;
- xi->getChildCount = xmlapiGetChildCount;
- xi->getFirstChild = xmlapiGetFirstChild;
- xi->getNthChild = xmlapiGetNthChild;
- xi->getNextChild = xmlapiGetNextChild;
- xi->getNextNode = xmlapiGetNextNode;
- xi->getChildByPath = xmlapiGetChildByPath;
- xi->getName = xmlapiGetName;
- xi->getParent = xmlapiGetParent;
- xi->getText = xmlapiGetText;
- xi->setText = xmlapiSetText;
-
- xi->getAttr = xmlapiGetAttr;
- xi->getAttrCount = xmlapiGetAttrCount;
- xi->getAttrName = xmlapiGetAttrName;
- xi->getAttrValue = xmlapiGetAttrValue;
- xi->addAttr = xmlapiAddAttr;
- xi->addAttrInt = xmlapiAddAttrInt;
-
- if (xi->cbSize > XML_API_SIZEOF_V1) {
- xi->isDeclaration = xmlapiIsDeclaration;
- xi->toStringWithFormatting = xmlapiToStringWithFormatting;
- xi->deepCopy = xmlapiDeepCopy;
- xi->setAttrByIndex = xmlapiSetAttrByIndex;
- xi->setAttrByName = xmlapiSetAttrByName;
- xi->addChildEx = xmlapiAddChildEx;
- xi->addChildEx2 = xmlapiAddChildEx2;
- xi->getTextCount = xmlapiGetTextCount;
- xi->getTextByIndex = xmlapiGetTextByIndex;
- xi->addText = xmlapiAddText;
- xi->setTextByIndex = xmlapiSetTextByIndex;
- xi->getClearCount = xmlapiGetClearCount;
- xi->getClear = xmlapiGetClear;
- xi->addClear = xmlapiAddClear;
- xi->setClear = xmlapiSetClear;
- xi->getElementCount = xmlapiGetElementCount;
- xi->getElement = xmlapiGetElement;
-
- xi->deleteNodeContent = xmlapiDeleteNodeContent;
- xi->deleteAttrByIndex = xmlapiDeleteAttrByIndex;
- xi->deleteAttrByName = xmlapiDeleteAttrByName;
- xi->deleteText = xmlapiDeleteText;
- xi->deleteClear = xmlapiDeleteClear;
-
- xi->positionOfChildByIndex = xmlapiPositionOfChildByIndex;
- xi->positionOfChildByNode = xmlapiPositionOfChildByNode;
- xi->positionOfChildByName = xmlapiPositionOfChildByName;
- xi->positionOfText = xmlapiPositionOfText;
- xi->positionOfClear = xmlapiPositionOfClear;
- }
- return TRUE;
-}
-
-void InitXmlApi(void)
-{
- CreateServiceFunction(MS_SYSTEM_GET_XI, GetXmlApi);
-}
|