Path: blob/main/contrib/llvm-project/clang/lib/DirectoryWatcher/DirectoryScanner.h
35260 views
//===- DirectoryScanner.h - Utility functions for DirectoryWatcher --------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "clang/DirectoryWatcher/DirectoryWatcher.h"9#include "llvm/Support/FileSystem.h"10#include <optional>11#include <string>12#include <vector>1314namespace clang {1516/// Gets names (filenames) of items in directory at \p Path.17/// \returns empty vector if \p Path is not a directory, doesn't exist or can't18/// be read from.19std::vector<std::string> scanDirectory(llvm::StringRef Path);2021/// Create event with EventKind::Added for every element in \p Scan.22std::vector<DirectoryWatcher::Event>23getAsFileEvents(const std::vector<std::string> &Scan);2425/// Gets status of file (or directory) at \p Path.26/// \returns std::nullopt if \p Path doesn't exist or can't get the status.27std::optional<llvm::sys::fs::file_status> getFileStatus(llvm::StringRef Path);2829} // namespace clang303132