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

Method setModuleExtension

Engine/source/module/moduleManager.cpp:171–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169//-----------------------------------------------------------------------------
170
171bool ModuleManager::setModuleExtension( const char* pExtension )
172{
173 // Sanity!
174 AssertFatal( pExtension != NULL, "Cannot set module extension with NULL extension." );
175
176 // Did we find an extension period?
177 if ( *pExtension == '.' )
178 {
179 // Yes, so warn.
180 Con::warnf("Module Manager: Failed to set extension as supplied extension contains an initial period: '%s'.", pExtension );
181 return false;
182 }
183
184 // Is the extension too large?
185 if ( dStrlen( pExtension ) > sizeof( mModuleExtension ) )
186 {
187 // Yes, so warn.
188 Con::warnf("Module Manager: Failed to set extension as supplied extension is too large: '%s'.", pExtension );
189 return false;
190 }
191
192 // Set module extension.
193 dStrcpy( mModuleExtension, pExtension, 256 );
194
195 return true;
196}
197
198//-----------------------------------------------------------------------------
199

Callers 1

Calls 3

dStrcpyFunction · 0.85
warnfFunction · 0.50
dStrlenFunction · 0.50

Tested by

no test coverage detected