LLVM API Documentation
#include "llvm/Support/COFF.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Process.h"
#include <cctype>
#include <cstdio>
#include <cstring>
#include <fcntl.h>
#include <unistd.h>
#include "Unix/Path.inc"
Go to the source code of this file.
Namespaces | |
namespace | llvm |
List of target independent CodeGen pass IDs. | |
namespace | llvm::sys |
namespace | llvm::sys::path |
namespace | llvm::sys::fs |
Enumerations | |
enum | FSEntity { FS_Dir, FS_File, FS_Name } |
Functions | |
static std::error_code | createUniqueEntity (const Twine &Model, int &ResultFD, SmallVectorImpl< char > &ResultPath, bool MakeAbsolute, unsigned Mode, FSEntity Type) |
StringRef | llvm::sys::path::root_path (StringRef path) |
Get root path. | |
StringRef | llvm::sys::path::root_name (StringRef path) |
Get root name. | |
StringRef | llvm::sys::path::root_directory (StringRef path) |
Get root directory. | |
StringRef | llvm::sys::path::relative_path (StringRef path) |
Get relative path. | |
void | llvm::sys::path::append (SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="") |
Append to path. | |
void | llvm::sys::path::append (SmallVectorImpl< char > &path, const_iterator begin, const_iterator end) |
Append to path. | |
StringRef | llvm::sys::path::parent_path (StringRef path) |
Get parent path. | |
void | llvm::sys::path::remove_filename (SmallVectorImpl< char > &path) |
Remove the last component from path unless it is the root dir. | |
void | llvm::sys::path::replace_extension (SmallVectorImpl< char > &path, const Twine &extension) |
Replace the file extension of path with extension. | |
void | llvm::sys::path::native (const Twine &path, SmallVectorImpl< char > &result) |
void | llvm::sys::path::native (SmallVectorImpl< char > &path) |
StringRef | llvm::sys::path::filename (StringRef path) |
Get filename. | |
StringRef | llvm::sys::path::stem (StringRef path) |
Get stem. | |
StringRef | llvm::sys::path::extension (StringRef path) |
Get extension. | |
bool | llvm::sys::path::is_separator (char value) |
Check whether the given char is a path separator on the host OS. | |
StringRef | llvm::sys::path::get_separator () |
Return the preferred separator for this platform. | |
bool | llvm::sys::path::has_root_name (const Twine &path) |
Has root name? | |
bool | llvm::sys::path::has_root_directory (const Twine &path) |
Has root directory? | |
bool | llvm::sys::path::has_root_path (const Twine &path) |
Has root path? | |
bool | llvm::sys::path::has_relative_path (const Twine &path) |
Has relative path? | |
bool | llvm::sys::path::has_filename (const Twine &path) |
Has filename? | |
bool | llvm::sys::path::has_parent_path (const Twine &path) |
Has parent path? | |
bool | llvm::sys::path::has_stem (const Twine &path) |
Has stem? | |
bool | llvm::sys::path::has_extension (const Twine &path) |
Has extension? | |
bool | llvm::sys::path::is_absolute (const Twine &path) |
Is path absolute? | |
bool | llvm::sys::path::is_relative (const Twine &path) |
Is path relative? | |
std::error_code | llvm::sys::fs::getUniqueID (const Twine Path, UniqueID &Result) |
std::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. | |
std::error_code | llvm::sys::fs::createUniqueFile (const Twine &Model, SmallVectorImpl< char > &ResultPath) |
Simpler version for clients that don't want an open file. | |
static std::error_code | llvm::sys::fs::createTemporaryFile (const Twine &Model, int &ResultFD, llvm::SmallVectorImpl< char > &ResultPath, FSEntity Type) |
static std::error_code | llvm::sys::fs::createTemporaryFile (const Twine &Prefix, StringRef Suffix, int &ResultFD, llvm::SmallVectorImpl< char > &ResultPath, FSEntity Type) |
std::error_code | llvm::sys::fs::createTemporaryFile (const Twine &Prefix, StringRef Suffix, int &ResultFD, SmallVectorImpl< char > &ResultPath) |
Create a file in the system temporary directory. | |
std::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. | |
std::error_code | llvm::sys::fs::createUniqueDirectory (const Twine &Prefix, SmallVectorImpl< char > &ResultPath) |
std::error_code | llvm::sys::fs::make_absolute (SmallVectorImpl< char > &path) |
Make path an absolute path. | |
std::error_code | llvm::sys::fs::create_directories (const Twine &path, bool IgnoreExisting=true) |
Create all the non-existent directories in path. | |
std::error_code | llvm::sys::fs::copy_file (const Twine &From, const Twine &To) |
Copy the contents of From to To. | |
bool | llvm::sys::fs::exists (file_status status) |
Does file exist? | |
bool | llvm::sys::fs::status_known (file_status s) |
Is status available? | |
bool | llvm::sys::fs::is_directory (file_status status) |
Does status represent a directory? | |
std::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? | |
std::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? | |
file_magic | llvm::sys::fs::identify_magic (StringRef magic) |
Identify the type of a binary file based on how magical it is. | |
std::error_code | llvm::sys::fs::identify_magic (const Twine &path, file_magic &result) |
Get and identify path's type based on its content. | |
Lexical Component Iterator | |
const_iterator | llvm::sys::path::begin (StringRef path) |
Get begin iterator over path. | |
const_iterator | llvm::sys::path::end (StringRef path) |
Get end iterator over path. | |
reverse_iterator | llvm::sys::path::rbegin (StringRef path) |
Get reverse begin iterator over path. | |
reverse_iterator | llvm::sys::path::rend (StringRef path) |
Get reverse end iterator over path. | |
Variables | |
static const char | llvm::sys::path::preferred_separator_string [] = { preferred_separator, '\0' } |
static std::error_code createUniqueEntity | ( | const Twine & | Model, |
int & | ResultFD, | ||
SmallVectorImpl< char > & | ResultPath, | ||
bool | MakeAbsolute, | ||
unsigned | Mode, | ||
FSEntity | Type | ||
) | [static] |
Definition at line 168 of file Path.cpp.
References llvm::sys::fs::access(), llvm::sys::path::append(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::sys::fs::create_directory(), llvm::sys::fs::Exist, llvm::sys::fs::F_Excl, llvm::sys::fs::F_RW, llvm::file_exists, FS_Dir, FS_File, FS_Name, llvm::sys::Process::GetRandomNumber(), llvm::sys::path::is_absolute(), llvm_unreachable, llvm::no_such_file_or_directory, llvm::sys::fs::openFileForWrite(), llvm::SmallVectorTemplateBase< T, isPodLike >::pop_back(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::SmallVectorImpl< T >::swap(), llvm::sys::path::system_temp_directory(), and llvm::Twine::toVector().
Referenced by llvm::sys::fs::createTemporaryFile(), llvm::sys::fs::createUniqueDirectory(), and llvm::sys::fs::createUniqueFile().