MCPcopy Create free account
hub / github.com/JACoders/OpenJK / FS_FilenameCompletion

Function FS_FilenameCompletion

code/qcommon/files.cpp:3119–3138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3117}
3118
3119void FS_FilenameCompletion( const char *dir, const char *ext, qboolean stripExt, callbackFunc_t callback, qboolean allowNonPureFilesOnDisk ) {
3120 int nfiles;
3121 char **filenames, filename[MAX_STRING_CHARS];
3122
3123 filenames = FS_ListFilteredFiles( dir, ext, NULL, &nfiles );
3124
3125 FS_SortFileList( filenames, nfiles );
3126
3127 // pass all the files to callback (FindMatches)
3128 for ( int i=0; i<nfiles; i++ ) {
3129 FS_ConvertPath( filenames[i] );
3130 Q_strncpyz( filename, filenames[i], MAX_STRING_CHARS );
3131
3132 if ( stripExt )
3133 COM_StripExtension( filename, filename, sizeof( filename ) );
3134
3135 callback( filename );
3136 }
3137 FS_FreeFileList( filenames );
3138}
3139
3140const char *FS_GetCurrentGameDir(bool emptybase)
3141{

Callers 1

Field_CompleteFilenameFunction · 0.70

Calls 6

Q_strncpyzFunction · 0.85
FS_ListFilteredFilesFunction · 0.70
FS_SortFileListFunction · 0.70
FS_ConvertPathFunction · 0.70
COM_StripExtensionFunction · 0.70
FS_FreeFileListFunction · 0.70

Tested by

no test coverage detected