sandboxed-api/oss-internship-2020/sapi_libarchive/examples/helpers.cc
2020-09-09 12:02:40 +00:00

13 lines
589 B
C++

#include "helpers.h"
std::vector<std::string> MakeAbsolutePaths(char *argv[]) {
std::vector<std::string> arr;
sandbox2::util::CharPtrArrToVecString(argv, &arr);
// std::transform(arr.begin(), arr.end(), arr.begin(), [](std::string s) -> std::string {
// return sandbox2::file_util::fileops::MakeAbsolute(s, sandbox2::file_util::fileops::GetCWD());
// });
auto f = std::bind(sandbox2::file_util::fileops::MakeAbsolute, std::placeholders::_1, sandbox2::file_util::fileops::GetCWD());
std::transform(arr.begin(), arr.end(), arr.begin(), f);
return arr;
}