本文整理汇总了C++中Branch::printTrail方法的典型用法代码示例。如果您正苦于以下问题:C++ Branch::printTrail方法的具体用法?C++ Branch::printTrail怎么用?C++ Branch::printTrail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Branch
的用法示例。
在下文中一共展示了Branch::printTrail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printWhole
void printWhole() {
{ // print this entry
console.ui(" ");
if (parent) {
parent->printTrail();
console.ui("%s\n", filename(file).c_str());
} else {
console.ui("%s\n", file.c_str());
}
}
{ // print contents
if (fileman.isDirectory(file)) {
vector<string> children;
{ // fill vector
typedef directory_iterator DirIt;
for (DirIt i(file); i != DirIt(); i++)
children.push_back(i->path().string());
}
sort(children.begin(), children.end());
for (unsigned i = 0; i < children.size(); i++) {
trail = THREE;
if (i == children.size() - 1) trail = BENT;
string childName = children[i];
fileman.markDirectory(childName);
Branch(fileman, console, childName,
this).printWhole();
}
}
}
}
示例2: printTrail
void printTrail() {
if (parent) parent->printTrail();
switch (trail) {
case THREE:
console.ui("├── ");
trail = VERTICAL;
break;
case VERTICAL:
console.ui("│ ");
break;
case BENT:
console.ui("└── ");
trail = NONE;
break;
case NONE:
console.ui(" ");
break;
}
}