clang  14.0.0git
DirectoryScanner.h
Go to the documentation of this file.
1 //===- DirectoryScanner.h - Utility functions for DirectoryWatcher --------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 #include "llvm/Support/FileSystem.h"
11 #include <string>
12 #include <vector>
13 
14 namespace clang {
15 
16 /// 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't
18 /// be read from.
19 std::vector<std::string> scanDirectory(llvm::StringRef Path);
20 
21 /// Create event with EventKind::Added for every element in \p Scan.
22 std::vector<DirectoryWatcher::Event>
23 getAsFileEvents(const std::vector<std::string> &Scan);
24 
25 /// Gets status of file (or directory) at \p Path.
26 /// \returns llvm::None if \p Path doesn't exist or can't get the status.
28 
29 } // namespace clang
llvm::Optional
Definition: LLVM.h:40
clang::getFileStatus
Optional< sys::fs::file_status > getFileStatus(StringRef Path)
Definition: DirectoryScanner.cpp:17
DirectoryWatcher.h
clang::getAsFileEvents
std::vector< DirectoryWatcher::Event > getAsFileEvents(const std::vector< std::string > &Scan)
Create event with EventKind::Added for every element in Scan.
Definition: DirectoryScanner.cpp:43
clang
Definition: CalledOnceCheck.h:17
Scan
static void Scan(IvarUsageMap &M, const Stmt *S)
Definition: ObjCUnusedIVarsChecker.cpp:32
clang::scanDirectory
std::vector< std::string > scanDirectory(StringRef Path)
Definition: DirectoryScanner.cpp:25