16 #ifndef LLVM_SUPPORT_PATH_H
17 #define LLVM_SUPPORT_PATH_H
21 #include "llvm/Support/DataTypes.h"
51 :
public std::iterator<std::input_iterator_tag, const StringRef> {
78 :
public std::iterator<std::input_iterator_tag, const StringRef> {
158 const Twine &d =
"");
172 const_iterator
begin, const_iterator
end);
const_iterator end(StringRef path)
Get end iterator over path.
friend reverse_iterator rbegin(StringRef path)
Get reverse begin iterator over path.
StringRef root_name(StringRef path)
Get root name.
StringRef stem(StringRef path)
Get stem.
friend reverse_iterator rend(StringRef path)
Get reverse end iterator over path.
bool is_relative(const Twine &path)
Is path relative?
void replace_extension(SmallVectorImpl< char > &path, const Twine &extension)
Replace the file extension of path with extension.
bool has_stem(const Twine &path)
Has stem?
StringRef root_directory(StringRef path)
Get root directory.
bool operator==(const reverse_iterator &RHS) const
const_iterator begin(StringRef path)
Get begin iterator over path.
bool operator!=(const reverse_iterator &RHS) const
bool has_root_directory(const Twine &path)
Has root directory?
bool operator==(const const_iterator &RHS) const
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
void native(const Twine &path, SmallVectorImpl< char > &result)
Convert path to the native form.
void remove_filename(SmallVectorImpl< char > &path)
Remove the last component from path unless it is the root dir.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
pointer operator->() const
bool is_absolute(const Twine &path)
Is path absolute?
StringRef extension(StringRef path)
Get extension.
bool operator!=(const const_iterator &RHS) const
bool is_separator(char value)
Check whether the given char is a path separator on the host OS.
StringRef root_path(StringRef path)
Get root path.
bool has_relative_path(const Twine &path)
Has relative path?
StringRef filename(StringRef path)
Get filename.
friend const_iterator end(StringRef path)
Get end iterator over path.
bool has_filename(const Twine &path)
Has filename?
pointer operator->() const
reference operator*() const
reverse_iterator & operator++()
const_iterator & operator++()
ptrdiff_t operator-(const const_iterator &RHS) const
Difference in bytes between this and RHS.
StringRef relative_path(StringRef path)
Get relative path.
friend const_iterator begin(StringRef path)
Get begin iterator over path.
StringRef parent_path(StringRef path)
Get parent path.
StringRef get_separator()
Return the preferred separator for this platform.
reverse_iterator rbegin(StringRef path)
Get reverse begin iterator over path.
bool has_root_path(const Twine &path)
Has root path?
bool has_root_name(const Twine &path)
Has root name?
reverse_iterator rend(StringRef path)
Get reverse end iterator over path.
void system_temp_directory(bool erasedOnReboot, SmallVectorImpl< char > &result)
Get the typical temporary directory for the system, e.g., "/var/tmp" or "C:/TEMP".
bool home_directory(SmallVectorImpl< char > &result)
Get the user's home directory.
bool has_extension(const Twine &path)
Has extension?
reference operator*() const
StringRef - Represent a constant reference to a string, i.e.
bool has_parent_path(const Twine &path)
Has parent path?