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:
50 StringRef Path; ///< The entire path.
55 friend const_iterator begin(StringRef path);
56 friend const_iterator end(StringRef path);
80 /// @brief Get begin iterator over \a path.
81 /// @param path Input path.
82 /// @returns Iterator initialized with the first component of \a path.
83 const_iterator begin(StringRef path);
85 /// @brief Get end iterator over \a path.
86 /// @param path Input path.
87 /// @returns Iterator initialized to the end of \a path.
88 const_iterator end(StringRef path);
90 /// @brief Get reverse begin iterator over \a path.
91 /// @param path Input path.
92 /// @returns Iterator initialized with the first reverse component of \a path.
93 inline reverse_iterator rbegin(StringRef path) {
94 return reverse_iterator(end(path));
97 /// @brief Get reverse end iterator over \a path.
98 /// @param path Input path.
99 /// @returns Iterator initialized to the reverse end of \a path.
100 inline reverse_iterator rend(StringRef path) {
101 return reverse_iterator(begin(path));
108 /// @brief Remove the last component from \a path unless it is the root dir.
114 /// @param path A path that is modified to not have a file component.
115 void remove_filename(SmallVectorImpl<char> &path);
117 /// @brief Replace the file extension of \a path with \a extension.
123 /// @param path A path that has its extension replaced with \a extension.
127 void replace_extension(SmallVectorImpl<char> &path, const Twine &extension);
129 /// @brief Append to path.
135 /// @param path Set to \a path + \a component.
136 /// @param a The component to be appended to \a path.
137 void append(SmallVectorImpl<char> &path, const Twine &a,
142 /// @brief Append to path.
148 /// @param path Set to \a path + [\a begin, \a end).
151 void append(SmallVectorImpl<char> &path,
158 /// Convert path to the native form. This is used to give paths to users and
162 /// @param path A path that is transformed to native format.
164 void native(const Twine &path, SmallVectorImpl<char> &result);
176 /// @param path Input path.
177 /// @result The root name of \a path if it has one, otherwise "".
178 const StringRef root_name(StringRef path);
186 /// @param path Input path.
187 /// @result The root directory of \a path if it has one, otherwise
189 const StringRef root_directory(StringRef path);
191 /// @brief Get root path.
195 /// @param path Input path.
196 /// @result The root path of \a path if it has one, otherwise "".
197 const StringRef root_path(StringRef path);
199 /// @brief Get relative path.
205 /// @param path Input path.
206 /// @result The path starting after root_path if one exists, otherwise "".
207 const StringRef relative_path(StringRef path);
209 /// @brief Get parent path.
215 /// @param path Input path.
216 /// @result The parent path of \a path if one exists, otherwise "".
217 const StringRef parent_path(StringRef path);
226 /// @param path Input path.
227 /// @result The filename part of \a path. This is defined as the last component
228 /// of \a path.
229 const StringRef filename(StringRef path);
243 /// @param path Input path.
244 /// @result The stem of \a path.
245 const StringRef stem(StringRef path);
251 /// at the end of \a path. Otherwise "".
257 /// @param path Input path.
258 /// @result The extension of \a path.
259 const StringRef extension(StringRef path);
261 /// @brief Check whether the given char is a path separator on the host OS.
264 /// @result true if \a value is a path separator character on the host OS
270 /// @param erasedOnReboot Whether to favor a path that is erased on reboot
275 /// @param result Holds the resulting path name.
282 /// @param path Input path.
283 /// @result True if the path has a root name, false otherwise.
284 bool has_root_name(const Twine &path);
290 /// @param path Input path.
291 /// @result True if the path has a root directory, false otherwise.
292 bool has_root_directory(const Twine &path);
294 /// @brief Has root path?
298 /// @param path Input path.
299 /// @result True if the path has a root path, false otherwise.
300 bool has_root_path(const Twine &path);
302 /// @brief Has relative path?
306 /// @param path Input path.
307 /// @result True if the path has a relative path, false otherwise.
308 bool has_relative_path(const Twine &path);
310 /// @brief Has parent path?
314 /// @param path Input path.
315 /// @result True if the path has a parent path, false otherwise.
316 bool has_parent_path(const Twine &path);
322 /// @param path Input path.
323 /// @result True if the path has a filename, false otherwise.
324 bool has_filename(const Twine &path);
330 /// @param path Input path.
331 /// @result True if the path has a stem, false otherwise.
332 bool has_stem(const Twine &path);
338 /// @param path Input path.
339 /// @result True if the path has a extension, false otherwise.
340 bool has_extension(const Twine &path);
342 /// @brief Is path absolute?
344 /// @param path Input path.
345 /// @result True if the path is absolute, false if it is not.
346 bool is_absolute(const Twine &path);
348 /// @brief Is path relative?
350 /// @param path Input path.
351 /// @result True if the path is relative, false if it is not.
352 bool is_relative(const Twine &path);
354 } // end namespace path