LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Enumerations | Functions
FileSystem.h File Reference
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/TimeValue.h"
#include "llvm/Support/system_error.h"
#include <ctime>
#include <iterator>
#include <stack>
#include <string>
#include <vector>
Include dependency graph for FileSystem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  llvm::sys::fs::file_type
 
struct  llvm::sys::fs::space_info
 space_info - Self explanatory. More...
 
class  llvm::sys::fs::UniqueID
 
class  llvm::sys::fs::file_status
 
struct  llvm::sys::fs::file_magic
 
class  llvm::sys::fs::mapped_file_region
 
class  llvm::sys::fs::directory_entry
 
struct  llvm::sys::fs::detail::DirIterState
 
class  llvm::sys::fs::directory_iterator
 
struct  llvm::sys::fs::detail::RecDirIterState
 
class  llvm::sys::fs::recursive_directory_iterator
 

Namespaces

 llvm
 List of target independent CodeGen pass IDs.
 
 llvm::sys
 
 llvm::sys::fs
 
 llvm::sys::fs::detail
 

Enumerations

enum  llvm::sys::fs::perms {
  llvm::sys::fs::no_perms = 0, llvm::sys::fs::owner_read = 0400, llvm::sys::fs::owner_write = 0200, llvm::sys::fs::owner_exe = 0100,
  llvm::sys::fs::owner_all = owner_read | owner_write | owner_exe, llvm::sys::fs::group_read = 040, llvm::sys::fs::group_write = 020, llvm::sys::fs::group_exe = 010,
  llvm::sys::fs::group_all = group_read | group_write | group_exe, llvm::sys::fs::others_read = 04, llvm::sys::fs::others_write = 02, llvm::sys::fs::others_exe = 01,
  llvm::sys::fs::others_all = others_read | others_write | others_exe, llvm::sys::fs::all_read = owner_read | group_read | others_read, llvm::sys::fs::all_write = owner_write | group_write | others_write, llvm::sys::fs::all_exe = owner_exe | group_exe | others_exe,
  llvm::sys::fs::all_all = owner_all | group_all | others_all, llvm::sys::fs::set_uid_on_exe = 04000, llvm::sys::fs::set_gid_on_exe = 02000, llvm::sys::fs::sticky_bit = 01000,
  llvm::sys::fs::perms_not_known = 0xFFFF
}
 

Functions

perms llvm::sys::fs::operator| (perms l, perms r)
 
perms llvm::sys::fs::operator& (perms l, perms r)
 
perms & llvm::sys::fs::operator|= (perms &l, perms r)
 
perms & llvm::sys::fs::operator&= (perms &l, perms r)
 
perms llvm::sys::fs::operator~ (perms x)
 
error_code llvm::sys::fs::detail::directory_iterator_construct (DirIterState &, StringRef)
 
error_code llvm::sys::fs::detail::directory_iterator_increment (DirIterState &)
 
error_code llvm::sys::fs::detail::directory_iterator_destruct (DirIterState &)
 
Physical Operators
error_code llvm::sys::fs::make_absolute (SmallVectorImpl< char > &path)
 Make path an absolute path. More...
 
error_code llvm::sys::fs::create_directories (const Twine &path, bool &existed)
 Create all the non-existent directories in path. More...
 
error_code llvm::sys::fs::create_directories (const Twine &Path)
 Convenience function for clients that don't need to know if the directory existed or not. More...
 
error_code llvm::sys::fs::create_directory (const Twine &path, bool &existed)
 Create the directory in path. More...
 
error_code llvm::sys::fs::create_directory (const Twine &Path)
 Convenience function for clients that don't need to know if the directory existed or not. More...
 
error_code llvm::sys::fs::create_hard_link (const Twine &to, const Twine &from)
 Create a hard link from from to to. More...
 
error_code llvm::sys::fs::create_symlink (const Twine &to, const Twine &from)
 Create a symbolic link from from to to. More...
 
error_code llvm::sys::fs::current_path (SmallVectorImpl< char > &result)
 Get the current path. More...
 
error_code llvm::sys::fs::remove (const Twine &path, bool &existed)
 Remove path. Equivalent to POSIX remove(). More...
 
error_code llvm::sys::fs::remove (const Twine &Path)
 Convenience function for clients that don't need to know if the file existed or not. More...
 
error_code llvm::sys::fs::remove_all (const Twine &path, uint32_t &num_removed)
 Recursively remove all files below path, then path. Files are removed as if by POSIX remove(). More...
 
error_code llvm::sys::fs::remove_all (const Twine &Path)
 Convenience function for clients that don't need to know how many files were removed. More...
 
error_code llvm::sys::fs::rename (const Twine &from, const Twine &to)
 Rename from to to. Files are renamed as if by POSIX rename(). More...
 
error_code llvm::sys::fs::resize_file (const Twine &path, uint64_t size)
 Resize path to size. File is resized as if by POSIX truncate(). More...
 

Physical Observers

enum  llvm::sys::fs::OpenFlags { llvm::sys::fs::F_None = 0, llvm::sys::fs::F_Excl = 1, llvm::sys::fs::F_Append = 2, llvm::sys::fs::F_Binary = 4 }
 
bool llvm::sys::fs::exists (file_status status)
 Does file exist? More...
 
