| 133 | //----------------------------------------------------------------------------- |
| 134 | |
| 135 | bool 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 |
no test coverage detected