| 159 | |
| 160 | template <typename T> |
| 161 | T 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 | |
| 170 | bool file_exists(const std::string& filename) { |
| 171 | std::ifstream file(IfcUtil::path::from_utf8(filename).c_str()); |