LLVM 20.0.0git
Classes | Namespaces | Enumerations | Functions
Path.h File Reference
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/iterator.h"
#include "llvm/Support/DataTypes.h"
#include <iterator>

Go to the source code of this file.

Classes

class  llvm::sys::path::const_iterator
 Path iterator. More...
 
class  llvm::sys::path::reverse_iterator
 Reverse path iterator. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::sys
 
namespace  llvm::sys::path
 

Enumerations

enum class  llvm::sys::path::Style {
  llvm::sys::path::native , llvm::sys::path::posix , llvm::sys::path::windows_slash , llvm::sys::path::windows_backslash ,
  llvm::sys::path::windows = windows_backslash
}
 

Functions

constexpr bool llvm::sys::path::is_style_posix (Style S)
 Check if S uses POSIX path rules.
 
constexpr bool llvm::sys::path::is_style_windows (Style S)
 Check if S uses Windows path rules.
 
Lexical Component Iterator
const_iterator llvm::sys::path::begin (StringRef path, Style style=Style::native)
 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, Style style=Style::native)
 Get reverse begin iterator over path.
 
reverse_iterator llvm::sys::path::rend (StringRef path)
 Get reverse end iterator over path.
 
Lexical Modifiers
void llvm::sys::path::remove_filename (SmallVectorImpl< char > &path, Style style=Style::native)
 Remove the last component from path unless it is the root dir.
 
void llvm::sys::path::replace_extension (SmallVectorImpl< char > &path, const Twine &extension, Style style=Style::native)
 Replace the file extension of path with extension.
 
bool llvm::sys::path::replace_path_prefix (SmallVectorImpl< char > &Path, StringRef OldPrefix, StringRef NewPrefix, Style style=Style::native)
 Replace matching path prefix with another path.
 
StringRef llvm::sys::path::remove_leading_dotslash (StringRef path, Style style=Style::native)
 Remove redundant leading "./" pieces and consecutive separators.
 
bool llvm::sys::path::remove_dots (SmallVectorImpl< char > &path, bool remove_dot_dot=false, Style style=Style::native)
 In-place remove any '.
 
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, Style style, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
 
void llvm::sys::path::append (SmallVectorImpl< char > &path, const_iterator begin, const_iterator end, Style style=Style::native)
 Append to path.
 
Transforms (or some other better name)
void llvm::sys::path::native (const Twine &path, SmallVectorImpl< char > &result, Style style=Style::native)
 Convert path to the native form.
 
void llvm::sys::path::native (SmallVectorImpl< char > &path, Style style=Style::native)
 Convert path to the native form in place.
 
void llvm::sys::path::make_preferred (SmallVectorImpl< char > &path, Style style=Style::native)
 For Windows path styles, convert path to use the preferred path separators.
 
std::string llvm::sys::path::convert_to_slash (StringRef path, Style style=Style::native)
 Replaces backslashes with slashes if Windows.
 
Lexical Observers
StringRef llvm::sys::path::root_name (StringRef path, Style style=Style::native)
 Get root name.
 
StringRef llvm::sys::path::root_directory (StringRef path, Style style=Style::native)
 Get root directory.
 
StringRef llvm::sys::path::root_path (StringRef path, Style style=Style::native)
 Get root path.
 
StringRef llvm::sys::path::relative_path (StringRef path, Style style=Style::native)
 Get relative path.
 
StringRef llvm::sys::path::parent_path (StringRef path, Style style=Style::native)
 Get parent path.
 
StringRef llvm::sys::path::filename (StringRef path, Style style=Style::native)
 Get filename.
 
StringRef llvm::sys::path::stem (StringRef path, Style style=Style::native)
 Get stem.
 
StringRef llvm::sys::path::extension (StringRef path, Style style=Style::native)
 Get extension.
 
bool llvm::sys::path::is_separator (char value, Style style=Style::native)
 Check whether the given char is a path separator on the host OS.
 
StringRef llvm::sys::path::get_separator (Style style=Style::native)
 Return the preferred separator for this platform.
 
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".
 
bool llvm::sys::path::home_directory (SmallVectorImpl< char > &result)
 Get the user's home directory.
 
bool llvm::sys::path::user_config_directory (SmallVectorImpl< char > &result)
 Get the directory where packages should read user-specific configurations.
 
bool llvm::sys::path::cache_directory (SmallVectorImpl< char > &result)
 Get the directory where installed packages should put their machine-local cache, e.g.
 
bool llvm::sys::path::has_root_name (const Twine &path, Style style=Style::native)
 Has root name?
 
bool llvm::sys::path::has_root_directory (const Twine &path, Style style=Style::native)
 Has root directory?
 
bool llvm::sys::path::has_root_path (const Twine &path, Style style=Style::native)
 Has root path?
 
bool llvm::sys::path::has_relative_path (const Twine &path, Style style=Style::native)
 Has relative path?
 
bool llvm::sys::path::has_parent_path (const Twine &path, Style style=Style::native)
 Has parent path?
 
bool llvm::sys::path::has_filename (const Twine &path, Style style=Style::native)
 Has filename?
 
bool llvm::sys::path::has_stem (const Twine &path, Style style=Style::native)
 Has stem?
 
bool llvm::sys::path::has_extension (const Twine &path, Style style=Style::native)
 Has extension?
 
bool llvm::sys::path::is_absolute (const Twine &path, Style style=Style::native)
 Is path absolute?
 
bool llvm::sys::path::is_absolute_gnu (const Twine &path, Style style=Style::native)
 Is path absolute using GNU rules?
 
bool llvm::sys::path::is_relative (const Twine &path, Style style=Style::native)
 Is path relative?