Maybe you can lowercase the file extension and then only compare to `"asc"`:

```
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
```