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

Method setModuleExtension

Engine/source/module/moduleManager.cpp:135–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133//-----------------------------------------------------------------------------
134
135bool ModuleManager::setModuleExtension( const char* pExtension )
136{
137 // Sanity!
138 AssertFatal( pExtension != NULL, "Cannot set module extension with NULL extension." );
139
140 // Did we find an extension period?
141 if ( *pExtension == '.' )
142 {
143 // Yes, so warn.
144 Con::warnf("Module Manager: Failed to set extension as supplied extension contains an initial period: '%s'.", pExtension );
145 return false;
146 }
147
148 // Is the extension too large?
149 if ( dStrlen( pExtension ) > sizeof( mModuleExtension ) )
150 {
151 // Yes, so warn.
152 Con::warnf("Module Manager: Failed to set extension as supplied extension is too large: '%s'.", pExtension );
153 return false;
154 }
155
156 // Set module extension.
157 dStrcpy( mModuleExtension, pExtension );
158
159 return true;
160}
161
162//-----------------------------------------------------------------------------
163

Callers 1

Calls 3

warnfFunction · 0.85
dStrcpyFunction · 0.85
dStrlenFunction · 0.50

Tested by

no test coverage detected