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


C++ Node::nodeValue方法代码示例

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


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

示例1: getNetWorkPathAttr

void Configure::getNetWorkPathAttr(Poco::XML::NamedNodeMap* map, struct NetworkPathInfo* info)
{
    if(map)//看看是否真有属性  
    {  
        for(int i = 0 ; i < map->length() ; i++)//属性肯定至少0个,用循环一个个取出  
        {  
            Poco::XML::Node* attr = map->item(i);  
			if(attr->nodeName() == "UserName")
			{
				info->username = attr->nodeValue();
			}
			else if(attr->nodeName() == "Password")
			{
				info->password = attr->nodeValue();
			}
        }//属性结束
    }
}
开发者ID:zhiguangq,项目名称:hlsEncoder,代码行数:18,代码来源:Configure.cpp

示例2: loadChannelList

void Configure::loadChannelList(void)
{
    std::ifstream in(SystemInfo::instance().getExecutePath() + "\\config\\channelList.xml");
    Poco::XML::InputSource src(in);
    Poco::XML::DOMParser parser;

    try
    {
        Poco::AutoPtr<Poco::XML::Document> pDoc = parser.parse(&src);
        Poco::XML::NodeIterator it(pDoc, Poco::XML::NodeFilter::SHOW_ALL);
        Poco::XML::Node* pNode = it.nextNode();

        static int index = 0;
		std::string channelInfo[3];
        while (pNode)  
        {
            if(pNode->nodeName() == "Row")
            {
                pNode = it.nextNode();
                if(pNode->nodeName() != "#text")
                {
                    continue; //No text node present
                }
                index = 0;
                if(m_encodeChannel == channelInfo[1])
                {
                    // 找到频道对照表
                    m_encodeChannelID = channelInfo[0];
                    m_encodeChannelPrefix = channelInfo[2];
                    LOG(INFO) << "get channel info : ID [" << m_encodeChannelID << "] Prefix[" << m_encodeChannelPrefix << "].";
                    return;
                }
            }
            if(pNode->nodeName() == "Cell")
            {
                pNode = it.nextNode();
                if(pNode->nodeName() != "#text")
                {
                    pNode = it.nextNode();
                    continue; //No text node present
                }
                channelInfo[index++] = pNode->nodeValue();
            }

            pNode = it.nextNode();//指向下一个node
        }
    }
    catch(std::exception& e)
    {
        LOG(ERROR) << "parse channelList xml file error." << e.what() ;
    }
}
开发者ID:zhiguangq,项目名称:hlsEncoder,代码行数:52,代码来源:Configure.cpp

示例3: getOutputStreamAttr

void Configure::getOutputStreamAttr(Poco::XML::NamedNodeMap* map, struct OutputStream* outputstream)
{
    if(map)//看看是否真有属性  
    {  
        for(int i = 0 ; i < map->length() ; i++)//属性肯定至少0个,用循环一个个取出  
        {  
            Poco::XML::Node* attr = map->item(i);  
			if(attr->nodeName() == "Enable")
			{
				outputstream->enable = attr->nodeValue();
			}
			else if(attr->nodeName() == "BitRate")
			{
				outputstream->bitrate = attr->nodeValue();
			}
			else if(attr->nodeName() == "ResolutionRatio")
			{
				outputstream->resolutionRatio = attr->nodeValue();
			}
        }//属性结束
    }
}
开发者ID:zhiguangq,项目名称:hlsEncoder,代码行数:22,代码来源:Configure.cpp

示例4: it

