============ idAASSettings::FromFile ============ */
| 345 | ============ |
| 346 | */ |
| 347 | bool idAASSettings::FromFile( const idStr &fileName ) { |
| 348 | idLexer src( LEXFL_ALLOWPATHNAMES | LEXFL_NOSTRINGESCAPECHARS | LEXFL_NOSTRINGCONCAT ); |
| 349 | idStr name; |
| 350 | |
| 351 | name = fileName; |
| 352 | |
| 353 | common->Printf( "loading %s\n", name.c_str() ); |
| 354 | |
| 355 | if ( !src.LoadFile( name ) ) { |
| 356 | common->Error( "WARNING: couldn't load %s\n", name.c_str() ); |
| 357 | return false; |
| 358 | } |
| 359 | |
| 360 | if ( !src.ExpectTokenString( "settings" ) ) { |
| 361 | common->Error( "%s is not a settings file", name.c_str() ); |
| 362 | return false; |
| 363 | } |
| 364 | |
| 365 | if ( !FromParser( src ) ) { |
| 366 | common->Error( "failed to parse %s", name.c_str() ); |
| 367 | return false; |
| 368 | } |
| 369 | |
| 370 | return true; |
| 371 | } |
| 372 | |
| 373 | /* |
| 374 | ============ |
nothing calls this directly
no test coverage detected