本文整理汇总了C++中WVList::count方法的典型用法代码示例。如果您正苦于以下问题:C++ WVList::count方法的具体用法?C++ WVList::count怎么用?C++ WVList::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WVList
的用法示例。
在下文中一共展示了WVList::count方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initState
void StrucViewItem::initState()
//-----------------------------
// if i represent a variable, i must find my type
// if the base type is a ClassType, then i am Collapsed
// else i am LeafNode
{
bool do_inherited = false;
ClassType * classType;
dr_sym_type stype = _info->symtype();
REQUIRE( stype != DR_SYM_NOT_SYM,"strucview::initstate ack");
if( !_initialized ) {
if( _classNode != NULL ) {
REQUIRE( stype == DR_SYM_CLASS,"strucview::initstate nak");
classType = (ClassType *)_info;
_type = _name;
} else {
classType = flattenTypeDesc( _info, _type );
_name = _info->name();
}
if( classType ) {
WVList kidInfos;
FilterFlags flags = _parent->getFilter();
if( ( flags & FILT_INHERITED ) || ( flags & FILT_ALL_INHERITED )) {
do_inherited = true;
FILT_RESET_INHERITED( flags );
}
classType->dataMembers( kidInfos, flags );
if( kidInfos.count() != 0 ) {
_expandState = Collapsed;
_parent->addSeen( this );
for( int i = 0; i < kidInfos.count(); i++ ) {
_kids.add( new StrucViewItem( _parent, ((Symbol *)kidInfos[i]),
_indentLevel + 1 ) );
}
} else {
_expandState = LeafNode;
}
if( classType != _info ) {
delete classType;
}
if( do_inherited ) {
startInherited();
}
} else {
_expandState = LeafNode;
}
_initialized = true;
}
}
示例2: inhHook
bool StrucViewItem::inhHook( DerivationPtr & ptr, void * info )
//-------------------------------------------------------------
{
InheritedData * data = (InheritedData *) info;
WString name( *data->name );
StrucViewItem * item = NULL;
name.concat( "::" );
name.concat( ptr._class->name() );
if( ptr._virtuality == DR_VIRTUALITY_VIRTUAL ) {
WVList * list = data->me->_parent->getSeen();
for( int i = list->count(); i > 0; i -= 1 ) {
StrucViewItem * test = (StrucViewItem *) (*list)[ i - 1 ];
if( test->_info->getHandle() == ptr._class->getHandle() ) {
item = test;
}
}
}
if( item != NULL ) {
item->_name.concat( ", " );
item->_name.concat( name );
} else {
item = new StrucViewItem( data->me->_parent, ptr._class,
data->me->_indentLevel );
item->_name = name;
item->initState();
data->me->_kids.add( item );
}
return true;
}
示例3: pruneStates
void MItem::pruneStates( WVList& states )
{
for( int i=states.count(); i>0; ) {
i--;
MState* s = (MState*)states[i];
if( !s->legal() ) {
delete states.removeAt( i );
}
}
}
示例4: expandAction
int MItem::expandAction( const WString& actionName, WString& command )
{
WVList actions;
addActions( actions );
for( int i=0; i<actions.count(); i++ ) {
MAction* action = (MAction*)actions[i];
if( action->name().match( actionName ) ) {
return( expandAction( action, command ) );
}
}
return( -1 );
}
示例5: addActions
void MItem::addActions( WFileName& fn, WVList& list )
{
WVList rules;
if( _config->findMatchingRules( fn, _component->mask(), rules ) ) {
for( int i=0; i<rules.count(); i++ ) {
MRule* r = (MRule*)rules[i];
for( int j=0; j<r->actions().count(); j++ ) {
list.add( r->actions()[j] );
}
}
}
}
示例6: load
void DTViewClass::load()
//----------------------
{
WVList dataMembers;
WVList methods;
WVList friends;
int i;
WString str;
ClassType * cls = (ClassType *) _symbol;
Symbol * s;
_members->clearAndDestroy();
cls->dataMembers( dataMembers );
cls->memberFunctions( methods );
cls->friendFunctions( friends );
for( i = 0; i < friends.count(); i += 1 ) {
s = (Symbol *) friends[ i ];
str.printf( " friend %s;", s->scopedName( FALSE ) );
_members->insert( new ClassMember( s, str.gets() ) );
}
for( i = 0; i < dataMembers.count(); i += 1 ) {
s = (Symbol *) dataMembers[ i ];
str.printf( " %s;", s->scopedName( FALSE ) );
_members->insert( new ClassMember( s, str.gets() ) );
}
for( i = 0; i < methods.count(); i += 1 ) {
s = (Symbol *) methods[ i ];
str.printf( " %s;", s->scopedName( FALSE ) );
_members->insert( new ClassMember( s, str.gets() ) );
}
addDescriptions();
fillBox();
}
示例7: findStates
void MC2Switch::getText( WString& str, WVList* states, SwMode mode )
{
bool state = _state[mode];
WVList found;
findStates( states, found );
int icount = found.count();
for( int i=0; i<icount; i++ ) {
MCState* st = (MCState*)found[i];
if( st->mode() == mode ) {
state = st->state();
}
}
addone( str, state );
}
示例8: callers
void FunctionSym::callers( WVList & list )
//----------------------------------------
{
int i;
getModule()->findRefSyms( &list, this );
for( i = 0; i < list.count(); i += 1 ) {
Symbol * sym = (Symbol *) list[ i ];
if( sym->symtype() != DR_SYM_FUNCTION ) {
list.removeAt( i );
}
}
}
示例9: referenceHook
static bool referenceHook( drmem_hdl, dr_ref_info * refinfo, char * name,
void * info )
//-----------------------------------------------------------------------
{
Reference * ref;
WVList * list = (WVList *) info;
for( int i = 0; i < list->count(); i++ ) {
ref = (Reference *) (*list)[i];
if( ref->line() == refinfo->line && ref->column() == refinfo->column
&& strcmp( ref->sourceFile(), refinfo->file ) == 0 ) {
WBRFree( name );
return true;
}
}
list->add( new Reference( refinfo, name ) );
return true; // keep going
}
示例10: DescriptionPart
DescriptionPaint::DescriptionPaint( WBRWindow * prnt, const WRect & r,
Symbol * sym )
: _parent( prnt )
, _rect( r )
, _current( -1 )
//--------------------------------------------------------------------
{
int i;
WVList desc;
Description * entry;
WString buf;
const char * uDefSymName;
int x = r.x();
int w;
int h;
_parts = new WCPtrOrderedVector<DescriptionPart>;
sym->description( desc );
for( i = 0; i < desc.count(); i += 1 ) {
entry = (Description *) desc[i];
if( entry->symbol() ) {
if( sym->isEqual( entry->symbol() ) ) {
// don't hilight the symbol we're describing
buf.concat( entry->name() );
delete entry->symbol();
} else {
if( buf != "" ) { // flush buf
w = prnt->getTextExtentX( buf );
h = prnt->getTextExtentY( buf );
_parts->append( new DescriptionPart( buf.gets(), NULL,
WRect(x,r.y(),w, h ) ) );
buf="";
x+=w;
}
uDefSymName = entry->name();
w = prnt->getTextExtentX( uDefSymName );
h = prnt->getTextExtentY( uDefSymName );
_parts->append( new DescriptionPart( uDefSymName,
entry->symbol(),
WRect(x,r.y(),w, h ) ) );
x+=w;
}
} else {
buf.concat( entry->name() );
}
}
desc.deleteContents();
if( buf != "" ) { // flush buf
w = prnt->getTextExtentX( buf );
h = prnt->getTextExtentY( buf );
_parts->append( new DescriptionPart( buf, NULL,
WRect(x,r.y(),w, h ) ) );
buf="";
x+=w;
}
_rect.w( x - abs( _rect.x() ) );
}
示例11: REQUIRE
ClassType * StrucViewItem::flattenTypeDesc( Symbol * sym, WString & desc )
//------------------------------------------------------------------------
{
ClassType * classType = NULL;
char * str = NULL;
WVList typeParts;
Description * entry;
int i;
REQUIRE( sym != NULL, "strucview::flatten passed null symbol!" );
dr_sym_type stype = sym->symtype();
REQUIRE( stype != DR_SYM_NOT_SYM,"strucview::flatten bad set");
switch( stype ) {
case DR_SYM_VARIABLE:
// need to find out the type of the data member
((VariableSym *) sym)->loadTypeInfo( typeParts );
for( i = 0; i < typeParts.count(); i++ ) {
entry = (Description *) typeParts[i];
if( entry->_nameGoesHere ) {
desc.concat( entry->u.text );
} else {
if( !sym->isEqual( entry->u.sym ) ){
if( classType == NULL ) {
classType = flattenTypeDesc( entry->u.sym, desc );
} else {
desc.concat( entry->u.sym->name() );
}
}
}
}
break;
case DR_SYM_TYPEDEF:
case DR_SYM_ENUM:
sym->description( typeParts );
for( i = 0; i < typeParts.count(); i++ ) {
entry = (Description *) typeParts[ i ];
if( entry->_isUserDefined ) {
if( entry->u.sym->symtype() == DR_SYM_CLASS && classType == NULL ) {
classType = (ClassType *) entry->u.sym;
}
}
}
desc.concat( sym->name() );
break;
case DR_SYM_CLASS:
if( _parent->isSeen( sym ) ) {
desc.concat( sym->name() );
classType = NULL;
} else {
classType = (ClassType *) sym;
desc.concat( classType->name() );
}
break;
default: {}
}
for( i=0; i < typeParts.count(); i++ ) {
entry = (Description *) typeParts[ i ];
if( entry->_isUserDefined && entry->u.sym != classType &&
entry->u.sym != sym ) {
delete entry->u.sym;
}
}
typeParts.deleteContents();
return classType;
}