MCPcopy Create free account
hub / github.com/cselab/aphros / GetFormat

Function GetFormat

src/test/dump/dump_diff.cpp:21–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19using MIdx = typename M::MIdx;
20
21std::string GetFormat(std::string path, std::string format) {
22 const auto ext = util::SplitExt(path)[1];
23 if (format == "auto") {
24 if (ext == ".h5") {
25 format = "h5";
26 } else if (ext == ".raw") {
27 format = "raw";
28 } else {
29 fassert(false, util::Format("Unknown extension '{}' of '{}'", ext, path));
30 }
31 }
32 return format;
33}
34
35void Run(M& m, Vars& var) {
36 auto sem = m.GetSem(__func__);

Callers 2

RunFunction · 0.70
mainFunction · 0.70

Calls 2

SplitExtFunction · 0.85
FormatFunction · 0.85

Tested by

no test coverage detected