本文整理汇总了C++中OutputData::setPort方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputData::setPort方法的具体用法?C++ OutputData::setPort怎么用?C++ OutputData::setPort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputData
的用法示例。
在下文中一共展示了OutputData::setPort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parsXml
//.........这里部分代码省略.........
ath = ath->NextSiblingElement())
{
if(compareString(ath->Value(), "author"))
{
Author author;
if(ath->GetText())
author.setName(parser->parseText(ath->GetText()).c_str());
if(ath->Attribute("email"))
author.setEmail(ath->Attribute("email"));
module.addAuthor(author);
}
else
{
OSTRINGSTREAM war;
war<<"Unrecognized tag from "<<szFile<<" at line "\
<<ath->Row()<<".";
logger->addWarning(war);
}
}
/* retrieving data */
if(root->FirstChild("data"))
for(TiXmlElement* data = root->FirstChild("data")->FirstChildElement();
data; data = data->NextSiblingElement())
{
/* output data */
if(compareString(data->Value(), "output"))
{
OutputData output;
if(compareString(data->Attribute("port_type"), "stream") || !data->Attribute("port_type"))
output.setPortType(STREAM_PORT);
else if(compareString(data->Attribute("port_type"), "event"))
output.setPortType(EVENT_PORT);
else if(compareString(data->Attribute("port_type"), "service"))
output.setPortType(SERVICE_PORT);
else
{
OSTRINGSTREAM war;
war<<"Unknown port type \'"<<data->Attribute("port_type")<<"\' from "<<szFile<<" at line "\
<<data->Row()<<". Available types : stream, event, service";
logger->addWarning(war);
}
TiXmlElement* element;
if(output.getPortType() != SERVICE_PORT )
{
if((element = (TiXmlElement*) data->FirstChild("type")))
output.setName(parser->parseText(element->GetText()).c_str());
else
{
OSTRINGSTREAM war;
war<<"Output data from "<<szFile<<" at line "\
<<data->Row()<<" has no type.";
logger->addWarning(war);
}
}
else
output.setName("*");
if((element = (TiXmlElement*) data->FirstChild("port")))
{
output.setPort(parser->parseText(element->GetText()).c_str());