UniverseUniversity


Home Projects Jobs Clientele Contact

uu


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Plain text patch for CPPServ



The patch should work for both, 0.1.100 and GIT versions..

--
Alexey Parshin,
http://www.sptk.net
diff -uNr cppserv-0.1.100/src/container/xmlserverconfig.cpp cppserv-0.1.100.new/src/container/xmlserverconfig.cpp
--- cppserv-0.1.100/src/container/xmlserverconfig.cpp	2007-04-06 05:43:29.000000000 +1000
+++ cppserv-0.1.100.new/src/container/xmlserverconfig.cpp	2007-08-28 19:44:02.000000000 +1000
@@ -78,13 +78,22 @@
 			{
 				container::XMLServerConfig::XMLConfigNode* cnode =
 					 new container::XMLServerConfig::XMLConfigNode(std::string((*node)->name()),parent);
-				//if(n->hasAttributes()) {
+				if ((*node)->hasAttributes()) {
+#ifdef XML_ATTRIBUTE_IS_NODE
+					const CXmlAttributes &attributes = (*node)->attributes();
+					for(CXmlAttributes::const_iterator it=attributes.begin();
+						it!=attributes.end(); it++) {
+						const CXmlNode* attr = *it;
+						cnode->addAttr(attr->name(),attr->value());
+					}
+#else
 					const CXmlAttributes &attr_map = (*node)->attributes;
 					for(CXmlAttributes::const_iterator it=attr_map.begin();
 						it!=attr_map.end(); it++) {
 						cnode->addAttr(it->first,it->second);
 					}
-				//}
+#endif
+				}
 				if(!(*node)->empty())
 					addKids(*node,cnode);
 				parent->addNode(cnode);//Presumes parent is always set

Authoright © Total Knowledge: 2001-2008