MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / selectFileByIndex

Method selectFileByIndex

Marlin/src/sd/cardreader.cpp:1115–1127  ·  view source on GitHub ↗

Get info for a file in the working directory by index

Source from the content-addressed store, hash-verified

1113// Get info for a file in the working directory by index
1114//
1115void CardReader::selectFileByIndex(const int16_t nr) {
1116 #if ENABLED(SDSORT_CACHE_NAMES)
1117 if (nr < sort_count) {
1118 strcpy(filename, sortshort[nr]);
1119 strcpy(longFilename, sortnames[nr]);
1120 TERN_(HAS_FOLDER_SORTING, flag.filenameIsDir = IS_DIR(nr));
1121 setBinFlag(extIsBIN(strrchr(filename, '.') + 1));
1122 return;
1123 }
1124 #endif
1125 workDir.rewind();
1126 selectByIndex(workDir, nr);
1127}
1128
1129//
1130// Get info for a file in the working directory by DOS name

Callers 4

process_lcd_p_commandFunction · 0.80
process_lcd_s_commandFunction · 0.80
sdCardInitMethod · 0.80
printButtonMethod · 0.80

Calls 2

extIsBINFunction · 0.85
rewindMethod · 0.45

Tested by

no test coverage detected