本文整理汇总了C++中NodePtr::Name方法的典型用法代码示例。如果您正苦于以下问题:C++ NodePtr::Name方法的具体用法?C++ NodePtr::Name怎么用?C++ NodePtr::Name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodePtr
的用法示例。
在下文中一共展示了NodePtr::Name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddNode
void GCGVCallgraph_ReqGraph::AddNode(NodePtr node, size_t node_depth) {
if (node_depth == request.Get<depth>()) {
// The top-level node lives in the top-level JSON, so does not need an
// object wrapper
} else {
builder.StartAnonymousObject();
}
builder.Add("name",node->Name());
if (node->Name().length() > 50) {
builder.Add("shortName",node->Name().substr(0,50));
} else {
builder.Add("shortName",node->Name());
}
builder.Add("cost",node->Costs()[0]);
if (node_depth>0 && node->NumChildren() > 0)
{
builder.StartArray("children");
node-> ForEach([&] (NodePtr child) -> void {
this->AddNode(child,node_depth-1);
});
builder.EndArray();
}
if (node_depth == request.Get<depth>()) {
// The top-level node lives in the top-level JSON, so does not need an
// object wrapper
} else {
builder.EndObject();
}
}
示例2: AddTree
void RegSearch::AddTree(NodePtr& node, int depth) {
if ( regPattern && regPattern->Search(node->Name()) ) {
this->AddNode(node);
} else {
SLOG_FROM(LOG_VERBOSE,"RegSearch::Search",
"Rejected Node: " << node->Name() )
}
--depth;
if ( depth != 0 ) {
node->ForEach([=] ( NodePtr&& node ) -> void {
this->AddTree(node, depth);
});
}
}
示例3: PrintPopdStack
std::string NodeUserApp::PrintPopdStack() {
std::string lines;
NodePtr pwd = application.ActiveNode();
if ( pwd->Parent().IsNull() ) {
lines += pwd->Name();
} else {
lines += pwd->Parent()->Name() + "/" + pwd->Name();
}
for ( const NodePtr& node: popdstack ) {
lines += "\n";
if ( node->Parent().IsNull() ) {
lines += node->Name();
} else {
lines += node->Parent()->Name() + "/" + node->Name();
}
}
lines += "\n";
return lines;
}
示例4: AddNode
void GCGV_ReqGetNodes::SortedNodes::AddTree(
NodePtr root,
SORT_BY sort,
const std::string& filter,
int depth)
{
if (root->Name() == filter) {
AddNode(root,sort);
}
--depth;
if (depth != -1) {
root->ForEach([=] (NodePtr&& node) -> void {
this->AddTree(node,sort,filter,depth);
});
}
}