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

Function get_ext_name

src/utils/file_utils.cpp:90–101  ·  view source on GitHub ↗

Return file extention name.

Source from the content-addressed store, hash-verified

88
89/// Return file extention name.
90std::string get_ext_name(const std::string file_name)
91{
92 std::string dir;
93 std::string basename;
94 parse_path(file_name, dir, basename);
95
96 size_t pos = basename.find_last_of('.');
97 if (pos >= basename.size()) {
98 return ""; // hidden file
99 }
100 return basename.substr(pos + 1, basename.size());
101}
102
103/// Return basename without extention.
104std::string get_basename_without_ext(const std::string file_name)

Callers 5

read_imageFunction · 0.85
modify_file_nameFunction · 0.85
loadMethod · 0.85
loadMethod · 0.85

Calls 2

parse_pathFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected