MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / removeDeclaration

Method removeDeclaration

radiantcore/decl/DeclarationManager.cpp:380–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380void DeclarationManager::removeDeclaration(Type type, const std::string& name)
381{
382 // All parsers need to have finished
383 waitForTypedParsersToFinish();
384
385 // Acquire the lock and perform the removal
386 doWithDeclarationLock(type, [&](NamedDeclarations& decls)
387 {
388 auto decl = decls.find(name);
389
390 if (decl != decls.end())
391 {
392 removeDeclarationFromFile(decl->second);
393
394 // Clear out this declaration's syntax block
395 auto syntax = decl->second->getBlockSyntax();
396 syntax.name.clear();
397 syntax.typeName.clear();
398 syntax.contents.clear();
399 syntax.fileInfo = vfs::FileInfo();
400 decl->second->setBlockSyntax(syntax);
401
402 decls.erase(decl);
403
404 signal_DeclRemoved().emit(type, name);
405 }
406 });
407}
408
409namespace
410{

Callers 6

discardChangesMethod · 0.45
deleteSkinMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
removeDefinitionMethod · 0.45
removeParticleDefMethod · 0.45

Calls 6

FileInfoClass · 0.50
findMethod · 0.45
endMethod · 0.45
clearMethod · 0.45
setBlockSyntaxMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected