MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / scanModules

Method scanModules

Engine/source/module/moduleManager.cpp:200–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198//-----------------------------------------------------------------------------
199
200bool ModuleManager::scanModules( const char* pPath, const bool rootOnly )
201{
202 // Lock database.
203 LockDatabase( this );
204
205 // Sanity!
206 AssertFatal( pPath != NULL, "Cannot scan module with NULL path." );
207
208 String relBasePath = Platform::makeRelativePathName(pPath, NULL);
209 // Info.
210 if ( mEchoInfo )
211 {
212 Con::printSeparator();
213 Con::printf("Module Manager: Started scanning '%s'...", relBasePath.c_str());
214 }
215
216 String pattern = "*.";
217 pattern += mModuleExtension;
218
219 Torque::Path scanPath = Torque::FS::GetCwd();
220 scanPath.setPath(relBasePath);
221
222 Vector<String> fileList;
223 S32 numModules = Torque::FS::FindByPattern(scanPath, pattern, !rootOnly, fileList, true);
224 for (S32 i = 0; i < numModules; ++i)
225 {
226 Torque::Path modulePath = fileList[i];
227 registerModule(modulePath.getPath(), modulePath.getFullFileName());
228 }
229
230 // Info.
231 if ( mEchoInfo )
232 {
233 Con::printf("Module Manager: Finished scanning '%s'.", relBasePath.c_str());
234 }
235
236 return true;
237}
238
239//-----------------------------------------------------------------------------
240

Callers 4

canMergeModulesMethod · 0.80
mergeModulesMethod · 0.80

Calls 7

LockDatabaseClass · 0.85
printSeparatorFunction · 0.85
printfFunction · 0.85
FindByPatternFunction · 0.85
c_strMethod · 0.45
setPathMethod · 0.45
getPathMethod · 0.45

Tested by

no test coverage detected