MCPcopy Create free account
hub / github.com/DFHack/dfhack / getFilesWithPrefixAndSuffix

Function getFilesWithPrefixAndSuffix

library/Core.cpp:1686–1693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1684}
1685
1686static void getFilesWithPrefixAndSuffix(const std::filesystem::path& folder, const std::string& prefix, const std::string& suffix, std::vector<std::filesystem::path>& result) {
1687 std::vector<std::filesystem::path> files;
1688 DFHack::Filesystem::listdir(folder, files);
1689 for ( const auto& f : files) {
1690 if (f.stem().string().starts_with(prefix) && f.extension() == suffix)
1691 result.push_back(f);
1692 }
1693}
1694
1695size_t loadScriptFiles(Core* core, color_ostream& out, const std::span<const std::string> prefix, const std::filesystem::path& folder) {
1696 static const std::string suffix = ".init";

Callers 1

loadScriptFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected