本文整理汇总了C++中ClassList::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ ClassList::erase方法的具体用法?C++ ClassList::erase怎么用?C++ ClassList::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassList
的用法示例。
在下文中一共展示了ClassList::erase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: typeToString
bool Slice::ChecksumVisitor::visitClassDefStart(const ClassDefPtr& p)
{
if (p->isLocal()) {
return false;
}
ClassList bases = p->bases();
ostringstream ostr;
if (p->isInterface()) {
ostr << "interface ";
} else {
ostr << "class ";
}
ostr << p->name();
if (!bases.empty()) {
if (!bases.front()->isInterface()) {
ostr << " extends " << bases.front()->scoped();
bases.erase(bases.begin());
}
if (!bases.empty()) {
if (p->isInterface()) {
ostr << " extends ";
} else {
ostr << " implements ";
}
for (ClassList::iterator q = bases.begin(); q != bases.end(); ++q) {
if (q != bases.begin()) {
ostr << ", ";
}
ostr << (*q)->scoped();
}
}
}
ostr << endl;
if (p->hasDataMembers()) {
DataMemberList members = p->dataMembers();
for (DataMemberList::iterator q = members.begin(); q != members.end(); ++q) {
ostr << typeToString((*q)->type()) << ' ' << (*q)->name() << endl;
}
}
if (p->hasOperations()) {
OperationList ops = p->operations();
for (OperationList::iterator q = ops.begin(); q != ops.end(); ++q) {
ostr << typeToString((*q)->returnType()) << ' ' << (*q)->name() << '(';
ParamDeclList params = (*q)->parameters();
for (ParamDeclList::iterator r = params.begin(); r != params.end(); ++r) {
if (r != params.begin()) {
ostr << ", ";
}
if ((*r)->isOutParam()) {
ostr << "out ";
}
ostr << typeToString((*r)->type()) << ' ' << (*r)->name();
}
ostr << ')';
ExceptionList ex = (*q)->throws();
if (!ex.empty()) {
ostr << " throws ";
for (ExceptionList::iterator s = ex.begin(); s != ex.end(); ++s) {
if (s != ex.begin()) {
ostr << ", ";
}
ostr << (*s)->scoped();
}
}
ostr << endl;
}
}
updateMap(p->scoped(), ostr.str());
return false;
}