Skip to content

Commit

Permalink
Scripting|libcore: Checking if a particular native module exists
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 30, 2018
1 parent 9a53797 commit 512b1d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doomsday/sdk/libcore/include/de/scriptsys/scriptsystem.h
Expand Up @@ -68,6 +68,8 @@ class DENG2_PUBLIC ScriptSystem : public System

void removeNativeModule(String const &name);

bool nativeModuleExists(const String &name) const;

Record &nativeModule(String const &name);

/**
Expand Down
6 changes: 6 additions & 0 deletions doomsday/sdk/libcore/src/scriptsys/scriptsystem.cpp
Expand Up @@ -216,6 +216,12 @@ Record &ScriptSystem::nativeModule(String const &name)
return *foundNative.value();
}

bool ScriptSystem::nativeModuleExists(const String &name) const
{
DENG2_GUARD_FOR(d->nativeModules, G);
return d->nativeModules.value.contains(name);
}

StringList ScriptSystem::nativeModules() const
{
DENG2_GUARD_FOR(d->nativeModules, G);
Expand Down

0 comments on commit 512b1d5

Please sign in to comment.