本文整理汇总了C++中DOMElement::ToElement方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMElement::ToElement方法的具体用法?C++ DOMElement::ToElement怎么用?C++ DOMElement::ToElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMElement
的用法示例。
在下文中一共展示了DOMElement::ToElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
}
std::string parent = appController.getParent();
std::cout << "controller namespace: " << parent.c_str() << std::endl;
if (setenv("FLOWVR_PARENT", parent.c_str(), 1))
{
std::cerr << "setting FLOWVR_PARENT environment variable failed." << std::endl;
}
{
char buffer[1024];
if (getcwd(buffer, sizeof(buffer))==NULL)
{
std::cerr << "getcwd failed." << std::endl;
}
else if (setenv("FLOWVR_PWD",buffer,1))
{
std::cerr << "setting FLOWVR_PWD environment variable failed." << std::endl;
}
}
appController.start();
// Register all modules that are expected to connect
// (to sync the .run.xml with the .cmd.xml)
{
std::set<std::string> & allExpectedModules = appController.allExpectedModules;
for(DOMElement* cmd = fCmd->RootElement()->FirstChildElement();
cmd;
cmd = cmd->NextSiblingElement()) {
TiXmlElement *elt = cmd->ToElement();
if(strcmp(cmd->Value(), "addobject" ) == 0 && elt &&
strcmp(elt->Attribute("class"), "flowvr.plugins.Regulator") == 0) {
allExpectedModules.insert(cmd->Attribute("id"));
}
}
}
// CALL COMMANDS FROM .RUN.XML FILE
std::cout << "Processing " << runFile.c_str();
DOMElement* root = fRun->RootElement();
DOMElement* cmd = root->FirstChildElement();
while (cmd!=NULL)
{
if (!appController.ok())
{
std::string cmds="";
std::cerr << "Cannot send command: " << std::endl
<< "\t " << (cmds<<*cmd).c_str() << std::endl
<< "\tLaunching aborted" << std::endl;
delete fRun;
delete fCmd;
return 1;
}
appController.processCommand(cmd);
cmd = cmd->NextSiblingElement();
}
// CALL COMMANDS FROM .CMD.XML FILE
std::cout << "Processing " << cmdFile.c_str();
root = fCmd->RootElement();