当前位置: 首页>>代码示例>>C++>>正文


C++ MemberList::count方法代码示例

本文整理汇总了C++中MemberList::count方法的典型用法代码示例。如果您正苦于以下问题:C++ MemberList::count方法的具体用法?C++ MemberList::count怎么用?C++ MemberList::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MemberList的用法示例。


在下文中一共展示了MemberList::count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: generateDEFForClass

void generateDEFForClass(ClassDef *cd,FTextStream &t)
{
  // + brief description
  // + detailed description
  // - template arguments
  // - include files
  // + inheritance diagram
  // + list of direct super classes
  // + list of direct sub classes
  // + collaboration diagram
  // - list of all members
  // + user defined member sections
  // + standard member sections
  // + detailed member documentation
  // - examples

  if (cd->isReference()) return; // skip external references.
  if (cd->name().find('@')!=-1) return; // skip anonymous compounds.
  if (cd->templateMaster()!=0) return; // skip generated template instances.

  t << cd->compoundTypeString() << " = {" << endl;
  t << "  cp-id     = '" << cd->getOutputFileBase() << "';" << endl;
  t << "  cp-name   = '" << cd->name() << "';" << endl;

  if (cd->baseClasses())
  {
    BaseClassListIterator bcli(*cd->baseClasses());
    BaseClassDef *bcd;
    for (bcli.toFirst();(bcd=bcli.current());++bcli)
    {
      t << "  cp-ref     = {" << endl << "    ref-type = base;" << endl;
      t << "    ref-id   = '"
        << bcd->classDef->getOutputFileBase() << "';" << endl;
      t << "    ref-prot = ";
      switch (bcd->prot)
      {
        case Public:    t << "public;"    << endl; break;
        case Package: // package scope is not possible
        case Protected: t << "protected;" << endl; break;
        case Private:   t << "private;"   << endl; break;
      }
      t << "    ref-virt = ";
      switch(bcd->virt)
      {
        case Normal:  t << "non-virtual;";  break;
        case Virtual: t << "virtual;";      break;
        case Pure:    t << "pure-virtual;"; break;
      }
      t << endl << "  };" << endl;
    }
  }

  if (cd->subClasses())
  {
    BaseClassListIterator bcli(*cd->subClasses());
    BaseClassDef *bcd;
    for (bcli.toFirst();(bcd=bcli.current());++bcli)
    {
      t << "  cp-ref     = {" << endl << "    ref-type = derived;" << endl;
      t << "    ref-id   = '"
        << bcd->classDef->getOutputFileBase() << "';" << endl;
      t << "    ref-prot = ";
      switch (bcd->prot)
      {
        case Public:    t << "public;"    << endl; break;
        case Package: // packet scope is not possible!
        case Protected: t << "protected;" << endl; break;
        case Private:   t << "private;"   << endl; break;
      }
      t << "    ref-virt = ";
      switch(bcd->virt)
      {
        case Normal:  t << "non-virtual;";  break;
        case Virtual: t << "virtual;";      break;
        case Pure:    t << "pure-virtual;"; break;
      }
      t << endl << "  };" << endl;
    }
  }

  int numMembers = 0;
  QListIterator<MemberList> mli(cd->getMemberLists());
  MemberList *ml;
  for (mli.toFirst();(ml=mli.current());++mli)
  {
    if ((ml->listType()&MemberList::detailedLists)==0)
    {
      numMembers+=ml->count();
    }
  }
  if (numMembers>0)
  {
    generateDEFClassSection(cd,t,cd->getMemberList(MemberList::pubTypes),"public-type");
    generateDEFClassSection(cd,t,cd->getMemberList(MemberList::pubMethods),"public-func");
    generateDEFClassSection(cd,t,cd->getMemberList(MemberList::pubAttribs),"public-attrib");
    generateDEFClassSection(cd,t,cd->getMemberList(MemberList::pubSlots),"public-slot");
    generateDEFClassSection(cd,t,cd->getMemberList(MemberList::signals),"signal");
    generateDEFClassSection(cd,t,cd->getMemberList(MemberList::dcopMethods),"dcop-func");
    generateDEFClassSection(cd,t,cd->getMemberList(MemberList::properties),"property");
    generateDEFClassSection(cd,t,cd->getMemberList(MemberList::pubStaticMethods),"public-static-func");
//.........这里部分代码省略.........
开发者ID:fourmond,项目名称:doxygen-ruby-patch,代码行数:101,代码来源:defgen.cpp


注:本文中的MemberList::count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。