Category : boost-filesystem

the question is simple , I want to find a file path inside a directory but I have only part of the filename, so here is a function for this task bool find_file(const filesystem::path& dir_path, const filesystem::path file_name, filesystem::path& path_found) { const fs::recursive_directory_iterator end; const auto it = find_if(fs::recursive_directory_iterator(dir_path), end, [file_name](fs::path e) { return boost::algorithm::icontains(e.filename().string() ..

Read more

I am having some file paths like this (both in Windows and Linux): Sample Path 1: %ENV_VAR%/path/to/file/dest.ext Sample Path 2: $ENV_VAR_1%/path/to/another/file/dest.ext Sample Path 3: ${ENV_VAR_2}/path/to/yet/another/file/dest.ext What I need is to extract the variable name and the rest of the path into an string array. I know that it is possible with std::regex, but does anyone ..

Read more