MCPcopy Create free account
hub / github.com/RenderKit/embree / setExt

Method setExt

common/sys/filename.cpp:81–87  ·  view source on GitHub ↗

! replaces the extension */

Source from the content-addressed store, hash-verified

79
80 /*! replaces the extension */
81 FileName FileName::setExt(const std::string& ext) const {
82 size_t start = filename.find_last_of(path_sep);
83 if (start == std::string::npos) start = 0; else start++;
84 size_t end = filename.find_last_of('.');
85 if (end == std::string::npos || end < start) return FileName(filename+ext);
86 return FileName(filename.substr(0,end)+ext);
87 }
88
89 /*! adds the extension */
90 FileName FileName::addExt(const std::string& ext) const {

Callers 1

XMLLoaderMethod · 0.80

Calls 2

FileNameClass · 0.85
substrMethod · 0.80

Tested by

no test coverage detected