MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / change_extension

Function change_extension

src/ifcconvert/IfcConvert.cpp:161–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159
160template <typename T>
161T change_extension(const T& fn, const T& ext) {
162 typename T::size_type dot = fn.find_last_of('.');
163 if (dot != T::npos) {
164 return fn.substr(0, dot) + ext;
165 } else {
166 return fn + ext;
167 }
168}
169
170bool file_exists(const std::string& filename) {
171 std::ifstream file(IfcUtil::path::from_utf8(filename).c_str());

Callers 1

IfcConvert.cppFile · 0.85

Calls 1

substrMethod · 0.80

Tested by

no test coverage detected