本文整理汇总了C++中XmlNode::is_valid方法的典型用法代码示例。如果您正苦于以下问题:C++ XmlNode::is_valid方法的具体用法?C++ XmlNode::is_valid怎么用?C++ XmlNode::is_valid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlNode
的用法示例。
在下文中一共展示了XmlNode::is_valid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show
bool SignatureDialog::show(XmlNode & sig, const QString & title, bool block)
{
cf3_assert( sig.is_valid() );
XmlNode node = sig.content->first_node();
QString name;
m_ok_clicked = false;
this->setWindowTitle(title);
m_data_layout->clear_options();
for( ; node.is_valid() ; node.content = node.content->next_sibling())
{
m_data_layout->add_option( SignalOptions::xml_to_option(node) );
name = node.content->first_attribute( Protocol::Tags::attr_key() )->value();
m_nodes[name] = node;
}
if( m_data_layout->has_options() )
{
if(block)
{
m_is_blocking = true;
this->exec();
}
else
{
m_is_blocking = false;
this->setModal(true);
this->setVisible(true);
}
}
else
{
m_ok_clicked = true;
emit finished(QDialog::Accepted);
}
return m_ok_clicked;
}
示例2: add_reply_frame
XmlNode Protocol::add_reply_frame ( XmlNode& node )
{
cf3_assert( node.is_valid() );
cf3_assert( is_not_null(node.content->parent()) );
rapidxml::xml_node<>* xml_node = node.content;
XmlNode replynode = XmlNode(node.content->parent()).add_node( Tags::node_frame());
replynode.set_attribute( "type", Tags::node_type_reply() );
// reply with same target
rapidxml::xml_attribute<>* target_att = xml_node->first_attribute("target");
std::string target = is_not_null(target_att) ? target_att->value() : "";
replynode.set_attribute("target", target);
// the sender becomes the receiver
rapidxml::xml_attribute<>* sender_att = xml_node->first_attribute("sender");
std::string receiver = is_not_null(sender_att) ? sender_att->value() : "";
replynode.set_attribute("receiver", receiver);
// same transaction type
rapidxml::xml_attribute<>* trans_att = xml_node->first_attribute("transaction");
std::string trans = is_not_null(trans_att) ? trans_att->value() : "auto";
replynode.set_attribute("transaction", trans);
// copy uuids, if any
rapidxml::xml_attribute<>* client_uuid_att = xml_node->first_attribute( Tags::attr_clientid() );
rapidxml::xml_attribute<>* frame_uuid_att = xml_node->first_attribute( Tags::attr_frameid() );
if( is_not_null(client_uuid_att) )
replynode.set_attribute(Tags::attr_clientid(), client_uuid_att->value());
if( is_not_null(frame_uuid_att) )
replynode.set_attribute(Tags::attr_frameid(), frame_uuid_att->value() );
return replynode;
// return XmlNode();
}
示例3: first_frame_node
XmlNode Protocol::first_frame_node ( const XmlNode& node )
{
cf3_assert( node.is_valid() );
return XmlNode( node.content->first_node( Protocol::Tags::node_frame() ));
}