本文整理汇总了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();
}
}//属性结束
}
}
示例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() ;
}
}
示例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();
}
}//属性结束
}
}
示例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;
}
示例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
}
//.........这里部分代码省略.........