void Driver::removeAllMacrosInFile( const QString& fileName ) { QMap<QString, Macro>::Iterator it = m_macros.begin(); while( it != m_macros.end() ){ Macro m = *it++; if( m.fileName() == fileName ) removeMacro( m.name() ); } }
/** * locate and remove a named macro space * * @param name The name of the target macro. * * @return The removed table item, or NULL if this is not found. */ MacroItem *MacroTable::remove(const char *name) { MacroItem *current = macros; // start the search MacroItem *previous = NULL; // no previous one while (current != NULL) /* while more macros */ { iterator = NULL; // this invalidates any iterator we may have // find the one we want? if (Utilities::strCaselessCompare(name, current->name) == 0) { // move this to the front so we find it quickly removeMacro(current, previous); return current; } previous = current; /* remember this block */ current = current->next; /* step to the next block */ } return NULL; }