예제 #1
0
inline Status listInAbsoluteDirectory(const fs::path& path,
                                      std::vector<std::string>& results,
                                      GlobLimits limits) {
  if (path.filename() == "*" && !pathExists(path.parent_path())) {
    return Status(1, "Directory not found: " + path.parent_path().string());
  }

  if (path.filename() == "*" && !isDirectory(path.parent_path())) {
    return Status(1, "Path not a directory: " + path.parent_path().string());
  }

  genGlobs(path.string(), results, limits);
  return Status(0, "OK");
}
예제 #2
0
inline Status listInAbsoluteDirectory(const fs::path& path,
                                      std::vector<std::string>& results,
                                      GlobLimits limits) {
  try {
    if (path.filename() == "*" && !fs::exists(path.parent_path())) {
      return Status(1, "Directory not found: " + path.parent_path().string());
    }

    if (path.filename() == "*" && !fs::is_directory(path.parent_path())) {
      return Status(1, "Path not a directory: " + path.parent_path().string());
    }
  } catch (const fs::filesystem_error& e) {
    return Status(1, e.what());
  }
  genGlobs(path.string(), results, limits);
  return Status(0, "OK");
}
예제 #3
0
Status resolveFilePattern(const fs::path& fs_path,
                          std::vector<std::string>& results,
                          GlobLimits setting) {
  genGlobs(fs_path.string(), results, setting);
  return Status(0, "OK");
}