MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / FromFile

Method FromFile

neo/tools/compilers/aas/AASFile.cpp:347–371  ·  view source on GitHub ↗

============ idAASSettings::FromFile ============ */

Source from the content-addressed store, hash-verified

345============
346*/
347bool 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============

Callers

nothing calls this directly

Calls 5

PrintfMethod · 0.45
c_strMethod · 0.45
LoadFileMethod · 0.45
ErrorMethod · 0.45
ExpectTokenStringMethod · 0.45

Tested by

no test coverage detected