An in-memory file system. More...
#include "llvm/Support/VirtualFileSystem.h"
Path by combining with the current working directory and normalizing the path (e.g. An in-memory file system.
Definition at line 541 of file VirtualFileSystem.h.
Definition at line 839 of file VirtualFileSystem.cpp.
References llvm::vfs::getDirectoryID().
Referenced by llvm::vfs::InMemoryFileSystem::DirIterator::DirIterator().
References addHardLink().
Add a file containing a buffer or a directory to the VFS with a path.
The VFS owns the buffer. If present, User, Group, Type and Perms apply to the newly-created file or directory.
Definition at line 931 of file VirtualFileSystem.cpp.
References llvm::vfs::detail::NewInMemoryNodeInfo::Buffer, llvm::sys::fs::directory_file, llvm::vfs::Status::getType(), llvm::vfs::detail::NewInMemoryNodeInfo::makeStatus(), and P.
Add a buffer to the VFS with a path.
The VFS does not own the buffer. If present, User, Group, Type and Perms apply to the newly-created file or directory.
Definition at line 949 of file VirtualFileSystem.cpp.
References llvm::vfs::detail::NewInMemoryNodeInfo::Buffer, llvm::sys::fs::directory_file, llvm::MemoryBuffer::getMemBuffer(), llvm::vfs::Status::getType(), llvm::vfs::detail::NewInMemoryNodeInfo::makeStatus(), and P.
Add a hard link to a file.
Here hard links are not intended to be fully equivalent to the classical filesystem. Both the hard link and the file share the same buffer and status (and thus have the same UniqueID). Because of this there is no way to distinguish between the link and the file after the link has been added.
The Target path must be an existing file or a hardlink. The NewLink file must not have been added before. The Target path must not be a directory. The NewLink node is added as a hard link which points to the resolved file of Target node.
Definition at line 1042 of file VirtualFileSystem.cpp.
References llvm::cast(), llvm::isa(), llvm::vfs::detail::NewInMemoryNodeInfo::Path, and llvm::StringRef::str().
Referenced by ~InMemoryFileSystem().
Add a symbolic link.
Unlike a HardLink, because Target doesn't need to refer to a file (or refer to anything, as it happens). Also, an in-memory directory for Target isn't automatically created.
Definition at line 1061 of file VirtualFileSystem.cpp.
References llvm::vfs::detail::NewInMemoryNodeInfo::makeStatus(), llvm::sys::fs::symlink_file, and llvm::Twine::toVector().
Definition at line 1158 of file VirtualFileSystem.cpp.
References llvm::dyn_cast(), llvm::vfs::make_error_code(), llvm::not_a_directory, and llvm::Twine::str().
Definition at line 639 of file VirtualFileSystem.h.
Referenced by getRealPath().
Canonicalizes Path by combining with the current working directory and normalizing the path (e.g.
remove dots). If the current working directory is not set, this returns errc::operation_not_permitted.
This doesn't resolve symlinks as they are not supported in in-memory file system.
Definition at line 1191 of file VirtualFileSystem.cpp.
References getCurrentWorkingDirectory(), makeAbsolute(), llvm::operation_not_permitted, and llvm::sys::path::remove_dots().
Definition at line 1203 of file VirtualFileSystem.cpp.
Definition at line 1089 of file VirtualFileSystem.cpp.
References llvm::dyn_cast(), F, llvm::invalid_argument, and llvm::vfs::make_error_code().
Definition at line 1208 of file VirtualFileSystem.cpp.
Definition at line 1174 of file VirtualFileSystem.cpp.
References assert(), makeAbsolute(), P, llvm::sys::path::remove_dots(), and useNormalizedPaths().
Definition at line 1081 of file VirtualFileSystem.cpp.
Definition at line 849 of file VirtualFileSystem.cpp.
Return true if this file system normalizes . and .. in paths.
Definition at line 632 of file VirtualFileSystem.h.
Referenced by setCurrentWorkingDirectory().
Definition at line 548 of file VirtualFileSystem.h.
Arbitrary max depth to search through symlinks.
We can get into problems if a link links to a link that links back to the link, for example.
Definition at line 604 of file VirtualFileSystem.h.