C++17 filesystem library introduced the notion of a filesystem path.
Paths can be converted to their absolute, canonical and relative forms and tested for equivalence across all these types.
Paths that refer to directories can be explored using directory iterators either only for that directory or recursively.
Compiler Explorer link: https://compiler-explorer.com/z/3G7Gvn4T6