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

Function FiosGetTownDataListCallback

src/fios.cpp:547–556  ·  view source on GitHub ↗

* Callback for FiosGetTownDataList. * @param fop Purpose of collecting the list. * @param file Name of the file to check. * @return a FIOS_TYPE_JSON type of the found file, FIOS_TYPE_INVALID if not a valid JSON file, and the title of the file (if any). */

Source from the content-addressed store, hash-verified

545 * @return a FIOS_TYPE_JSON type of the found file, FIOS_TYPE_INVALID if not a valid JSON file, and the title of the file (if any).
546 */
547static std::tuple<FiosType, std::string> FiosGetTownDataListCallback(SaveLoadOperation fop, std::string_view file, std::string_view ext)
548{
549 if (fop == SLO_LOAD) {
550 if (StrEqualsIgnoreCase(ext, ".json")) {
551 return { FIOS_TYPE_JSON, GetFileTitle(file, SAVE_DIR) };
552 }
553 }
554
555 return { FIOS_TYPE_INVALID, {} };
556}
557
558/**
559 * Get a list of town data files.

Callers

nothing calls this directly

Calls 2

StrEqualsIgnoreCaseFunction · 0.85
GetFileTitleFunction · 0.85

Tested by

no test coverage detected