Extract extension from filename and check against given fileext fileext must be lowercase
| 50 | // Extract extension from filename and check against given fileext |
| 51 | // fileext must be lowercase |
| 52 | bool check_fileext(const filesystem::path &filepath, const std::string fileext) { |
| 53 | std::string ext{filepath.extension().string()}; // extract file ext |
| 54 | std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower); // make ext lowercase |
| 55 | return ext == fileext; |
| 56 | } |
| 57 | |
| 58 | // Returns true if the given str was found in buf |
| 59 | bool find_str_in_buf(const std::string str, const std::vector<char> &buf) { |