MCPcopy Create free account
hub / github.com/LBANN/lbann / get_basename_without_ext

Function get_basename_without_ext

src/utils/file_utils.cpp:104–115  ·  view source on GitHub ↗

Return basename without extention.

Source from the content-addressed store, hash-verified

102
103/// Return basename without extention.
104std::string get_basename_without_ext(const std::string file_name)
105{
106 std::string dir;
107 std::string basename;
108 parse_path(file_name, dir, basename);
109
110 size_t pos = basename.find_last_of('.');
111 if (pos == 0u) {
112 return basename;
113 }
114 return basename.substr(0, pos);
115}
116
117/**
118 * This automatically attaches the directory deliminator at the end of the given

Callers 5

modify_file_nameFunction · 0.85
loadMethod · 0.85
loadMethod · 0.85

Calls 1

parse_pathFunction · 0.85

Tested by

no test coverage detected