LLVM API Documentation

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/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::copy_option
struct  llvm::sys::fs::space_info
 space_info - Self explanatory. More...
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

namespace  llvm
 

List of target independent CodeGen pass IDs.


namespace  llvm::sys
namespace  llvm::sys::fs
namespace  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_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_mask = all_all | set_uid_on_exe | set_gid_on_exe | sticky_bit, llvm::sys::fs::perms_not_known = 0xFFFF, llvm::sys::fs::add_perms = 0x1000,
  llvm::sys::fs::remove_perms = 0x2000, llvm::sys::fs::symlink_perms = 0x4000
}

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.
error_code llvm::sys::fs::copy_file (const Twine &from, const Twine &to, copy_option copt=copy_option::fail_if_exists)
 Copy the file at from to the path to.
error_code llvm::sys::fs::create_directories (const Twine &path, bool &existed)
 Create all the non-existent directories in path.
error_code llvm::sys::fs::create_directory (const Twine &path, bool &existed)
 Create the directory in path.
error_code llvm::sys::fs::create_hard_link (const Twine &to, const Twine &from)
 Create a hard link from from to to.
error_code llvm::sys::fs::create_symlink (const Twine &to, const Twine &from)
 Create a symbolic link from from to to.
error_code llvm::sys::fs::current_path (SmallVectorImpl< char > &result)
 Get the current path.
error_code llvm::sys::fs::remove (const Twine &path, bool &existed)
 Remove path. Equivalent to POSIX remove().
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().
error_code llvm::sys::fs::rename (const Twine &from, const Twine &to)
 Rename from to to. Files are renamed as if by POSIX rename().
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().
Physical Observers
bool llvm::sys::fs::exists (file_status status)
 Does file exist?
error_code llvm::sys::fs::exists (const Twine &path, bool &result)
 Does file exist?
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.
bool llvm::sys::fs::equivalent (file_status A, file_status B)
 Do file_status's represent the same thing?
error_code llvm::sys::fs::equivalent (const Twine &A, const Twine &B, bool &result)
 Do paths represent the same thing?
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.
error_code llvm::sys::fs::file_size (const Twine &path, uint64_t &result)
 Get file size.
bool llvm::sys::fs::is_directory (file_status status)
 Does status represent a directory?
error_code llvm::sys::fs::is_directory (const Twine &path, bool &result)
 Is path a directory?
bool llvm::sys::fs::is_regular_file (file_status status)
 Does status represent a regular file?
error_code llvm::sys::fs::is_regular_file (const Twine &path, bool &result)
 Is path a regular file?
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?
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?
bool llvm::sys::fs::is_symlink (file_status status)
 Does status represent a symlink?
error_code llvm::sys::fs::is_symlink (const Twine &path, bool &result)
 Is path a symlink?
error_code llvm::sys::fs::status (const Twine &path, file_status &result)
 Get file status as if by POSIX stat().
error_code llvm::sys::fs::permissions (const Twine &path, perms prms)
 Modifies permission bits on a file.
bool llvm::sys::fs::status_known (file_status s)
 Is status available?
error_code llvm::sys::fs::status_known (const Twine &path, bool &result)
 Is status available?
error_code llvm::sys::fs::unique_file (const Twine &model, int &result_fd, SmallVectorImpl< char > &result_path, bool makeAbsolute=true, unsigned mode=0600)
 Generate a unique path and open it as a file.
error_code llvm::sys::fs::canonicalize (const Twine &path, SmallVectorImpl< char > &result)
 Canonicalize path.
error_code llvm::sys::fs::has_magic (const Twine &path, const Twine &magic, bool &result)
 Are path's first bytes magic?
error_code llvm::sys::fs::get_magic (const Twine &path, uint32_t len, SmallVectorImpl< char > &result)
 Get path's first len bytes.
file_magic llvm::sys::fs::identify_magic (StringRef magic)
 Identify the type of a binary file based on how magical it is.
error_code llvm::sys::fs::identify_magic (const Twine &path, file_magic &result)
 Get and identify path's type based on its content.
error_code llvm::sys::fs::GetSystemLibraryPaths (SmallVectorImpl< std::string > &result)
 Get library paths the system linker uses.
error_code llvm::sys::fs::GetBitcodeLibraryPaths (SmallVectorImpl< std::string > &result)
 Get bitcode library paths the system linker uses + LLVM_LIB_SEARCH_PATH + LLVM_LIBDIR.
error_code llvm::sys::fs::FindLibrary (const Twine &short_name, SmallVectorImpl< char > &result)
 Find a library.
error_code llvm::sys::fs::GetMainExecutable (const char *argv0, void *MainAddr, SmallVectorImpl< char > &result)
 Get absolute path of main executable.
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.
error_code llvm::sys::fs::unmap_file_pages (void *base, size_t size)
 Memory unmaps the contents of a file.