MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ConListFiles

Function ConListFiles

src/console_cmds.cpp:567–580  ·  view source on GitHub ↗

List all the files in the current dir via console */

Source from the content-addressed store, hash-verified

565
566/* List all the files in the current dir via console */
567static bool ConListFiles(std::span<std::string_view> argv)
568{
569 if (argv.empty()) {
570 IConsolePrint(CC_HELP, "List all loadable savegames and directories in the current dir via console. Usage: 'ls | dir'.");
571 return true;
572 }
573
574 _console_file_list_savegame.ValidateFileList(true);
575 for (uint i = 0; i < _console_file_list_savegame.size(); i++) {
576 IConsolePrint(CC_DEFAULT, "{}) {}", i, _console_file_list_savegame[i].title.GetDecodedString());
577 }
578
579 return true;
580}
581
582/* List all the scenarios */
583static bool ConListScenarios(std::span<std::string_view> argv)

Callers

nothing calls this directly

Calls 5

ValidateFileListMethod · 0.80
GetDecodedStringMethod · 0.80
IConsolePrintFunction · 0.70
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected