| 169 | //----------------------------------------------------------------------------- |
| 170 | |
| 171 | bool 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 |
no test coverage detected