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


C++ AbstractClassRep::findField方法代码示例

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


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

示例1: exportNamespaces


//.........这里部分代码省略.........
            mXML->setAttribute("minArgs", avar("%i", minArgs));
            mXML->setAttribute("maxArgs", avar("%i", maxArgs));

            const char* usage = "";
            if (entry->mUsage && entry->mUsage[0])
               usage = entry->mUsage;
            mXML->setAttribute("usage", usage);
            mXML->setAttribute("package", entry->mPackage ? entry->mPackage : "");
            mXML->setAttribute("entryType", avar("%i", entry->mType));

            mXML->popElement(); // Entry

         }

         mXML->popElement(); // Entries

         // Fields

         mXML->pushNewElement("Fields");

         AbstractClassRep *rep = walk->mClassRep;
         Vector<U32> classFields;

         if (rep)
         {
            AbstractClassRep *parentRep = rep->getParentClass();

            const AbstractClassRep::FieldList& flist = rep->mFieldList;

            for(U32 i = 0; i < flist.size(); i++)
            {
               if (parentRep)
               {
                  if (parentRep->findField(flist[i].pFieldname))
                     continue;

               }
               classFields.push_back(i);
            }

            for(U32 i = 0; i < classFields.size(); i++)
            {
               U32 index = classFields[i];

               char fieldName[256];

               dSprintf(fieldName, 256, flist[index].pFieldname);

               //consistently name fields
               fieldName[0] = dToupper(fieldName[0]);

               mXML->pushNewElement("Field");

               mXML->setAttribute("name", fieldName);
               mXML->setAttribute("type", avar("%i", flist[index].type));

// RD: temporarily deactivated; TypeEnum is no more; need to sync this up
//               if (flist[index].type == TypeEnum  && flist[index].table && dStrlen(flist[index].table->name))
//               {
//                  if (!enumTables.contains(flist[index].table))
//                     enumTables.push_back(flist[index].table);
//
//                  mXML->setAttribute("enumTable", flist[index].table->name);
//
//               }
开发者ID:fr1tz,项目名称:terminal-overload,代码行数:66,代码来源:consoleXMLExport.cpp

示例2: dumpClasses


//.........这里部分代码省略.........
      for( Namespace::Entry *ewalk = vec[i]->mEntryList; ewalk; ewalk = ewalk->mNext )
      {
         if( ewalk->mType != Namespace::Entry::ConsoleFunctionType )
         {
            found = true;
            break;
         }
      }

      // If we don't have engine functions and the namespace name
      // doesn't match the class name... then its a script class.
      if ( !found && !vec[i]->isClass() )
         continue;
  
      // If we hit a class with no members and no classRep, do clever filtering.
      if(vec[i]->mEntryList == NULL && vec[i]->mClassRep == NULL)
      {
         // Print out a short stub so we get a proper class hierarchy.
         if ( superClassName )  
         { 
            // Filter hack; we don't want non-inheriting classes...
            dumpClassHeader( stream, NULL, className, superClassName );
            dumpClassFooter( stream );
         }
         continue;
      }

      // Skip over hidden or internal classes.
      if(   vec[i]->mUsage &&
            ( dStrstr( vec[i]->mUsage, "@hide" ) || dStrstr( vec[i]->mUsage, "@internal" ) ) )
         continue;

      // Print the header for the class..
      dumpClassHeader( stream, vec[i]->mUsage, className, superClassName );
      
      // Dump all fragments for this class.
      
      for( ConsoleDocFragment* fragment = ConsoleDocFragment::smFirst; fragment != NULL; fragment = fragment->mNext )
         if( fragment->mClass && dStricmp( fragment->mClass, className ) == 0 )
            dumpFragment( stream, fragment );

      // Dump member functions.
      dumpNamespaceEntries( stream, vec[ i ], false );
      
      // Dump callbacks.
      dumpGroupStart( stream, "Callbacks" );
      dumpNamespaceEntries( stream, vec[ i ], true );
      dumpGroupEnd( stream );
      
      // Dump static member variables.
      dumpVariables( stream, className );

      // Deal with the classRep (to get members)...
      AbstractClassRep *rep = vec[i]->mClassRep;
      AbstractClassRep::FieldList emptyList;
      AbstractClassRep::FieldList *parentList = &emptyList;
      AbstractClassRep::FieldList *fieldList = &emptyList;
      if ( rep )
      {
         // Get information about the parent's fields...
         AbstractClassRep *parentRep = vec[i]->mParent ? vec[i]->mParent->mClassRep : NULL;
         if(parentRep)
            parentList = &(parentRep->mFieldList);

         // Get information about our fields
         fieldList = &(rep->mFieldList);

         // Go through all our fields...
         for(U32 j = 0; j < fieldList->size(); j++)
         {
            const AbstractClassRep::Field &field = (*fieldList)[j];

            switch( field.type )
            {
            case AbstractClassRep::StartArrayFieldType:
            case AbstractClassRep::EndArrayFieldType:
               break;
            case AbstractClassRep::StartGroupFieldType:
               dumpGroupStart( stream, field.pGroupname, field.pFieldDocs );
               break;
            case AbstractClassRep::EndGroupFieldType:
               dumpGroupEnd( stream );
               break;
            default:
            case AbstractClassRep::DeprecatedFieldType:
               // Skip over fields that are already defined in
               // our parent class.
               if ( parentRep && parentRep->findField( field.pFieldname ) )
                  continue;
                     
               dumpClassMember( stream, field );
               break;
            }
         }
      }

      // Close the class/namespace.
      dumpClassFooter( stream );
   }
}
开发者ID:Adhdcrazzy,项目名称:Torque3D,代码行数:101,代码来源:engineDoc.cpp


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