Lines Matching full:path
19 #include "llvm/Support/Path.h"
92 llvm::ErrorOr<vfs::Status> FileSystem::GetStatus(const Twine &path) const { in GetStatus()
93 return m_fs->status(path); in GetStatus()
103 sys::TimePoint<> FileSystem::GetModificationTime(const Twine &path) const { in GetModificationTime()
104 ErrorOr<vfs::Status> status = m_fs->status(path); in GetModificationTime()
116 uint64_t FileSystem::GetByteSize(const Twine &path) const { in GetByteSize()
117 ErrorOr<vfs::Status> status = m_fs->status(path); in GetByteSize()
134 uint32_t FileSystem::GetPermissions(const Twine &path) const { in GetPermissions()
136 return GetPermissions(path, ec); in GetPermissions()
139 uint32_t FileSystem::GetPermissions(const Twine &path, in GetPermissions() argument
141 ErrorOr<vfs::Status> status = m_fs->status(path); in GetPermissions()
149 bool FileSystem::Exists(const Twine &path) const { return m_fs->exists(path); } in Exists()
155 bool FileSystem::Readable(const Twine &path) const { in Readable()
156 return GetPermissions(path) & sys::fs::perms::all_read; in Readable()
163 bool FileSystem::IsDirectory(const Twine &path) const { in IsDirectory()
164 ErrorOr<vfs::Status> status = m_fs->status(path); in IsDirectory()
174 bool FileSystem::IsLocal(const Twine &path) const { in IsLocal()
176 m_fs->isLocal(path, b); in IsLocal()
184 void FileSystem::EnumerateDirectory(Twine path, bool find_directories, in EnumerateDirectory() argument
189 vfs::recursive_directory_iterator Iter(*m_fs, path, EC); in EnumerateDirectory()
193 ErrorOr<vfs::Status> Status = m_fs->status(Item.path()); in EnumerateDirectory()
203 auto Result = callback(callback_baton, Status->getType(), Item.path()); in EnumerateDirectory()
214 std::error_code FileSystem::MakeAbsolute(SmallVectorImpl<char> &path) const { in MakeAbsolute()
215 return m_fs->makeAbsolute(path); in MakeAbsolute()
219 SmallString<128> path; in MakeAbsolute() local
220 file_spec.GetPath(path, false); in MakeAbsolute()
222 auto EC = MakeAbsolute(path); in MakeAbsolute()
226 FileSpec new_file_spec(path, file_spec.GetPathStyle()); in MakeAbsolute()
231 std::error_code FileSystem::GetRealPath(const Twine &path, in GetRealPath() argument
233 return m_fs->getRealPath(path, output); in GetRealPath()
236 void FileSystem::Resolve(SmallVectorImpl<char> &path) { in Resolve() argument
237 if (path.empty()) in Resolve()
240 // Resolve tilde in path. in Resolve()
241 SmallString<128> resolved(path.begin(), path.end()); in Resolve()
243 Resolver.ResolveFullPath(llvm::StringRef(path.begin(), path.size()), in Resolve()
246 // Try making the path absolute if it exists. in Resolve()
250 path.clear(); in Resolve()
252 path.append(absolute.begin(), absolute.end()); in Resolve()
254 path.append(resolved.begin(), resolved.end()); in Resolve()
262 // Extract path from the FileSpec. in Resolve()
263 SmallString<128> path; in Resolve() local
264 file_spec.GetPath(path); in Resolve()
266 // Resolve the path. in Resolve()
267 Resolve(path); in Resolve()
269 // Update the FileSpec with the resolved path. in Resolve()
271 file_spec.SetDirectory(path); in Resolve()
273 file_spec.SetPath(path); in Resolve()
278 static std::unique_ptr<T> GetMemoryBuffer(const llvm::Twine &path, in GetMemoryBuffer() argument
283 auto buffer_or_error = T::getFile(path, is_volatile); in GetMemoryBuffer()
288 auto buffer_or_error = T::getFileSlice(path, size, offset, is_volatile); in GetMemoryBuffer()
297 FileSystem::CreateWritableDataBuffer(const llvm::Twine &path, uint64_t size, in CreateWritableDataBuffer() argument
299 const bool is_volatile = !IsLocal(path); in CreateWritableDataBuffer()
300 auto buffer = GetMemoryBuffer<llvm::WritableMemoryBuffer>(path, size, offset, in CreateWritableDataBuffer()
309 FileSystem::CreateDataBuffer(const llvm::Twine &path, uint64_t size, in CreateDataBuffer() argument
311 const bool is_volatile = !IsLocal(path); in CreateDataBuffer()
313 GetMemoryBuffer<llvm::MemoryBuffer>(path, size, offset, is_volatile); in CreateDataBuffer()
350 llvm::StringRef path = *error_or_path; in ResolveExecutableLocation() local
351 llvm::StringRef parent = llvm::sys::path::parent_path(path); in ResolveExecutableLocation()
364 bool FileSystem::GetHomeDirectory(SmallVectorImpl<char> &path) const { in GetHomeDirectory()
366 path.assign(m_home_directory.begin(), m_home_directory.end()); in GetHomeDirectory()
369 return llvm::sys::path::home_directory(path); in GetHomeDirectory()
380 static int OpenWithFS(const FileSystem &fs, const char *path, int flags, in OpenWithFS() argument
382 return const_cast<FileSystem &>(fs).Open(path, flags, mode); in OpenWithFS()
458 auto path = file_spec.GetPath(); in Open() local
461 -1, OpenWithFS, *this, path.c_str(), open_flags, open_mode); in Open()
481 Status FileSystem::RemoveFile(const llvm::Twine &path) { in RemoveFile() argument
482 return Status(llvm::sys::fs::remove(path)); in RemoveFile()