std::map<std::string, std::string>
XmlHandler::get_attributes_from_tag(const std::string &xpath) {
  std::map<std::string, std::string> attributes_map;
  Poco::XML::NodeIterator it(pDoc, Poco::XML::NodeFilter::SHOW_ELEMENT);
  Poco::XML::Node *pNode = it.nextNode();
  Poco::XML::Node *detectorNode = pNode->getNodeByPath(xpath);
  if (detectorNode) {
    Poco::XML::NamedNodeMap *attributes = detectorNode->attributes();
    for (unsigned int i = 0; i < attributes->length(); i++) {
      Poco::XML::Node *attribute = attributes->item(i);
      attributes_map.emplace(attribute->nodeName(), attribute->nodeValue());
    }
  }
  return attributes_map;
}
开发者ID:DanNixon,项目名称:mantid,代码行数:15,代码来源:XmlHandler.cpp

示例5: load

bool Configure::load(void)
{
    std::ifstream in(SystemInfo::instance().getExecutePath() + "\\config\\sys.xml");
    Poco::XML::InputSource src(in);
    Poco::XML::DOMParser parser;

    try
    {
        Poco::AutoPtr<Poco::XML::Document> pDoc = parser.parse(&src);
        Poco::XML::NodeIterator it(pDoc, Poco::XML::NodeFilter::SHOW_ALL);
        Poco::XML::Node* pNode = it.nextNode();


        while (pNode)  
        {  
            if(pNode->nodeName() == "EncodChannel")
            {
                pNode = it.nextNode();
                if(pNode->nodeName() != "#text")
                {
                    continue; //No text node present
                }
                m_encodeChannel = pNode->nodeValue();
				Poco::XML::XMLString tt = Poco::XML::toXMLString(m_encodeChannel);
            }

            if(pNode->nodeName() == "InputTSPath")
            {
				getNetWorkPathAttr(pNode->attributes(),&m_inputTSPath);
                pNode = it.nextNode();
                if(pNode->nodeName() != "#text")
                {
                    continue; //No text node present
                }
				m_inputTSPath.path = pNode->nodeValue();
				m_inputTSPath.objectName = "o:";
            }

            if(pNode->nodeName() == "InputXMLPath")
            {
				getNetWorkPathAttr(pNode->attributes(),&m_inputXMLPath);
                pNode = it.nextNode();
                if(pNode->nodeName() != "#text")
                {
                    continue; //No text node present
                }
				m_inputXMLPath.path = pNode->nodeValue();
				m_inputXMLPath.objectName = "p:";
            }

            if(pNode->nodeName() == "OutputTSPath")
            {
				getNetWorkPathAttr(pNode->attributes(),&m_outputTSPath);
                pNode = it.nextNode();
                if(pNode->nodeName() != "#text")
                {
                    continue; //No text node present
                }
				m_outputTSPath.path = pNode->nodeValue();
				m_outputTSPath.objectName = "q:";
            }

            if(pNode->nodeName() == "OutputXMLPath")
            {
				getNetWorkPathAttr(pNode->attributes(),&m_outputXMLPath);
                pNode = it.nextNode();
                if(pNode->nodeName() != "#text")
                {
                    continue; //No text node present
                }
				m_outputXMLPath.path = pNode->nodeValue();
				m_outputXMLPath.objectName = "r:";
            }

            if(pNode->nodeName() == "OutputStream1")
            {
				getOutputStreamAttr(pNode->attributes(),&m_outputStream[0]);
                pNode = it.nextNode();
                if(pNode->nodeName() != "#text")
                {
                    continue; //No text node present
                }
            }
            if(pNode->nodeName() == "OutputStream2")
            {
				getOutputStreamAttr(pNode->attributes(),&m_outputStream[1]);
                pNode = it.nextNode();
                if(pNode->nodeName() != "#text")
                {
                    continue; //No text node present
                }
            }
            if(pNode->nodeName() == "OutputStream3")
            {
				getOutputStreamAttr(pNode->attributes(),&m_outputStream[2]);
                pNode = it.nextNode();
                if(pNode->nodeName() != "#text")
                {
                    continue; //No text node present
                }
//.........这里部分代码省略.........
开发者ID:zhiguangq,项目名称:hlsEncoder,代码行数:101,代码来源:Configure.cpp


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