error_code llvm::sys::fs::exists (const Twine &path, bool &result)
 Does file exist? More...
 
bool llvm::sys::fs::exists (const Twine &path)
 Simpler version of exists for clients that don't need to differentiate between an error and false. More...
 
bool llvm::sys::fs::can_execute (const Twine &Path)
 Can we execute this file? More...
 
bool llvm::sys::fs::can_write (const Twine &Path)
 Can we write this file? More...
 
bool llvm::sys::fs::equivalent (file_status A, file_status B)
 Do file_status's represent the same thing? More...
 
error_code llvm::sys::fs::equivalent (const Twine &A, const Twine &B, bool &result)
 Do paths represent the same thing? More...
 
bool llvm::sys::fs::equivalent (const Twine &A, const Twine &B)
 Simpler version of equivalent for clients that don't need to differentiate between an error and false. More...
 
bool llvm::sys::fs::is_directory (file_status status)
 Does status represent a directory? More...
 
error_code llvm::sys::fs::is_directory (const Twine &path, bool &result)
 Is path a directory? More...
 
bool llvm::sys::fs::is_directory (const Twine &Path)
 Simpler version of is_directory for clients that don't need to differentiate between an error and false. More...
 
bool llvm::sys::fs::is_regular_file (file_status status)
 Does status represent a regular file? More...
 
error_code llvm::sys::fs::is_regular_file (const Twine &path, bool &result)
 Is path a regular file? More...
 
bool llvm::sys::fs::is_regular_file (const Twine &Path)
 Simpler version of is_regular_file for clients that don't need to differentiate between an error and false. More...
 
bool llvm::sys::fs::is_other (file_status status)
 Does this status represent something that exists but is not a directory, regular file, or symlink? More...
 
error_code llvm::sys::fs::is_other (const Twine &path, bool &result)
 Is path something that exists but is not a directory, regular file, or symlink? More...
 
bool llvm::sys::fs::is_symlink (file_status status)
 Does status represent a symlink? More...
 
error_code llvm::sys::fs::is_symlink (const Twine &path, bool &result)
 Is path a symlink? More...
 
error_code llvm::sys::fs::status (const Twine &path, file_status &result)
 Get file status as if by POSIX stat(). More...
 
error_code llvm::sys::fs::status (int FD, file_status &Result)
 A version for when a file descriptor is already available. More...
 
error_code llvm::sys::fs::file_size (const Twine &Path, uint64_t &Result)
 Get file size. More...
 
error_code llvm::sys::fs::setLastModificationAndAccessTime (int FD, TimeValue Time)
 
bool llvm::sys::fs::status_known (file_status s)
 Is status available? More...
 
error_code llvm::sys::fs::status_known (const Twine &path, bool &result)
 Is status available? More...
 
error_code llvm::sys::fs::createUniqueFile (const Twine &Model, int &ResultFD, SmallVectorImpl< char > &ResultPath, unsigned Mode=all_read|all_write)
 Create a uniquely named file. More...
 
error_code llvm::sys::fs::createUniqueFile (const Twine &Model, SmallVectorImpl< char > &ResultPath)
 Simpler version for clients that don't want an open file. More...
 
error_code llvm::sys::fs::createTemporaryFile (const Twine &Prefix, StringRef Suffix, int &ResultFD, SmallVectorImpl< char > &ResultPath)
 Create a file in the system temporary directory. More...
 
error_code llvm::sys::fs::createTemporaryFile (const Twine &Prefix, StringRef Suffix, SmallVectorImpl< char > &ResultPath)
 Simpler version for clients that don't want an open file. More...
 
error_code llvm::sys::fs::createUniqueDirectory (const Twine &Prefix, SmallVectorImpl< char > &ResultPath)
 
OpenFlags llvm::sys::fs::operator| (OpenFlags A, OpenFlags B)
 
OpenFlags & llvm::sys::fs::operator|= (OpenFlags &A, OpenFlags B)
 
error_code llvm::sys::fs::openFileForWrite (const Twine &Name, int &ResultFD, OpenFlags Flags, unsigned Mode=0666)
 
error_code llvm::sys::fs::openFileForRead (const Twine &Name, int &ResultFD)
 
error_code llvm::sys::fs::has_magic (const Twine &path, const Twine &magic, bool &result)
 Are path's first bytes magic? More...
 
error_code llvm::sys::fs::get_magic (const Twine &path, uint32_t len, SmallVectorImpl< char > &result)
 Get path's first len bytes. More...
 
file_magic llvm::sys::fs::identify_magic (StringRef magic)
 Identify the type of a binary file based on how magical it is. More...
 
error_code llvm::sys::fs::identify_magic (const Twine &path, file_magic &result)
 Get and identify path's type based on its content. More...
 
error_code llvm::sys::fs::getUniqueID (const Twine Path, UniqueID &Result)
 
error_code llvm::sys::fs::map_file_pages (const Twine &path, off_t file_offset, size_t size, bool map_writable, void *&result)
 Memory maps the contents of a file. More...
 
error_code llvm::sys::fs::unmap_file_pages (void *base, size_t size)
 Memory unmaps the contents of a file. More...
 
std::string llvm::sys::fs::getMainExecutable (const char *argv0, void *MainExecAddr)