|
gwenhywfar
5.6.0
|
#include "xml_p.h"#include "xmlctx_l.h"#include "i18n_l.h"#include <gwenhywfar/debug.h>#include <gwenhywfar/misc.h>#include <gwenhywfar/text.h>#include <gwenhywfar/path.h>#include <gwenhywfar/fastbuffer.h>#include <gwenhywfar/syncio_file.h>#include <gwenhywfar/syncio_memory.h>#include <stdlib.h>#include <assert.h>#include <string.h>#include <ctype.h>#include <sys/types.h>#include <errno.h>#include "xmlrw.c"#include "xmlglobalize.c"
Go to the source code of this file.
Macros | |
| #define | DISABLE_DEBUGLOG |
| #define | GWEN_XML_BUFFERSIZE 512 |
| int GWEN_XML_AddNameSpace | ( | GWEN_STRINGLIST2 * | sl, |
| const char * | prefix, | ||
| const char * | name | ||
| ) |
Definition at line 1384 of file xml.c.
References GWEN_Buffer_AppendByte(), GWEN_Buffer_AppendString(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_StringList2_AppendString(), and GWEN_StringList2_IntertMode_NoDouble.
Referenced by GWEN_XMLNode__CheckNameSpaceDecls1().


| const char* GWEN_XML_FindNameSpace | ( | GWEN_STRINGLIST2 * | sl, |
| const char * | prefix, | ||
| const char * | name | ||
| ) |
Definition at line 1461 of file xml.c.
References GWEN_Buffer_AppendByte(), GWEN_Buffer_AppendString(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_StringList2_First(), GWEN_StringList2Iterator_Data(), GWEN_StringList2Iterator_free(), and GWEN_StringList2Iterator_Next().

| const char* GWEN_XML_FindNameSpaceByName | ( | GWEN_STRINGLIST2 * | sl, |
| const char * | s | ||
| ) |
Definition at line 1431 of file xml.c.
References GWEN_StringList2_First(), GWEN_StringList2Iterator_Data(), GWEN_StringList2Iterator_free(), and GWEN_StringList2Iterator_Next().
Referenced by GWEN_XMLNode__CheckNameSpaceDecls1().


| const char* GWEN_XML_FindNameSpaceByPrefix | ( | GWEN_STRINGLIST2 * | sl, |
| const char * | s | ||
| ) |
Definition at line 1404 of file xml.c.
References GWEN_StringList2_First(), GWEN_StringList2Iterator_Data(), GWEN_StringList2Iterator_free(), and GWEN_StringList2Iterator_Next().

| int GWEN_XMLNode__CheckAndSetNameSpace | ( | GWEN_XMLNODE * | n, |
| const char * | prefix, | ||
| const char * | nspace | ||
| ) |
Definition at line 1612 of file xml.c.
References DBG_DEBUG, GWEN_Buffer_AppendByte(), GWEN_Buffer_AppendString(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_LOGDOMAIN, GWEN_XMLNode__SetProperty(), and GWEN_XMLNode_GetProperty().
Referenced by GWEN_XMLNode__SetNameSpaces().


| int GWEN_XMLNode__CheckNameSpaceDecls1 | ( | GWEN_XMLNODE * | n, |
| GWEN_STRINGLIST2 * | sl, | ||
| const char * | currentNameSpace | ||
| ) |
Definition at line 1502 of file xml.c.
References DBG_ERROR, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_LOGDOMAIN, GWEN_Memory_dealloc(), GWEN_Memory_strdup(), GWEN_XML_AddNameSpace(), GWEN_XML_FindNameSpaceByName(), GWEN_XMLNode_GetFirstTag(), GWEN_XMLNode_GetNextTag(), GWEN_XMLNode_GetXPath(), GWEN_XMLProperty_del(), and GWEN_XMLProperty_free().
Referenced by GWEN_XMLNode_NormalizeNameSpaces().


| int GWEN_XMLNode__CheckNameSpaceDecls3 | ( | GWEN_XMLNODE * | n | ) |
Definition at line 1720 of file xml.c.
References DBG_DEBUG, GWEN_LOGDOMAIN, GWEN_XMLNode__SetNameSpaces(), GWEN_XMLNode_GetFirstTag(), GWEN_XMLNode_GetNextTag(), GWEN_XMLProperty_del(), and GWEN_XMLProperty_free().
Referenced by GWEN_XMLNode_NormalizeNameSpaces().


| int GWEN_XMLNode__SetNameSpaces | ( | GWEN_XMLNODE * | n, |
| const char * | prefix, | ||
| const char * | nspace | ||
| ) |
Definition at line 1689 of file xml.c.
References GWEN_XMLNode__CheckAndSetNameSpace(), GWEN_XMLNode_GetFirstTag(), and GWEN_XMLNode_GetNextTag().
Referenced by GWEN_XMLNode__CheckNameSpaceDecls3().


| void GWEN_XMLNode__SetProperty | ( | GWEN_XMLNODE * | n, |
| const char * | name, | ||
| const char * | value, | ||
| int | doInsert | ||
| ) |
Definition at line 290 of file xml.c.
References GWEN_Memory_dealloc(), GWEN_Memory_strdup(), GWEN_XMLProperty_add(), GWEN_XMLProperty_insert(), and GWEN_XMLProperty_new().
Referenced by GWEN_XMLNode__CheckAndSetNameSpace(), GWEN_XMLNode_SetIntProperty(), and GWEN_XMLNode_SetProperty().


| void GWEN_XMLNode_AddChild | ( | GWEN_XMLNODE * | n, |
| GWEN_XMLNODE * | child | ||
| ) |
Adds a node as a child to another one. This function does not make deep copies. Instead it takes over ownership of the new child.
| n | node to which the new node is to be added (i.e. the node which becomes the parent of the second argument) |
| child | child which is to be added (this function takes over ownership of that node, so you MUST NOT free the node yourself) |
Definition at line 423 of file xml.c.
References GWEN_XMLNode_List_Add().
Referenced by _moveSubTagsUpOneLevel(), addDefinitions(), GWEN_DBIO_XmlDb__ExportGroup(), GWEN_DBIO_XmlDb__ExportVar(), GWEN_MsgEngine__ListElement(), GWEN_MsgEngine__ListGroup(), GWEN_MsgEngine_AddDefinitions(), GWEN_Param_List_WriteValuesToXml(), GWEN_Param_List_WriteXml(), GWEN_Param_WriteXml(), GWEN_XmlCtxStore_AddData(), GWEN_XmlCtxStore_StartTag(), GWEN_XMLNode_AddChildrenOnly(), GWEN_XMLNode_dup(), GWEN_XMLNode_HandlePath(), GWEN_XMLNode_SetCharValue(), GWEN_XMLNode_SetCharValueByPath(), and main().


| void GWEN_XMLNode_AddChildrenOnly | ( | GWEN_XMLNODE * | n, |
| GWEN_XMLNODE * | nn, | ||
| int | copythem | ||
| ) |
Adds the children of the second argument as new children to the first one.
| n | node which is to become parent of the second argument's children |
| nn | node whose children are to be moved. |
| copythem | if 0 then the children will be moved (leaving the node of the second argument without children), otherwise deep copies will be made and the node from the second argument will not be altered. co |
Definition at line 432 of file xml.c.
References GWEN_XMLNode_AddChild(), GWEN_XMLNode_dup(), GWEN_XMLNode_GetChild(), GWEN_XMLNode_Next(), and GWEN_XMLNode_UnlinkChild().

| void GWEN_XMLNode_AddHeader | ( | GWEN_XMLNODE * | root, |
| GWEN_XMLNODE * | nh | ||
| ) |
Adds a node as a header to the given root node.
Definition at line 1291 of file xml.c.
References GWEN_XMLNode_List_Add().
Referenced by GWEN_DBIO_XmlDb_Export(), GWEN_XmlCtxStore_StartTag(), GWEN_XMLNode_dup(), and main().


| void GWEN_XMLNode_AddNameSpace | ( | GWEN_XMLNODE * | n, |
| const GWEN_XMLNODE_NAMESPACE * | ns | ||
| ) |
Definition at line 1367 of file xml.c.
References GWEN_XMLNode_NameSpace_dup(), and GWEN_XMLNode_NameSpace_List_Add().
Referenced by GWEN_XmlCtxStore_AddAttr().


| void GWEN_XMLNode_ClearHeaders | ( | GWEN_XMLNODE * | root | ) |
Clears the given root nodes' list of headers. All the tags in the header list are also freed.
Definition at line 1309 of file xml.c.
References GWEN_XMLNode_List_Clear().

| void GWEN_XMLNode_CopyProperties | ( | GWEN_XMLNODE * | tn, |
| const GWEN_XMLNODE * | sn, | ||
| int | overwrite | ||
| ) |
This function copies the properties/attributes of one tag/element to another one.
| tn | destination node (must be a tag/element) |
| sn | source node (must be a tag/element) |
| overwrite | if !=0 then existing properties/attributes in the destination node will be overwritten. |
Definition at line 588 of file xml.c.
References GWEN_Memory_dealloc(), GWEN_Memory_strdup(), GWEN_XMLProperty_add(), and GWEN_XMLProperty_dup().
Referenced by GWEN_MsgEngine__ListGroup().


| void GWEN_XMLNode_DecUsage | ( | GWEN_XMLNODE * | n | ) |
Definition at line 350 of file xml.c.
References DBG_WARN, and GWEN_LOGDOMAIN.
| void GWEN_XMLNode_DelHeader | ( | GWEN_XMLNODE * | root, |
| GWEN_XMLNODE * | nh | ||
| ) |
Removes a node from the given root nodes' header list. The header node is just removed from the list, not freed !
Definition at line 1300 of file xml.c.
References GWEN_XMLNode_List_Del().

| void GWEN_XMLNode_Dump | ( | const GWEN_XMLNODE * | n, |
| int | ind | ||
| ) |
Dumps the content of the given XML node and all its children.
Definition at line 472 of file xml.c.
References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_XMLNode_GetChild(), GWEN_XMLNode_Next(), GWEN_XMLNodeTypeComment, GWEN_XMLNodeTypeData, and GWEN_XMLNodeTypeTag.
Referenced by _groupReadElement(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__ReadValue(), GWEN_MsgEngine__WriteGroup(), GWEN_Widget_ReadXml(), and GWEN_XMLNode_Path_Dump().


| GWEN_XMLNODE* GWEN_XMLNode_dup | ( | const GWEN_XMLNODE * | n | ) |
Create and return a deep copy of the given node.
Definition at line 187 of file xml.c.
References GWEN_XMLNode_AddChild(), GWEN_XMLNode_AddHeader(), GWEN_XMLNode_List_First(), GWEN_XMLNode_NameSpace_dup(), GWEN_XMLNode_NameSpace_List_Add(), GWEN_XMLNode_NameSpace_List_First(), GWEN_XMLNode_NameSpace_List_Next(), GWEN_XMLNode_new(), GWEN_XMLNode_Next(), GWEN_XMLProperty_add(), and GWEN_XMLProperty_dup().
Referenced by addDefinitions(), GWEN_MsgEngine__ListElement(), GWEN_MsgEngine__ListGroup(), GWEN_MsgEngine_AddDefinitions(), GWEN_MsgEngine_ListMessage(), GWEN_PluginDescription_dup(), GWEN_PluginDescription_new(), and GWEN_XMLNode_AddChildrenOnly().


| GWEN_XMLNODE* GWEN_XMLNode_FindFirstTag | ( | const GWEN_XMLNODE * | n, |
| const char * | tname, | ||
| const char * | pname, | ||
| const char * | pvalue | ||
| ) |
Searches for the first matching tag/element below the given one. Lets say you have the following XML file:
If you are looking for a device called "dev2" then you should call this function like this:
| n | tag/element below which to search |
| tname | tag/element name (e.g. if the tag is "<TESTTAG>" then the tag name is "TESTTAG"). Wildcards (like "*") are allowed. |
| pname | name of the property/attribute to check (if 0 then no property/attribute comparison takes place). No wildcards allowed. |
| pvalue | optional value of the property/attribute to compare against, wildcards allowed. |
Definition at line 736 of file xml.c.
References GWEN_XMLNode_FindTag(), and GWEN_XMLNode_GetFirstTag().
Referenced by _handleXmlForEvery(), get_function_name(), get_function_name2(), get_property(), get_typedef(), GWEN_DBIO__XmlDb_ImportVar(), GWEN_DBIO_XmlDb_Import(), GWEN_Dialog__ReadXmlWidget(), GWEN_Dialog_ReadXmlFile(), GWEN_LoadPluginDescrsByType(), GWEN_MsgEngine__GetGroup(), GWEN_Param_List_ReadValuesFromXml(), GWEN_Param_List_ReadXml(), GWEN_Param_ReadXml(), GWEN_PluginDescription__GetLocalizedLongDescrByFormat(), GWEN_PluginDescription__GetLongDescrByFormat(), GWEN_XMLNode_GetCharValue(), GWEN_XMLNode_GetLocalizedCharValue(), GWEN_XMLNode_GetXPath(), GWEN_XMLNode_HandlePath(), Typemaker2_Group_readXml(), Typemaker2_Member_readXml(), Typemaker2_Type_readXml(), Typemaker2_TypeManager_LoadType(), Typemaker2_TypeManager_LoadTypeFile(), Typemaker2_TypeManager_LoadTypeFile2(), Typemaker2_TypeManager_LoadTypeFileNoLookup(), Typemaker2_VirtualFn_readXml(), write_apidoc_c(), write_apidocrec_c(), write_c_enums(), write_code_file_c(), write_code_files_c(), write_code_setget_c(), write_files(), write_h_enums(), write_h_funcs(), write_h_setget_c(), write_ha_file_c(), write_ha_files_c(), write_hl_file_c(), write_hl_files_c(), and write_hp_files_c().


| GWEN_XMLNODE_NAMESPACE* GWEN_XMLNode_FindNameSpaceByName | ( | const GWEN_XMLNODE * | n, |
| const char * | s | ||
| ) |
Definition at line 1325 of file xml.c.
References GWEN_XMLNode_NameSpace_GetName(), GWEN_XMLNode_NameSpace_List_First(), GWEN_XMLNode_NameSpace_List_Next(), and NULL.

| GWEN_XMLNODE_NAMESPACE* GWEN_XMLNode_FindNameSpaceByUrl | ( | const GWEN_XMLNODE * | n, |
| const char * | s | ||
| ) |
Definition at line 1346 of file xml.c.
References GWEN_XMLNode_NameSpace_GetUrl(), GWEN_XMLNode_NameSpace_List_First(), GWEN_XMLNode_NameSpace_List_Next(), and NULL.

| GWEN_XMLNODE* GWEN_XMLNode_FindNextTag | ( | const GWEN_XMLNODE * | n, |
| const char * | tname, | ||
| const char * | pname, | ||
| const char * | pvalue | ||
| ) |
Searches for the next matching tag/element after the given one one the same level (i.e. the returned element has the same parent node as the given element).
Definition at line 754 of file xml.c.
References GWEN_XMLNode_FindTag(), and GWEN_XMLNode_GetNextTag().
Referenced by _handleXmlForEvery(), GWEN_DBIO__XmlDb_ImportVar(), GWEN_Dialog__ReadXmlWidget(), GWEN_Param_List_ReadValuesFromXml(), GWEN_Param_List_ReadXml(), GWEN_PluginDescription__GetLocalizedLongDescrByFormat(), GWEN_PluginDescription__GetLongDescrByFormat(), GWEN_XMLNode_GetCharValue(), GWEN_XMLNode_GetLocalizedCharValue(), GWEN_XMLNode_GetXPath(), GWEN_XMLNode_HandlePath(), Typemaker2_Member_readXml(), Typemaker2_Type_readXml(), Typemaker2_TypeManager_LoadType(), Typemaker2_TypeManager_LoadTypeFile2(), Typemaker2_TypeManager_LoadTypeFileNoLookup(), Typemaker2_VirtualFn_readXml(), write_c_enums(), write_code_file_c(), write_code_files_c(), write_code_setget_c(), write_h_enums(), write_h_funcs(), write_h_setget_c(), write_ha_files_c(), write_hl_files_c(), and write_hp_files_c().


| GWEN_XMLNODE* GWEN_XMLNode_FindNode | ( | const GWEN_XMLNODE * | n, |
| GWEN_XMLNODE_TYPE | t, | ||
| const char * | data | ||
| ) |
This is a very primitive function. It looks for a node of the given type and data matching the given one (case-insensitive) below the given node (i.e. if a node is returned it will be a child of the given one).
Definition at line 543 of file xml.c.
References DBG_DEBUG, GWEN_LOGDOMAIN, GWEN_XMLNode_GetChild(), and GWEN_XMLNode_Next().
Referenced by addDefinitions(), and GWEN_MsgEngine_AddDefinitions().


| GWEN_XMLNODE* GWEN_XMLNode_FindTag | ( | const GWEN_XMLNODE * | n, |
| const char * | tname, | ||
| const char * | pname, | ||
| const char * | pvalue | ||
| ) |
Definition at line 703 of file xml.c.
References GWEN_Text_ComparePattern(), GWEN_XMLNode_GetNextTag(), and GWEN_XMLNode_GetProperty().
Referenced by GWEN_XMLNode_FindFirstTag(), and GWEN_XMLNode_FindNextTag().


| void GWEN_XMLNode_free | ( | GWEN_XMLNODE * | n | ) |
Free the given node (including its children nodes)
Definition at line 160 of file xml.c.
References GWEN_FREE_OBJECT, GWEN_LIST_FINI, GWEN_Memory_dealloc(), GWEN_XMLNode_List_free(), GWEN_XMLNode_NameSpace_List_free(), and GWEN_XMLProperty_freeAll().
Referenced by GWEN_DBIO_XmlDb_Export(), GWEN_DBIO_XmlDb_Import(), GWEN_Dialog_ReadXmlFile(), GWEN_LoadPluginDescrsByType(), GWEN_MsgEngine_free(), GWEN_MsgEngine_ListMessage(), GWEN_MsgEngine_SetDefinitions(), GWEN_PluginDescription_free(), GWEN_XMLNode_freeAll(), GWEN_XMLNode_fromString(), main(), Typemaker2_TypeManager_LoadType(), Typemaker2_TypeManager_LoadTypeFile(), Typemaker2_TypeManager_LoadTypeFile2(), and Typemaker2_TypeManager_LoadTypeFileNoLookup().


| void GWEN_XMLNode_freeAll | ( | GWEN_XMLNODE * | n | ) |
Free the given node and all nodes besides this one. Hmm, this function should not be public, I think I will move it to xml_p.h.
Definition at line 175 of file xml.c.
References GWEN_XMLNode_free(), and GWEN_XMLNode_List_Next().

| const char* GWEN_XMLNode_GetCharValue | ( | const GWEN_XMLNODE * | n, |
| const char * | name, | ||
| const char * | defValue | ||
| ) |
Reads a char value. If no name is given (i.e. name is NULL or empty) then the data returned is that from the first data node below the given node. Otherwise a node with the given name is searched below the given node and its first data node's data is returned.
| n | Node which is expected to contain a node of the specified name |
| name | name of the node below n to be looked up |
| defValue | default value to return if the tag did not exist |
Definition at line 772 of file xml.c.
References GWEN_XMLNode_FindFirstTag(), GWEN_XMLNode_FindNextTag(), and GWEN_XMLNode_GetFirstData().
Referenced by GWEN_Crypt_Token_Context_ReadXml(), GWEN_Crypt_Token_KeyInfo_ReadXml(), GWEN_Param_List_ReadValuesFromXml(), GWEN_Param_ReadXml(), GWEN_PluginDescription_new(), GWEN_XMLNode_GetIntValue(), Typemaker2_Code_ReadXml(), Typemaker2_Inline_fromXml(), Typemaker2_Member_readXml(), Typemaker2_Type_readXml(), and Typemaker2_VirtualFn_readXml().


| const char* GWEN_XMLNode_GetCharValueByPath | ( | GWEN_XMLNODE * | n, |
| const char * | path, | ||
| const char * | defValue | ||
| ) |
Return the string value of an element below the given one, specified by an XPath.
| n | Node which is expected to contain the specified path |
| path | XPath to lookup below the node n |
| defValue | default value to return if the tag did not exist |
Definition at line 941 of file xml.c.
References GWEN_XMLNode_GetFirstData(), and GWEN_XMLNode_GetNodeByXPath().
Referenced by _getCharValueByPath(), and GWEN_XMLNode_GetIntValueByPath().


| GWEN_XMLNODE* GWEN_XMLNode_GetChild | ( | const GWEN_XMLNODE * | n | ) |
INTERNAL. Descends in the XML tree to the first GWEN_XMLNODE below the given node. The returned node may be a tag/element node, or a property/attribute node, or a data node. You will probably prefer to use GWEN_XMLNode_GetFirstTag() instead of this function.
Definition at line 409 of file xml.c.
References GWEN_XMLNode_List_First().
Referenced by addDefinitions(), GWEN_MsgEngine__findInValues(), GWEN_MsgEngine__ListGroup(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__ShowGroup(), GWEN_MsgEngine__WriteGroup(), GWEN_MsgEngine_AddDefinitions(), GWEN_MsgEngine_FindNodeByProperty(), GWEN_MsgEngine_FindNodeByPropertyStrictProto(), GWEN_XMLNode__WriteTagToStream(), GWEN_XMLNode_AddChildrenOnly(), GWEN_XMLNode_Dump(), GWEN_XMLNode_FindNode(), GWEN_XMLNode_GetFirstOfType(), and GWEN_XMLNode_WriteToStream().


| const char* GWEN_XMLNode_GetData | ( | const GWEN_XMLNODE * | n | ) |
Returns the character data of the given node.
Definition at line 370 of file xml.c.
Referenced by _findTagForClosingTagAndcloseAndMoveSubTags(), _handleChildren_fromDb(), _handleChildren_toDb(), addDefinitions(), get_struct_node(), get_struct_property(), GWEN_DBIO__XmlDb_ImportGroup(), GWEN_DBIO__XmlDb_ImportVar(), GWEN_DBIO__XmlDb_ReadDataTags(), GWEN_MsgEngine__findInValues(), GWEN_MsgEngine__GetGroup(), GWEN_MsgEngine__GetInline(), GWEN_MsgEngine__ListGroup(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__ShowGroup(), GWEN_MsgEngine__WriteGroup(), GWEN_MsgEngine_AddDefinitions(), GWEN_MsgEngine_CreateMessageFromNode(), GWEN_MsgEngine_FindNodeByProperty(), GWEN_MsgEngine_FindNodeByPropertyStrictProto(), GWEN_StringList2_fromXml(), GWEN_XmlCtxStore_AddAttr(), GWEN_XmlCtxStore_EndTag(), GWEN_XmlCtxStore_StartTag(), GWEN_XMLGL__GetNameSpaceByPrefix(), GWEN_XMLNode_GetXPath(), GWEN_XMLNode_WriteToStream(), Typemaker2_Header_readXml(), Typemaker2_Type_readMembersAndGroupsXml(), write_apidocrec_c(), write_c_enums(), write_code_constrec_c(), write_code_duprec_c(), write_code_freeElems_c(), write_code_fromdbrec_c(), write_code_setget_c(), write_code_todbrec_c(), write_h_enums(), write_h_header(), write_h_setget_c(), and write_hp_group_c().

| GWEN_XMLNODE* GWEN_XMLNode_GetFirstData | ( | const GWEN_XMLNODE * | n | ) |
Descends in the XML tree to the first children data node below the given node.
Different from GWEN_XMLNode_GetChild() this function only looks for another data node and not for a (more general) node.
Definition at line 684 of file xml.c.
References GWEN_XMLNode_GetFirstOfType(), and GWEN_XMLNodeTypeData.
Referenced by GWEN_DBIO__XmlDb_ReadDataTags(), GWEN_MsgEngine__GetInline(), GWEN_StringList2_fromXml(), GWEN_XMLNode_GetCharValue(), GWEN_XMLNode_GetCharValueByPath(), GWEN_XMLNode_GetLocalizedCharValue(), Typemaker2_Header_readXml(), write_c_enums(), write_h_enums(), and write_h_header().


| GWEN_XMLNODE* GWEN_XMLNode_GetFirstOfType | ( | const GWEN_XMLNODE * | n, |
| GWEN_XMLNODE_TYPE | t | ||
| ) |
Definition at line 634 of file xml.c.
References GWEN_XMLNode_GetChild(), and GWEN_XMLNode_Next().
Referenced by GWEN_XMLNode_GetFirstData(), and GWEN_XMLNode_GetFirstTag().


| GWEN_XMLPROPERTY* GWEN_XMLNode_GetFirstProperty | ( | const GWEN_XMLNODE * | n | ) |
| GWEN_XMLNODE* GWEN_XMLNode_GetFirstTag | ( | const GWEN_XMLNODE * | n | ) |
Descends in the XML tree to the first children tag (in XML notation they are called elements) below the given node.
Different from GWEN_XMLNode_GetChild() this function only looks for another tag/element and not for a (more general) node. You will probably prefer this function instead of GWEN_XMLNode_GetChild().
Definition at line 665 of file xml.c.
References GWEN_XMLNode_GetFirstOfType(), and GWEN_XMLNodeTypeTag.
Referenced by _handleChildren_fromDb(), _handleChildren_toDb(), _moveSubTagsUpOneLevel(), GWEN_DBIO__XmlDb_ImportGroup(), GWEN_DBIO_XmlDb_Import(), GWEN_MsgEngine__GetGroup(), GWEN_StringList2_fromXml(), GWEN_XMLNode__CheckNameSpaceDecls1(), GWEN_XMLNode__CheckNameSpaceDecls3(), GWEN_XMLNode__SetNameSpaces(), GWEN_XMLNode__WriteTagToStream(), GWEN_XMLNode_FindFirstTag(), Typemaker2_Type_readMembersAndGroupsXml(), write_apidocrec_c(), write_code_constrec_c(), write_code_duprec_c(), write_code_freeElems_c(), write_code_fromdbrec_c(), write_code_setget_c(), write_code_todbrec_c(), write_h_setget_c(), write_h_struct_c(), write_ha_file_c(), write_hl_file_c(), and write_hp_group_c().


| GWEN_XMLNODE* GWEN_XMLNode_GetHeader | ( | const GWEN_XMLNODE * | n | ) |
Returns the first header tag of the given node. Use GWEN_XMLNode_Next to get the next header tag.
Definition at line 1283 of file xml.c.
References GWEN_XMLNode_List_First().
Referenced by GWEN_XMLNode_WriteToStream().


| int GWEN_XMLNode_GetIntProperty | ( | const GWEN_XMLNODE * | n, |
| const char * | name, | ||
| int | defaultValue | ||
| ) |
Same as GWEN_XMLNode_GetProperty, but it tries to parse the property as an integer value.
Definition at line 263 of file xml.c.
Referenced by _convertAndSetCharValue(), and Typemaker2_Type_readXml().

| int GWEN_XMLNode_GetIntValue | ( | const GWEN_XMLNODE * | n, |
| const char * | name, | ||
| int | defValue | ||
| ) |
Internally calls GWEN_XMLNode_GetCharValue and interpretes the data as an integer which is then returned.
| n | Node which is expected to contain a node of the specified name |
| name | name of the node below n to be looked up |
| defValue | default value to return if the tag did not exist |
Definition at line 883 of file xml.c.
References GWEN_XMLNode_GetCharValue().
Referenced by GWEN_Crypt_Token_Context_ReadXml(), GWEN_Crypt_Token_KeyInfo_ReadXml(), GWEN_Param_ReadXml(), Typemaker2_Define_ReadXml(), Typemaker2_Signal_ReadXml(), and Typemaker2_Slot_ReadXml().


| int GWEN_XMLNode_GetIntValueByPath | ( | GWEN_XMLNODE * | n, |
| const char * | name, | ||
| int | defValue | ||
| ) |
Return the integer value of an element below the given one, specified by an XPath.
| n | Node which is expected to contain the specified path |
| path | XPath to lookup below the node n |
| defValue | default value to return if the tag did not exist |
Definition at line 985 of file xml.c.
References GWEN_XMLNode_GetCharValueByPath(), and NULL.

| const char* GWEN_XMLNode_GetLocalizedCharValue | ( | const GWEN_XMLNODE * | n, |
| const char * | name, | ||
| const char * | defValue | ||
| ) |
This function does the same as GWEN_XMLNode_GetCharValue, but it looks for an element with the attribute "lang" which matches the currently selected locale (e.g. "lang=de" for Germany). If there is no localized version of the given element then the first element of that name is used (withouth "lang" attribute). Therefore XML documents used with this function should contain unlocalized elements along with localized ones to provide a fallback.
| n | Node which is expected to contain a node of the specified name |
| name | name of the node below n to be looked up |
| defValue | default value to return if the tag did not exist |
Definition at line 806 of file xml.c.
References DBG_DEBUG, GWEN_I18N_GetCurrentLocaleList(), GWEN_LOGDOMAIN, GWEN_StringList_FirstEntry(), GWEN_StringListEntry_Data(), GWEN_StringListEntry_Next(), GWEN_XMLNode_FindFirstTag(), GWEN_XMLNode_FindNextTag(), and GWEN_XMLNode_GetFirstData().

| const char* GWEN_XMLNode_GetNamespace | ( | const GWEN_XMLNODE * | n | ) |
| GWEN_XMLNODE_NAMESPACE_LIST* GWEN_XMLNode_GetNameSpaces | ( | const GWEN_XMLNODE * | n | ) |
| GWEN_XMLNODE* GWEN_XMLNode_GetNextData | ( | const GWEN_XMLNODE * | n | ) |
Iterates on the same level in the XML tree from the given data node to the next one on the same level (i.e. the returned element has the same parent node as the given element). An XML element may have multiple data nodes as children, and you use this function to iterate through all of them.
Different from GWEN_XMLNode_Next() this function only looks for another data node and not for a (more general) node.
Definition at line 691 of file xml.c.
References GWEN_XMLNode_GetNextOfType(), GWEN_XMLNode_Next(), and GWEN_XMLNodeTypeData.
Referenced by GWEN_DBIO__XmlDb_ReadDataTags().


| GWEN_XMLNODE* GWEN_XMLNode_GetNextOfType | ( | const GWEN_XMLNODE * | n, |
| GWEN_XMLNODE_TYPE | t | ||
| ) |
Definition at line 651 of file xml.c.
References GWEN_XMLNode_Next().
Referenced by GWEN_XMLNode_GetNextData(), and GWEN_XMLNode_GetNextTag().


| GWEN_XMLPROPERTY* GWEN_XMLNode_GetNextProperty | ( | const GWEN_XMLNODE * | n, |
| const GWEN_XMLPROPERTY * | pr | ||
| ) |
| GWEN_XMLNODE* GWEN_XMLNode_GetNextTag | ( | const GWEN_XMLNODE * | n | ) |
Iterates on the same level in the XML tree from the given tag (in XML notation they are called elements) to the next one on the same level (i.e. the returned element has the same parent node as the given element).
Different from GWEN_XMLNode_Next() this function only looks for another tag/element and not for a (more general) node. You will probably prefer this function instead of GWEN_XMLNode_Next().
Definition at line 672 of file xml.c.
References GWEN_XMLNode_GetNextOfType(), GWEN_XMLNode_Next(), and GWEN_XMLNodeTypeTag.
Referenced by _handleChildren_fromDb(), _handleChildren_toDb(), GWEN_DBIO__XmlDb_ImportGroup(), GWEN_MsgEngine__GetGroup(), GWEN_StringList2_fromXml(), GWEN_XMLNode__CheckNameSpaceDecls1(), GWEN_XMLNode__CheckNameSpaceDecls3(), GWEN_XMLNode__SetNameSpaces(), GWEN_XMLNode_FindNextTag(), GWEN_XMLNode_FindTag(), Typemaker2_Type_readMembersAndGroupsXml(), write_apidocrec_c(), write_code_constrec_c(), write_code_duprec_c(), write_code_freeElems_c(), write_code_fromdbrec_c(), write_code_setget_c(), write_code_todbrec_c(), write_h_setget_c(), write_h_struct_c(), write_ha_file_c(), write_hl_file_c(), and write_hp_group_c().


| GWEN_XMLNODE* GWEN_XMLNode_GetNodeByXPath | ( | GWEN_XMLNODE * | n, |
| const char * | path, | ||
| uint32_t | flags | ||
| ) |
Locates a tag by its XPath. Currently attributes are not allowed, and the flag GWEN_PATH_FLAGS_VARIABLE is not supported. Supported types of XPaths are:
and so on. As you can see index numbers are supported. You should not use this function to create a node but rather for node lookups.
Definition at line 1271 of file xml.c.
References GWEN_Path_HandleWithIdx(), and GWEN_XMLNode_HandlePath().
Referenced by _getCharValueByPath(), _handleXmlEnter(), _handleXmlIfNotPathExists(), _handleXmlIfPathExists(), _setCharValueByPath(), _xmlCreateAndEnterElement(), GWEN_XMLNode_GetCharValueByPath(), and GWEN_XMLNode_SetCharValueByPath().


| GWEN_XMLNODE* GWEN_XMLNode_GetParent | ( | const GWEN_XMLNODE * | n | ) |
Returns the parent node of the given node, or NULL if it already is the root node.
Definition at line 416 of file xml.c.
Referenced by _findTagForClosingTagAndcloseAndMoveSubTags(), _moveSubTagsUpOneLevel(), get_function_name(), get_function_name2(), get_property(), get_struct_node(), get_struct_property(), get_typedef(), GWEN_MsgEngine_GetGroup(), GWEN_MsgEngine_GetHighestTrustLevel(), GWEN_MsgEngine_SearchForProperty(), GWEN_XmlCtxStore_EndTag(), and GWEN_XmlCtxStore_StartTag().

| const char* GWEN_XMLNode_GetProperty | ( | const GWEN_XMLNODE * | n, |
| const char * | name, | ||
| const char * | defaultValue | ||
| ) |
Returns the value of the given property/attribute (or the default value if the property/attribute does not exist or is empty).
| n | node (must be a tag/element) |
| name | name of the property/attribute |
| defaultValue | default value to be returned if no value could be retrieved |
Definition at line 239 of file xml.c.
Referenced by _convertAndSetCharValue(), _dbEnter(), _dbForEvery(), _dbIfCharDataMatches(), _dbIfHasCharData(), _dbIfNotCharDataMatches(), _dbIfNotHasCharData(), _dbIfNotPathExists(), _dbIfPathExists(), _getCharValueByPath(), _groupReadElement(), _handleDbCreateAndEnterGroup(), _handleDbCreateAndEnterTempGroup(), _handleDbSetCharValue_internal(), _handleXmlEnter(), _handleXmlForEvery(), _handleXmlIfCharDataMatches(), _handleXmlIfHasCharData(), _handleXmlIfNotCharDataMatches(), _handleXmlIfNotHasCharData(), _handleXmlIfNotPathExists(), _handleXmlIfPathExists(), _xmlCreateAndEnterElement(), _xmlSetCharValue(), get_function_name(), get_function_name2(), get_property(), get_struct_property(), GWEN_Crypt_Token_PluginManager_GetPluginDescrs(), GWEN_DBIO__XmlDb_ImportGroup(), GWEN_DBIO__XmlDb_ImportVar(), GWEN_Dialog_ReadXml(), GWEN_LoadPluginDescrsByType(), GWEN_MsgEngine__findInValues(), GWEN_MsgEngine__GetGroup(), GWEN_MsgEngine__GetInline(), GWEN_MsgEngine__ListElement(), GWEN_MsgEngine__ListGroup(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__ReadValue(), GWEN_MsgEngine__SearchForValue(), GWEN_MsgEngine__ShowElement(), GWEN_MsgEngine__ShowGroup(), GWEN_MsgEngine__TransformValue(), GWEN_MsgEngine__WriteElement(), GWEN_MsgEngine__WriteGroup(), GWEN_MsgEngine__WriteValue(), GWEN_MsgEngine_FindNodeByProperty(), GWEN_MsgEngine_FindNodeByPropertyStrictProto(), GWEN_MsgEngine_GetHighestTrustLevel(), GWEN_MsgEngine_ReadMessage(), GWEN_MsgEngine_SearchForProperty(), GWEN_Param_List_ReadValuesFromXml(), GWEN_PluginDescription__GetLocalizedLongDescrByFormat(), GWEN_PluginDescription__GetLongDescrByFormat(), GWEN_PluginDescription_new(), GWEN_Widget_ReadXml(), GWEN_XMLNode__CheckAndSetNameSpace(), GWEN_XMLNode_FindTag(), GWEN_XMLNode_NormalizeNameSpaces(), GWEN_XMLNode_WriteToStream(), Typemaker2_Code_ReadXml(), Typemaker2_Define_ReadXml(), Typemaker2_Enum_ReadXml(), Typemaker2_Group_readXml(), Typemaker2_Header_readXml(), Typemaker2_Inline_fromXml(), Typemaker2_Item_ReadXml(), Typemaker2_Member_readXml(), Typemaker2_Signal_ReadXml(), Typemaker2_Slot_ReadXml(), Typemaker2_Type_readXml(), Typemaker2_TypeManager_LoadType(), Typemaker2_VirtualFn_readXml(), write_apidoc_c(), write_apidocrec_c(), write_c_enums(), write_code_constrec_c(), write_code_dupArg_c(), write_code_dupList_c(), write_code_duprec_c(), write_code_freeElem_c(), write_code_fromdbArg_c(), write_code_fromdbrec_c(), write_code_setget_c(), write_code_todbArg_c(), write_code_todbrec_c(), write_h_elem_c(), write_h_enums(), write_h_func_c(), write_h_funcs(), write_h_header(), and write_h_setget_c().

| GWEN_XMLNODE_TYPE GWEN_XMLNode_GetType | ( | const GWEN_XMLNODE * | n | ) |
Returns the type of the given node.
Definition at line 458 of file xml.c.
Referenced by addDefinitions(), get_struct_node(), get_struct_property(), GWEN_MsgEngine__findInValues(), GWEN_MsgEngine__ListGroup(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__ShowGroup(), GWEN_MsgEngine__WriteGroup(), GWEN_MsgEngine_AddDefinitions(), GWEN_MsgEngine_FindNodeByProperty(), GWEN_MsgEngine_FindNodeByPropertyStrictProto(), write_apidocrec_c(), write_code_constrec_c(), write_code_duprec_c(), write_code_freeElems_c(), write_code_fromdbrec_c(), write_code_setget_c(), write_code_todbrec_c(), write_h_setget_c(), and write_hp_group_c().

| uint32_t GWEN_XMLNode_GetUsage | ( | const GWEN_XMLNODE * | n | ) |
| int GWEN_XMLNode_GetXPath | ( | const GWEN_XMLNODE * | n1, |
| const GWEN_XMLNODE * | n2, | ||
| GWEN_BUFFER * | nbuf | ||
| ) |
Definition at line 1057 of file xml.c.
References DBG_DEBUG, DBG_ERROR, GWEN_Buffer_AppendBuffer(), GWEN_Buffer_AppendString(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_InsertByte(), GWEN_Buffer_InsertString(), GWEN_Buffer_new(), GWEN_Buffer_ReserveBytes(), GWEN_Buffer_Reset(), GWEN_LOGDOMAIN, GWEN_XMLNode_FindFirstTag(), GWEN_XMLNode_FindNextTag(), GWEN_XMLNode_GetData(), and GWEN_XMLNode_IsChildOf().
Referenced by _handleDbSetCharValue_internal(), _xmlSetCharValue(), and GWEN_XMLNode__CheckNameSpaceDecls1().


| void* GWEN_XMLNode_HandlePath | ( | const char * | entry, |
| void * | data, | ||
| int | idx, | ||
| uint32_t | flags | ||
| ) |
Definition at line 1161 of file xml.c.
References DBG_ERROR, DBG_VERBOUS, GWEN_LOGDOMAIN, GWEN_PATH_FLAGS_CREATE_GROUP, GWEN_PATH_FLAGS_CREATE_VAR, GWEN_PATH_FLAGS_LAST, GWEN_PATH_FLAGS_NAMEMUSTEXIST, GWEN_PATH_FLAGS_NAMEMUSTNOTEXIST, GWEN_PATH_FLAGS_PATHCREATE, GWEN_PATH_FLAGS_PATHMUSTEXIST, GWEN_PATH_FLAGS_PATHMUSTNOTEXIST, GWEN_PATH_FLAGS_ROOT, GWEN_PATH_FLAGS_VARIABLE, GWEN_XMLNode_AddChild(), GWEN_XMLNode_FindFirstTag(), GWEN_XMLNode_FindNextTag(), GWEN_XMLNode_new(), and GWEN_XMLNodeTypeTag.
Referenced by GWEN_XMLNode_GetNodeByXPath().


| void GWEN_XMLNode_IncUsage | ( | GWEN_XMLNODE * | n | ) |
| int GWEN_XMLNode_IsChildOf | ( | const GWEN_XMLNODE * | parent, |
| const GWEN_XMLNODE * | child | ||
| ) |
Checks whether the second node is a child of the first one.
Definition at line 1039 of file xml.c.
Referenced by GWEN_XMLNode_GetXPath().

| GWEN_XMLNODE_NAMESPACE* GWEN_XMLNode_NameSpace_dup | ( | const GWEN_XMLNODE_NAMESPACE * | ns | ) |
Definition at line 1981 of file xml.c.
References GWEN_XMLNode_NameSpace_new().
Referenced by GWEN_XMLNode_AddNameSpace(), and GWEN_XMLNode_dup().


| void GWEN_XMLNode_NameSpace_free | ( | GWEN_XMLNODE_NAMESPACE * | ns | ) |
Definition at line 1969 of file xml.c.
References GWEN_FREE_OBJECT, and GWEN_LIST_FINI.
Referenced by GWEN_XmlCtxStore_AddAttr().

| const char* GWEN_XMLNode_NameSpace_GetName | ( | const GWEN_XMLNODE_NAMESPACE * | ns | ) |
Definition at line 1992 of file xml.c.
Referenced by GWEN_XMLGL__GetNameSpaceByPrefix(), GWEN_XMLGL__TranslateName(), GWEN_XMLNode__WriteNamespacesToStream(), and GWEN_XMLNode_FindNameSpaceByName().

| const char* GWEN_XMLNode_NameSpace_GetUrl | ( | const GWEN_XMLNODE_NAMESPACE * | ns | ) |
Definition at line 2000 of file xml.c.
Referenced by GWEN_XMLGL__FindNameSpaceByUrl(), GWEN_XMLGL__SampleNameSpaces(), GWEN_XMLGL__TranslateName(), GWEN_XMLNode__WriteNamespacesToStream(), and GWEN_XMLNode_FindNameSpaceByUrl().

| GWEN_XMLNODE_NAMESPACE* GWEN_XMLNode_NameSpace_new | ( | const char * | name, |
| const char * | url | ||
| ) |
Definition at line 1951 of file xml.c.
References GWEN_LIST_INIT, GWEN_Memory_strdup(), and GWEN_NEW_OBJECT.
Referenced by GWEN_XmlCtxStore_AddAttr(), GWEN_XMLGL__SampleNameSpaces(), and GWEN_XMLNode_NameSpace_dup().


| GWEN_XMLNODE* GWEN_XMLNode_new | ( | GWEN_XMLNODE_TYPE | t, |
| const char * | data | ||
| ) |
Definition at line 144 of file xml.c.
References GWEN_LIST_INIT, GWEN_Memory_strdup(), GWEN_NEW_OBJECT, GWEN_XMLNode_List_new(), and GWEN_XMLNode_NameSpace_List_new().
Referenced by GWEN_DBIO_XmlDb__ExportGroup(), GWEN_DBIO_XmlDb__ExportVar(), GWEN_DBIO_XmlDb_Export(), GWEN_DBIO_XmlDb_Import(), GWEN_Dialog_ReadXmlFile(), GWEN_LoadPluginDescrsByType(), GWEN_Param_List_WriteValuesToXml(), GWEN_Param_List_WriteXml(), GWEN_Param_WriteXml(), GWEN_XmlCtxStore_AddData(), GWEN_XmlCtxStore_StartTag(), GWEN_XMLNode_dup(), GWEN_XMLNode_fromString(), GWEN_XMLNode_HandlePath(), GWEN_XMLNode_SetCharValue(), GWEN_XMLNode_SetCharValueByPath(), main(), Typemaker2_TypeManager_LoadType(), Typemaker2_TypeManager_LoadTypeFile(), Typemaker2_TypeManager_LoadTypeFile2(), and Typemaker2_TypeManager_LoadTypeFileNoLookup().


| GWEN_XMLNODE* GWEN_XMLNode_Next | ( | const GWEN_XMLNODE * | n | ) |
INTERNAL. Iterates on the same level in the XML tree from the given node to the next one on the same level (i.e. the returned node has the same parent node as the given element). The returned node may be a tag/element node, or a property/attribute node, or a data node. You will probably prefer to use GWEN_XMLNode_GetNextTag() instead of this function.
Definition at line 465 of file xml.c.
References GWEN_XMLNode_List_Next().
Referenced by addDefinitions(), GWEN_MsgEngine__findInValues(), GWEN_MsgEngine__ListGroup(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__ShowGroup(), GWEN_MsgEngine__WriteGroup(), GWEN_MsgEngine_AddDefinitions(), GWEN_MsgEngine_FindNodeByProperty(), GWEN_MsgEngine_FindNodeByPropertyStrictProto(), GWEN_XMLNode__WriteTagToStream(), GWEN_XMLNode_AddChildrenOnly(), GWEN_XMLNode_Dump(), GWEN_XMLNode_dup(), GWEN_XMLNode_FindNode(), GWEN_XMLNode_GetFirstOfType(), GWEN_XMLNode_GetNextData(), GWEN_XMLNode_GetNextOfType(), GWEN_XMLNode_GetNextTag(), and GWEN_XMLNode_WriteToStream().


| int GWEN_XMLNode_NormalizeNameSpaces | ( | GWEN_XMLNODE * | n | ) |
This function removes unnecessary namespaces from the given node and all nodes below.
Definition at line 1768 of file xml.c.
References DBG_INFO, GWEN_LOGDOMAIN, GWEN_StringList2_free(), GWEN_StringList2_new(), GWEN_XMLNode__CheckNameSpaceDecls1(), GWEN_XMLNode__CheckNameSpaceDecls3(), and GWEN_XMLNode_GetProperty().

| int GWEN_XMLNode_Path_Dive | ( | GWEN_XMLNODE_PATH * | np, |
| GWEN_XMLNODE * | n | ||
| ) |
Adds a node to the path.
Definition at line 1895 of file xml.c.
References DBG_DEBUG, DBG_ERROR, and GWEN_LOGDOMAIN.
Referenced by GWEN_MsgEngine__WriteGroup(), and GWEN_MsgEngine_CreateMessageFromNode().

| void GWEN_XMLNode_Path_Dump | ( | GWEN_XMLNODE_PATH * | np | ) |
Dumps the contents of all XML nodes in the path.
Definition at line 1928 of file xml.c.
References DBG_NOTICE, GWEN_LOGDOMAIN, and GWEN_XMLNode_Dump().

| GWEN_XMLNODE_PATH* GWEN_XMLNode_Path_dup | ( | const GWEN_XMLNODE_PATH * | np | ) |
Definition at line 1873 of file xml.c.
References GWEN_NEW_OBJECT.
Referenced by GWEN_MsgEngine__WriteElement(), and GWEN_MsgEngine_GetGroup().

| void GWEN_XMLNode_Path_free | ( | GWEN_XMLNODE_PATH * | np | ) |
Definition at line 1888 of file xml.c.
References GWEN_FREE_OBJECT.
Referenced by GWEN_MsgEngine__WriteElement(), GWEN_MsgEngine_CreateMessageFromNode(), and GWEN_MsgEngine_GetGroup().

| GWEN_XMLNODE_PATH* GWEN_XMLNode_Path_new | ( | void | ) |
Definition at line 1863 of file xml.c.
References GWEN_NEW_OBJECT.
Referenced by GWEN_MsgEngine_CreateMessageFromNode().

| GWEN_XMLNODE* GWEN_XMLNode_Path_Surface | ( | GWEN_XMLNODE_PATH * | np | ) |
Removes and returns the last added node (or 0 if that would bring us beyond the root).
Definition at line 1916 of file xml.c.
References DBG_DEBUG, and GWEN_LOGDOMAIN.
Referenced by GWEN_MsgEngine__SearchForValue(), GWEN_MsgEngine__WriteGroup(), and GWEN_MsgEngine_GetGroup().

| void GWEN_XMLNode_RemoveChildren | ( | GWEN_XMLNODE * | n | ) |
Unlinks and frees all children of the given node.
Definition at line 580 of file xml.c.
References GWEN_XMLNode_List_Clear().
Referenced by GWEN_MsgEngine_ListMessage().


| void GWEN_XMLNode_SetCharValue | ( | GWEN_XMLNODE * | n, |
| const char * | name, | ||
| const char * | value | ||
| ) |
Definition at line 857 of file xml.c.
References GWEN_XMLNode_AddChild(), GWEN_XMLNode_new(), GWEN_XMLNodeTypeData, and GWEN_XMLNodeTypeTag.
Referenced by GWEN_Crypt_Token_Context_WriteXml(), GWEN_Crypt_Token_KeyInfo_WriteXml(), GWEN_Param_List_WriteValuesToXml(), GWEN_Param_WriteXml(), GWEN_StringList2_toXml(), GWEN_XMLNode_SetIntValue(), and Typemaker2_Code_WriteXml().


| int GWEN_XMLNode_SetCharValueByPath | ( | GWEN_XMLNODE * | n, |
| uint32_t | flags, | ||
| const char * | name, | ||
| const char * | value | ||
| ) |
Definition at line 913 of file xml.c.
References DBG_ERROR, GWEN_ERROR_INVALID, GWEN_LOGDOMAIN, GWEN_XML_PATH_FLAGS_OVERWRITE_VALUES, GWEN_XMLNode_AddChild(), GWEN_XMLNode_GetNodeByXPath(), GWEN_XMLNode_List_Clear(), GWEN_XMLNode_new(), and GWEN_XMLNodeTypeData.
Referenced by _setCharValueByPath(), and GWEN_XMLNode_SetIntValueByPath().


| void GWEN_XMLNode_SetData | ( | GWEN_XMLNODE * | n, |
| const char * | data | ||
| ) |
Set the character data of the given node to the given value. This function will create a deep copy of the character data.
Definition at line 377 of file xml.c.
References GWEN_Memory_dealloc(), and GWEN_Memory_strdup().

| void GWEN_XMLNode_SetIntProperty | ( | GWEN_XMLNODE * | n, |
| const char * | name, | ||
| int | value | ||
| ) |
Same as GWEN_XMLNode_SetProperty, but for integer values.
Definition at line 330 of file xml.c.
References GWEN_XMLNode__SetProperty().

| void GWEN_XMLNode_SetIntValue | ( | GWEN_XMLNODE * | n, |
| const char * | name, | ||
| int | value | ||
| ) |
Definition at line 900 of file xml.c.
References GWEN_XMLNode_SetCharValue().
Referenced by GWEN_Crypt_Token_Context_WriteXml(), GWEN_Crypt_Token_KeyInfo_WriteXml(), GWEN_Param_WriteXml(), Typemaker2_Define_WriteXml(), Typemaker2_Signal_WriteXml(), and Typemaker2_Slot_WriteXml().


| int GWEN_XMLNode_SetIntValueByPath | ( | GWEN_XMLNODE * | n, |
| uint32_t | flags, | ||
| const char * | name, | ||
| int | value | ||
| ) |
Definition at line 963 of file xml.c.
References DBG_INFO, GWEN_LOGDOMAIN, and GWEN_XMLNode_SetCharValueByPath().

| void GWEN_XMLNode_SetNamespace | ( | GWEN_XMLNODE * | n, |
| const char * | s | ||
| ) |
Definition at line 397 of file xml.c.
References GWEN_Memory_dealloc(), GWEN_Memory_strdup(), and NULL.

| void GWEN_XMLNode_SetProperty | ( | GWEN_XMLNODE * | n, |
| const char * | name, | ||
| const char * | value | ||
| ) |
Sets the value of a property/attribute. This property/attribute will be created if it does not exist and overwritten if it does.
| n | node (must be a tag/element) |
| name | name of the property/attribute |
| value | new value of the property/attribute |
Definition at line 322 of file xml.c.
References GWEN_XMLNode__SetProperty().
Referenced by _setCharValueByPath(), GWEN_DBIO_XmlDb__ExportGroup(), GWEN_DBIO_XmlDb__ExportVar(), GWEN_DBIO_XmlDb_Export(), GWEN_MsgEngine__ListElement(), GWEN_MsgEngine__ListGroup(), GWEN_Param_List_WriteValuesToXml(), GWEN_XmlCtxStore_AddAttr(), main(), Typemaker2_Code_WriteXml(), Typemaker2_Define_WriteXml(), Typemaker2_Enum_WriteXml(), Typemaker2_Item_WriteXml(), Typemaker2_Signal_WriteXml(), and Typemaker2_Slot_WriteXml().


| int GWEN_XMLNode_StripNamespaces | ( | GWEN_XMLNODE * | n | ) |
Definition at line 1792 of file xml.c.
References DBG_DEBUG, GWEN_LOGDOMAIN, GWEN_Memory_malloc(), GWEN_Memory_strdup(), GWEN_XMLNode_List_First(), GWEN_XMLNode_List_Next(), and GWEN_XMLNodeTypeTag.

| void GWEN_XMLNode_UnlinkChild | ( | GWEN_XMLNODE * | n, |
| GWEN_XMLNODE * | child | ||
| ) |
Unlinks the given child node from its parent without freeing it. This function relinquishes the ownership of the child to the caller who thereby becomes responsible for freeing this node.
| n | node which is suspected to be the parent of the second argument |
| child | node which is to be unlinked |
Definition at line 570 of file xml.c.
References GWEN_XMLNode_List_Del().
Referenced by _moveSubTagsUpOneLevel(), and GWEN_XMLNode_AddChildrenOnly().


| void GWEN_XMLProperty_add | ( | GWEN_XMLPROPERTY * | p, |
| GWEN_XMLPROPERTY ** | head | ||
| ) |
Definition at line 111 of file xml.c.
References GWEN_LIST_ADD.
Referenced by GWEN_XMLNode__SetProperty(), GWEN_XMLNode_CopyProperties(), and GWEN_XMLNode_dup().

| void GWEN_XMLProperty_del | ( | GWEN_XMLPROPERTY * | p, |
| GWEN_XMLPROPERTY ** | head | ||
| ) |
Definition at line 124 of file xml.c.
References GWEN_LIST_DEL.
Referenced by GWEN_XMLNode__CheckNameSpaceDecls1(), and GWEN_XMLNode__CheckNameSpaceDecls3().

| GWEN_XMLPROPERTY* GWEN_XMLProperty_dup | ( | const GWEN_XMLPROPERTY * | p | ) |
Definition at line 98 of file xml.c.
References GWEN_XMLProperty_new().
Referenced by GWEN_XMLNode_CopyProperties(), and GWEN_XMLNode_dup().


| void GWEN_XMLProperty_free | ( | GWEN_XMLPROPERTY * | p | ) |
Definition at line 86 of file xml.c.
References GWEN_FREE_OBJECT, and GWEN_Memory_dealloc().
Referenced by GWEN_XMLNode__CheckNameSpaceDecls1(), GWEN_XMLNode__CheckNameSpaceDecls3(), and GWEN_XMLProperty_freeAll().


| void GWEN_XMLProperty_freeAll | ( | GWEN_XMLPROPERTY * | p | ) |
Definition at line 130 of file xml.c.
References GWEN_XMLProperty_free().
Referenced by GWEN_XMLNode_free().


| const char* GWEN_XMLProperty_GetName | ( | const GWEN_XMLPROPERTY * | pr | ) |
| const char* GWEN_XMLProperty_GetValue | ( | const GWEN_XMLPROPERTY * | pr | ) |
| void GWEN_XMLProperty_insert | ( | GWEN_XMLPROPERTY * | p, |
| GWEN_XMLPROPERTY ** | head | ||
| ) |
Definition at line 118 of file xml.c.
References GWEN_LIST_INSERT.
Referenced by GWEN_XMLNode__SetProperty().

| GWEN_XMLPROPERTY* GWEN_XMLProperty_new | ( | const char * | name, |
| const char * | value | ||
| ) |
Definition at line 72 of file xml.c.
References GWEN_Memory_strdup(), and GWEN_NEW_OBJECT.
Referenced by GWEN_XMLNode__SetProperty(), and GWEN_XMLProperty_dup().

