16 #ifndef LLVM_SUPPORT_PATH_H
17 #define LLVM_SUPPORT_PATH_H
20 #include "llvm/Support/DataTypes.h"
50 :
public std::iterator<std::input_iterator_tag, const StringRef> {
76 :
public std::iterator<std::input_iterator_tag, const StringRef> {
175 const Twine &d =
"");
189 const_iterator
begin, const_iterator
end);
369 const Twine &Path2 =
"",
const Twine &Path3 =
"");
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?
bool remove_dots(SmallVectorImpl< char > &path, bool remove_dot_dot=false)
In-place remove any '.
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++()
bool user_cache_directory(SmallVectorImpl< char > &Result, const Twine &Path1, const Twine &Path2="", const Twine &Path3="")
Get the user's cache directory.
const_iterator & operator++()
void replace_path_prefix(SmallVectorImpl< char > &Path, const StringRef &OldPrefix, const StringRef &NewPrefix)
Replace matching path prefix with another path.
ptrdiff_t operator-(const const_iterator &RHS) const
Difference in bytes between this and RHS.
StringRef remove_leading_dotslash(StringRef path)
Remove redundant leading "./" pieces and consecutive separators.
StringRef relative_path(StringRef path)
Get relative path.
friend const_iterator begin(StringRef path)
Get begin iterator over path.
ptrdiff_t operator-(const reverse_iterator &RHS) const
Difference in bytes between this and RHS.
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.
std::string convert_to_slash(StringRef path)
Replaces backslashes with slashes if Windows.
bool has_parent_path(const Twine &path)
Has parent path?