| 336 | } |
| 337 | |
| 338 | void ConfigPackageUtility::CollectPaths(const String& path, std::vector<std::pair<String, bool> >& paths) |
| 339 | { |
| 340 | #ifndef _WIN32 |
| 341 | struct stat statbuf; |
| 342 | int rc = lstat(path.CStr(), &statbuf); |
| 343 | if (rc < 0) |
| 344 | BOOST_THROW_EXCEPTION(posix_error() |
| 345 | << boost::errinfo_api_function("lstat") |
| 346 | << boost::errinfo_errno(errno) |
| 347 | << boost::errinfo_file_name(path)); |
| 348 | |
| 349 | paths.emplace_back(path, S_ISDIR(statbuf.st_mode)); |
| 350 | #else /* _WIN32 */ |
| 351 | struct _stat statbuf; |
| 352 | int rc = _stat(path.CStr(), &statbuf); |
| 353 | if (rc < 0) |
| 354 | BOOST_THROW_EXCEPTION(posix_error() |
| 355 | << boost::errinfo_api_function("_stat") |
| 356 | << boost::errinfo_errno(errno) |
| 357 | << boost::errinfo_file_name(path)); |
| 358 | |
| 359 | paths.emplace_back(path, ((statbuf.st_mode & S_IFMT) == S_IFDIR)); |
| 360 | #endif /* _WIN32 */ |
| 361 | } |
| 362 | |
| 363 | bool ConfigPackageUtility::ContainsDotDot(const String& path) |
| 364 | { |
nothing calls this directly
no test coverage detected