当前位置: 首页>>代码示例>>C++>>正文


C++ IXMLDOMElementPtr::getAttributeNode方法代码示例

本文整理汇总了C++中msxml2::IXMLDOMElementPtr::getAttributeNode方法的典型用法代码示例。如果您正苦于以下问题:C++ IXMLDOMElementPtr::getAttributeNode方法的具体用法?C++ IXMLDOMElementPtr::getAttributeNode怎么用?C++ IXMLDOMElementPtr::getAttributeNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在msxml2::IXMLDOMElementPtr的用法示例。


在下文中一共展示了IXMLDOMElementPtr::getAttributeNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FAILED


//.........这里部分代码省略.........
		// Walk through children of document element
		// and process according to type
		spNodeTemp = spElemTemp->firstChild;

		// TODO more checking needed for the config file
		while (spNodeTemp != NULL)
		{
			// Process node depending on type
			cNodeType = spNodeTemp->nodeType;
			switch (cNodeType)
			{
				// Comment Node
				case NODE_COMMENT:
					if (Debug::Enabled(Debug::CONFIG))
						std::cout<<"Comment Node:" << std::endl << "  "<<_bstr_t(spNodeTemp->nodeValue)<<std::endl;
					break;
				// Element Node
				case NODE_ELEMENT:
				{
					std::string	tempString;
					spElemTemp = (IXMLDOMElementPtr) spNodeTemp;
					std::string node = (const char *)spElemTemp->nodeName;
					Debug::PrintLine(Debug::CONFIG, "Processing %s", node.c_str());

					// A note on processing attributes
					// MSXML doesn't support the hasAttribute method,
					// so we'll try to get the Attribute node, then its value.
					// eg
					// spAttrTemp = spElemTemp->getAttributeNode("Attribute1");
					// if (spAttrTemp != NULL)	// test if "get" was successful
					//    ...

					if (node == "MSS") {
						spAttrTemp = spElemTemp->getAttributeNode("PORT");
						if (spAttrTemp != NULL) {
							mMSSListenerPort = (u_short)strtol((char *)_bstr_t(spAttrTemp->nodeValue), NULL, 0);
							Debug::PrintLine(Debug::CONFIG, "  PORT Value:  %d", mMSSListenerPort);
						}
					} else if (node == "DISK") {
						spAttrTemp = spElemTemp->getAttributeNode("DRIVE");
						if (spAttrTemp != NULL) {
							mDrive = (char *)_bstr_t(spAttrTemp->nodeValue);
							Debug::PrintLine(Debug::CONFIG, "  DRIVE:  %s", mDrive.c_str());
						}
						spAttrTemp = spElemTemp->getAttributeNode("ROOT");
						if (spAttrTemp != NULL) {
							mRoot = (char *)_bstr_t(spAttrTemp->nodeValue);
							FixPath(mRoot);	// replace all backslashes \ with forward slashes /
							Debug::PrintLine(Debug::CONFIG, "  ROOT:  %s", mRoot.c_str());
						}
					} else if (node == "INFO") {
						spAttrTemp = spElemTemp->getAttributeNode("DRIVE");
						if (spAttrTemp != NULL) {
							mInfoDrive = (char *)_bstr_t(spAttrTemp->nodeValue);
							Debug::PrintLine(Debug::CONFIG, "  INFO DRIVE:  %s", mInfoDrive.c_str());
						}
						spAttrTemp = spElemTemp->getAttributeNode("ROOT");
						if (spAttrTemp != NULL) {
							mInfoRoot = (char *)_bstr_t(spAttrTemp->nodeValue);
							FixPath(mInfoRoot);	// replace all backslashes \ with forward slashes /
							Debug::PrintLine(Debug::CONFIG, "  INFO ROOT:  %s", mInfoRoot.c_str());
						}
						spAttrTemp = spElemTemp->getAttributeNode("FILE");
						if (spAttrTemp != NULL) {
							mInfoFile = (char *)_bstr_t(spAttrTemp->nodeValue);
							Debug::PrintLine(Debug::CONFIG, "  INFO FILE:  %s", mInfoFile.c_str());
开发者ID:elementalit,项目名称:FibreData,代码行数:67,代码来源:RDPConfig.cpp


注:本文中的msxml2::IXMLDOMElementPtr::getAttributeNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。