| 177 | } |
| 178 | |
| 179 | std::string get_filename_without_folder(const std::string &path) { |
| 180 | size_t delim1 = path.rfind("/"); |
| 181 | #if defined(_WIN32) |
| 182 | size_t delim2 = path.rfind("\\"); |
| 183 | #else |
| 184 | size_t delim2 = std::string::npos; |
| 185 | #endif |
| 186 | size_t delim_pos = |
| 187 | delim1 == std::string::npos ? delim2 : delim2 == std::string::npos ? delim1 : std::max(delim1, delim2); |
| 188 | return delim_pos != std::string::npos ? path.substr(delim_pos + 1) : path; |
| 189 | } |
| 190 | |
| 191 | bool create_folders_if_necessary(const std::string &path) { |
| 192 | #if defined(_WIN32) |