本文整理汇总了C++中xml::Node::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::GetName方法的具体用法?C++ Node::GetName怎么用?C++ Node::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml::Node
的用法示例。
在下文中一共展示了Node::GetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FirstChild
Node * Node::FindEditChildByAttrib ( std::string const & childName,
std::string const & attrName,
std::string const & attrValue)
{
XML::Node::ChildIter it = FirstChild ();
XML::Node::ChildIter last = LastChild ();
while (it != last)
{
XML::Node * child = *it;
if (child->GetName () == childName && child->FindAttribValue (attrName) == attrValue)
return child;
++it;
}
return 0;
}
示例2: Write
void Node::Write (std::ostream & out, unsigned indent) const
{
WriteOpeningTag (out, indent);
if (!_closed)
{
for (ConstChildIter it = FirstChild (); it != LastChild (); ++it)
{
XML::Node * child = *it;
if (child->GetName ().empty ()) // text
{
out << Indentation (indent) << child->GetAttribValue ("Text") << std::endl;
}
else
{
child->Write (out, indent + 2);
}
}
}
WriteClosingTag (out, indent);
}
示例3: InStream
Bool BonkEnc::CDDBBatch::ReadEntries()
{
String inputFormat = String::SetInputFormat("UTF-8");
String outputFormat = String::SetOutputFormat("UTF-8");
// Read saved queries from XML
XML::Document *document = new XML::Document();
if (document->LoadFile(String(config->configDir).Append("cddb\\queries.xml")) == Success())
{
XML::Node *root = document->GetRootNode();
if (root != NIL)
{
for (Int i = 0; i < root->GetNOfNodes(); i++)
{
XML::Node *node = root->GetNthNode(i);
if (node->GetName() == "query") queries.Add(node->GetContent());
}
}
}
delete document;
// Read saved submits from XML and database cache
document = new XML::Document();
if (document->LoadFile(String(config->configDir).Append("cddb\\submits.xml")) == Success())
{
XML::Node *root = document->GetRootNode();
if (root != NIL)
{
for (Int i = 0; i < root->GetNOfNodes(); i++)
{
XML::Node *node = root->GetNthNode(i);
if (node->GetName() == "submit")
{
InStream *in = new InStream(STREAM_FILE, String(config->configDir).Append("cddb\\").Append(node->GetAttributeByName("category")->GetContent()).Append("\\").Append(node->GetContent()), IS_READONLY);
if (in->Size() > 0)
{
String result = in->InputString(in->Size());
CDDBInfo cddbInfo;
ParseCDDBRecord(result, cddbInfo);
cddbInfo.category = node->GetAttributeByName("category")->GetContent();
for (Int i = 0; i < submits.Length(); i++)
{
if (submits.GetNth(i) == cddbInfo)
{
submits.Remove(submits.GetNthIndex(i));
break;
}
}
submits.Add(cddbInfo);
}
delete in;
}
}
}
}
delete document;
String::SetInputFormat(inputFormat);
String::SetOutputFormat(outputFormat);
return True;
}