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

Method TouchFileList_f

neo/framework/FileSystem.cpp:2055–2079  ·  view source on GitHub ↗

============ idFileSystemLocal::TouchFileList_f Takes a text file and touches every file in it, use one file per line. ============ */

Source from the content-addressed store, hash-verified

2053============
2054*/
2055void idFileSystemLocal::TouchFileList_f( const idCmdArgs &args ) {
2056
2057 if ( args.Argc() != 2 ) {
2058 common->Printf( "Usage: touchFileList <filename>\n" );
2059 return;
2060 }
2061
2062 const char *buffer = NULL;
2063 idParser src( LEXFL_NOFATALERRORS | LEXFL_NOSTRINGCONCAT | LEXFL_ALLOWMULTICHARLITERALS | LEXFL_ALLOWBACKSLASHSTRINGCONCAT );
2064 if ( fileSystem->ReadFile( args.Argv( 1 ), ( void** )&buffer, NULL ) && buffer ) {
2065 src.LoadMemory( buffer, strlen( buffer ), args.Argv( 1 ) );
2066 if ( src.IsLoaded() ) {
2067 idToken token;
2068 while( src.ReadToken( &token ) ) {
2069 common->Printf( "%s\n", token.c_str() );
2070 session->UpdateScreen();
2071 idFile *f = fileSystemLocal.OpenFileRead( token );
2072 if ( f ) {
2073 fileSystemLocal.CloseFile( f );
2074 }
2075 }
2076 }
2077 }
2078
2079}
2080
2081
2082/*

Callers

nothing calls this directly

Calls 11

ArgcMethod · 0.80
ReadFileMethod · 0.80
ArgvMethod · 0.80
UpdateScreenMethod · 0.80
OpenFileReadMethod · 0.80
CloseFileMethod · 0.80
PrintfMethod · 0.45
LoadMemoryMethod · 0.45
IsLoadedMethod · 0.45
ReadTokenMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected