LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Enumerations | Functions
Path.cpp File Reference
#include "llvm/Support/Path.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include <cctype>
#include <cstdio>
#include <cstring>
#include <fcntl.h>
#include <unistd.h>
Include dependency graph for Path.cpp:

Go to the source code of this file.

Namespaces

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

Enumerations

enum  FSEntity { FS_Dir, FS_File, FS_Name }
 

Functions

static llvm::error_code createUniqueEntity (const llvm::Twine &Model, int &ResultFD, llvm::SmallVectorImpl< char > &ResultPath, bool MakeAbsolute, unsigned Mode, FSEntity Type)
 
static error_code llvm::sys::fs::createTemporaryFile (const Twine &Model, int &ResultFD, llvm::SmallVectorImpl< char > &ResultPath, FSEntity Type)
 
static error_code llvm::sys::fs::createTemporaryFile (const Twine &Prefix, StringRef Suffix, int &ResultFD, llvm::SmallVectorImpl< char > &ResultPath, FSEntity Type)
 
Lexical Component Iterator
const_iterator llvm::sys::path::begin (StringRef path)
 Get begin iterator over path. More...
 
const_iterator llvm::sys::path::end (StringRef path)
 Get end iterator over path. More...
 
Lexical Observers
const StringRef llvm::sys::path::root_path (StringRef path)
 Get root path. More...
 
const StringRef llvm::sys::path::root_name (StringRef path)
 Get root name. More...
 
const StringRef llvm::sys::path::root_directory (StringRef path)
 Get root directory. More...
 
const StringRef llvm::sys::path::relative_path (StringRef path)
 Get relative path. More...
 
const StringRef llvm::sys::path::parent_path (StringRef path)
 Get parent path. More...
 
const StringRef llvm::sys::path::filename (StringRef path)
 Get filename. More...
 
const StringRef llvm::sys::path::stem (StringRef path)
 Get stem. More...
 
const StringRef llvm::sys::path::extension (StringRef path)
 Get extension. More...
 
bool llvm::sys::path::is_separator (char value)
 Check whether the given char is a path separator on the host OS. More...
 
void llvm::sys::path::system_temp_directory (bool erasedOnReboot, SmallVectorImpl< char > &result)
 Get the typical temporary directory for the system, e.g., "/var/tmp" or "C:/TEMP". More...
 
bool llvm::sys::path::has_root_name (const Twine &path)
 Has root name? More...
 
bool llvm::sys::path::has_root_directory (const Twine &path)
 Has root directory? More...
 
bool llvm::sys::path::has_root_path (const Twine &path)
 Has root path? More...
 
bool llvm::sys::path::has_relative_path (const Twine &path)
 Has relative path? More...
 
bool llvm::sys::path::has_filename (const Twine &path)
 Has filename? More...
 
bool llvm::sys::path::has_parent_path (const Twine &path)
 Has parent path? More...
 
bool llvm::sys::path::has_stem (const Twine &path)
 Has stem? More...
 
bool llvm::sys::path::has_extension (const Twine &path)
 Has extension? More...
 
bool llvm::sys::path::is_absolute (const Twine &path)
 Is path absolute? More...
 
bool llvm::sys::path::is_relative (const Twine &path)
 Is path relative? More...
 
Lexical Modifiers
void llvm::sys::path::append (SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
 Append to path. More...
 
void llvm::sys::path::append (SmallVectorImpl< char > &path, const_iterator begin, const_iterator end)
 Append to path. More...
 
void llvm::sys::path::remove_filename (SmallVectorImpl< char > &path)
 Remove the last component from path unless it is the root dir. More...
 
void llvm::sys::path::replace_extension (SmallVectorImpl< char > &path, const Twine &extension)
 Replace the file extension of path with extension. More...
 
Transforms (or some other better name)
void llvm::sys::path::native (const Twine &path, SmallVectorImpl< char > &result)
 
void llvm::sys::path::native (SmallVectorImpl< char > &path)
 
Physical Observers
error_code llvm::sys::fs::getUniqueID (const Twine Path, UniqueID &Result)
 
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)
 
bool llvm::sys::fs::exists (file_status status)
 Does file exist? More...
 
bool llvm::sys::fs::status_known (file_status s)
 Is status available? 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_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_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...
 
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::has_magic (const Twine &path, const Twine &magic, bool &result)
 Are path's first bytes magic? 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...
 
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::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...
 

Enumeration Type Documentation

enum FSEntity
Enumerator
FS_Dir 
FS_File 
FS_Name 

Definition at line 157 of file Path.cpp.

Function Documentation

static llvm::error_code createUniqueEntity ( const llvm::Twine Model,
int &  ResultFD,
llvm::SmallVectorImpl< char > &  ResultPath,
bool  MakeAbsolute,
unsigned  Mode,
FSEntity  Type 
)
static