Lines Matching refs:path

10 // This file declares the llvm::sys::path namespace. It is designed after
12 // path class.
26 namespace path {
34 /// components in \a path. The forward traversal order is as follows:
51 StringRef Path; ///< The entire path.
56 friend const_iterator begin(StringRef path);
57 friend const_iterator end(StringRef path);
81 /// @brief Get begin iterator over \a path.
82 /// @param path Input path.
83 /// @returns Iterator initialized with the first component of \a path.
84 const_iterator begin(StringRef path);
86 /// @brief Get end iterator over \a path.
87 /// @param path Input path.
88 /// @returns Iterator initialized to the end of \a path.
89 const_iterator end(StringRef path);
91 /// @brief Get reverse begin iterator over \a path.
92 /// @param path Input path.
93 /// @returns Iterator initialized with the first reverse component of \a path.
94 inline reverse_iterator rbegin(StringRef path) {
95 return reverse_iterator(end(path));
98 /// @brief Get reverse end iterator over \a path.
99 /// @param path Input path.
100 /// @returns Iterator initialized to the reverse end of \a path.
101 inline reverse_iterator rend(StringRef path) {
102 return reverse_iterator(begin(path));
109 /// @brief Remove the last component from \a path unless it is the root dir.
118 /// @param path A path that is modified to not have a file component.
119 void remove_filename(SmallVectorImpl<char> &path);
121 /// @brief Replace the file extension of \a path with \a extension.
129 /// @param path A path that has its extension replaced with \a extension.
133 void replace_extension(SmallVectorImpl<char> &path, const Twine &extension);
135 /// @brief Append to path.
143 /// @param path Set to \a path + \a component.
144 /// @param a The component to be appended to \a path.
145 void append(SmallVectorImpl<char> &path, const Twine &a,
150 /// @brief Append to path.
158 /// @param path Set to \a path + [\a begin, \a end).
161 void append(SmallVectorImpl<char> &path,
168 /// Convert path to the native form. This is used to give paths to users and
172 /// @param path A path that is transformed to native format.
174 void native(const Twine &path, SmallVectorImpl<char> &result);
176 /// Convert path to the native form in place. This is used to give paths to
180 /// @param path A path that is transformed to native format.
181 void native(SmallVectorImpl<char> &path);
195 /// @param path Input path.
196 /// @result The root name of \a path if it has one, otherwise "".
197 const StringRef root_name(StringRef path);
207 /// @param path Input path.
208 /// @result The root directory of \a path if it has one, otherwise
210 const StringRef root_directory(StringRef path);
212 /// @brief Get root path.
216 /// @param path Input path.
217 /// @result The root path of \a path if it has one, otherwise "".
218 const StringRef root_path(StringRef path);
220 /// @brief Get relative path.
228 /// @param path Input path.
229 /// @result The path starting after root_path if one exists, otherwise "".
230 const StringRef relative_path(StringRef path);
232 /// @brief Get parent path.
240 /// @param path Input path.
241 /// @result The parent path of \a path if one exists, otherwise "".
242 const StringRef parent_path(StringRef path);
253 /// @param path Input path.
254 /// @result The filename part of \a path. This is defined as the last component
255 /// of \a path.
256 const StringRef filename(StringRef path);
272 /// @param path Input path.
273 /// @result The stem of \a path.
274 const StringRef stem(StringRef path);
280 /// at the end of \a path. Otherwise "".
288 /// @param path Input path.
289 /// @result The extension of \a path.
290 const StringRef extension(StringRef path);
292 /// @brief Check whether the given char is a path separator on the host OS.
295 /// @result true if \a value is a path separator character on the host OS
301 /// @param erasedOnReboot Whether to favor a path that is erased on reboot
306 /// @param result Holds the resulting path name.
313 /// @param path Input path.
314 /// @result True if the path has a root name, false otherwise.
315 bool has_root_name(const Twine &path);
321 /// @param path Input path.
322 /// @result True if the path has a root directory, false otherwise.
323 bool has_root_directory(const Twine &path);
325 /// @brief Has root path?
329 /// @param path Input path.
330 /// @result True if the path has a root path, false otherwise.
331 bool has_root_path(const Twine &path);
333 /// @brief Has relative path?
337 /// @param path Input path.
338 /// @result True if the path has a relative path, false otherwise.
339 bool has_relative_path(const Twine &path);
341 /// @brief Has parent path?
345 /// @param path Input path.
346 /// @result True if the path has a parent path, false otherwise.
347 bool has_parent_path(const Twine &path);
353 /// @param path Input path.
354 /// @result True if the path has a filename, false otherwise.
355 bool has_filename(const Twine &path);
361 /// @param path Input path.
362 /// @result True if the path has a stem, false otherwise.
363 bool has_stem(const Twine &path);
369 /// @param path Input path.
370 /// @result True if the path has a extension, false otherwise.
371 bool has_extension(const Twine &path);
373 /// @brief Is path absolute?
375 /// @param path Input path.
376 /// @result True if the path is absolute, false if it is not.
377 bool is_absolute(const Twine &path);
379 /// @brief Is path relative?
381 /// @param path Input path.
382 /// @result True if the path is relative, false if it is not.
383 bool is_relative(const Twine &path);
385 } // end namespace path