本文整理汇总了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);
//
// }
示例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 );
}
}