Closed cbentejac closed 3 months ago
Instead of cluttering the code with the parameter std::error that is never used, wouldn't it be better to make our wrapper of the std::filesystem::exists()
function that does it?
Like for example in aliceVision/src/system/ we can declare a function
namespace alicevision{
namespace system{
bool exists( const std::filesystem::path& p )
{
std::error ec;
return std::filesystem::exists(p, ec);
}
with inline and noexcept
and [[nodiscard]]
Description
This PR mirrors what has been done in QtAliceVision in alicevision/QtAliceVision#70 and catches the error code thrown by
std::filesystem::exists
to ensure that there is no unhandled thrown exception (for example if a file exists but the user does not have the correct access rights) that might cause the program to crash.Additionally, some functions and variables were renamed to respect the camelBack case.