MCPcopy Create free account
hub / github.com/apple/coremltools / basename

Function basename

mlmodel/tools/enumgen.cpp:13–17  ·  view source on GitHub ↗

extract the portion of filename before the first . character

Source from the content-addressed store, hash-verified

11
12// extract the portion of filename before the first . character
13static std::string basename(const std::string& filename) {
14 size_t dotPosition = filename.find('.');
15 assert(dotPosition != std::string::npos);
16 return filename.substr(0, dotPosition);
17}
18
19// make a filename like foo_enums.h from foo.proto
20static std::string makeExt(const std::string& filename) {

Callers 2

makeExtFunction · 0.85
makeGuardFunction · 0.85

Calls 2

findMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected