MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / extractModelName

Function extractModelName

highs/io/Filereader.cpp:75–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75std::string extractModelName(const std::string& filename) {
76 // Extract model name
77 std::string name = filename;
78 std::size_t found = name.find_last_of("/\\");
79 if (found < name.size()) name = name.substr(found + 1);
80 found = name.find_last_of(".");
81 if (name.substr(found + 1) == "gz") {
82 name.erase(found, name.size() - found);
83 found = name.find_last_of(".");
84 }
85 if (found < name.size()) name.erase(found, name.size() - found);
86 return name;
87}

Callers 1

readModelMethod · 0.85

Calls 3

substrMethod · 0.80
sizeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected