Ejemplo n.º 1
0
// Delete a symbol from this library
void CLibraryDb::DeleteSymbol(CLibraryStoreNameSet &symbol)
{
	// Delete the symbol from this library...
	DeleteSymbol(symbol.FilePos);

	// Now re-read with the changes...
	ReRead();
}
Ejemplo n.º 2
0
Symbol DeleteDefine (char *name) 
{
    return DeleteSymbol (&DefineTable, name);
}
Ejemplo n.º 3
0
// Write back a symbol collection and rebuild methods file
// (i.e. partial tidy)
void CLibraryDb::SaveSymbolCollection( symbolCollection &temp_m_Symbols )
{
	std::set<int> del_set;

	// Now read the m_Symbols from this database
	CDbLibNameSet name_set( &m_database );
	name_set.Open();

	while (!name_set.IsEOF())
	{
		// Find this name in the set...
		symbolCollection::iterator it = temp_m_Symbols.begin();
		while (it != temp_m_Symbols.end())
		{
			CLibraryStoreNameSet& thisSymbol = it->second;

			// Do this for each of the names in the symbol set
			for (int i =0; i < thisSymbol.GetNumRecords(); i++)
			{
				CSymbolRecord &r = thisSymbol.GetRecord( i );

				if (r.NameID == name_set.m_NameID)
				{
					// Found it - so update it...
					name_set.Edit();
					name_set.m_Name = r.name;
					name_set.m_SymbolID = thisSymbol.FilePos;
					name_set.m_Type = 0;
					name_set.m_Reference = r.reference;
					name_set.m_ppp = thisSymbol.ppp;
					name_set.m_Description = r.description;
					name_set.m_ShowName = static_cast<int>(r.name_type);
					name_set.m_ShowRef = static_cast<int>(r.ref_type);
					name_set.Update();
					break;
				}
			}

			++ it;
		}

		// Did we find it?
		if (it == temp_m_Symbols.end())
		{
			// No, so tag it for deletion delete it...
			del_set.insert( name_set.m_SymbolID );
		}

		name_set.MoveNext();
	}

	// Now delete the m_Symbols we have tagged for deletion
	std::set<int>::iterator itd = del_set.begin();
	while (itd != del_set.end())
	{
		DeleteSymbol( *itd );
		++ itd;
	}

	ReRead();
}