another typo
[oota-llvm.git] / include / llvm / Support / PathV2.h
index 82d31132bf061ef2406c602625f4155728c3bd0f..251563398fb4f58988b52dc00bb2fce8cdc98a14 100644 (file)
@@ -52,8 +52,8 @@ class const_iterator {
   size_t    Position;  //< The iterators current position within Path.
 
   // An end iterator has Position = Path.size() + 1.
-  friend const_iterator begin(const StringRef &path);
-  friend const_iterator end(const StringRef &path);
+  friend const_iterator begin(StringRef path);
+  friend const_iterator end(StringRef path);
 
 public:
   typedef const StringRef value_type;
@@ -80,24 +80,24 @@ typedef std::reverse_iterator<const_iterator> reverse_iterator;
 /// @brief Get begin iterator over \a path.
 /// @param path Input path.
 /// @returns Iterator initialized with the first component of \a path.
-const_iterator begin(const StringRef &path);
+const_iterator begin(StringRef path);
 
 /// @brief Get end iterator over \a path.
 /// @param path Input path.
 /// @returns Iterator initialized to the end of \a path.
-const_iterator end(const StringRef &path);
+const_iterator end(StringRef path);
 
 /// @brief Get reverse begin iterator over \a path.
 /// @param path Input path.
 /// @returns Iterator initialized with the first reverse component of \a path.
-inline reverse_iterator rbegin(const StringRef &path) {
+inline reverse_iterator rbegin(StringRef path) {
   return reverse_iterator(end(path));
 }
 
 /// @brief Get reverse end iterator over \a path.
 /// @param path Input path.
 /// @returns Iterator initialized to the reverse end of \a path.
-inline reverse_iterator rend(const StringRef &path) {
+inline reverse_iterator rend(StringRef path) {
   return reverse_iterator(begin(path));
 }
 
@@ -175,7 +175,7 @@ void native(const Twine &path, SmallVectorImpl<char> &result);
 ///
 /// @param path Input path.
 /// @result The root name of \a path if it has one, otherwise "".
-const StringRef root_name(const StringRef &path);
+const StringRef root_name(StringRef path);
 
 /// @brief Get root directory.
 ///
@@ -186,7 +186,7 @@ const StringRef root_name(const StringRef &path);
 /// @param path Input path.
 /// @result The root directory of \a path if it has one, otherwise
 ///               "".
-const StringRef root_directory(const StringRef &path);
+const StringRef root_directory(StringRef path);
 
 /// @brief Get root path.
 ///
@@ -194,7 +194,7 @@ const StringRef root_directory(const StringRef &path);
 ///
 /// @param path Input path.
 /// @result The root path of \a path if it has one, otherwise "".
-const StringRef root_path(const StringRef &path);
+const StringRef root_path(StringRef path);
 
 /// @brief Get relative path.
 ///
@@ -204,7 +204,7 @@ const StringRef root_path(const StringRef &path);
 ///
 /// @param path Input path.
 /// @result The path starting after root_path if one exists, otherwise "".
-const StringRef relative_path(const StringRef &path);
+const StringRef relative_path(StringRef path);
 
 /// @brief Get parent path.
 ///
@@ -214,7 +214,7 @@ const StringRef relative_path(const StringRef &path);
 ///
 /// @param path Input path.
 /// @result The parent path of \a path if one exists, otherwise "".
-const StringRef parent_path(const StringRef &path);
+const StringRef parent_path(StringRef path);
 
 /// @brief Get filename.
 ///
@@ -226,7 +226,7 @@ const StringRef parent_path(const StringRef &path);
 /// @param path Input path.
 /// @result The filename part of \a path. This is defined as the last component
 ///         of \a path.
-const StringRef filename(const StringRef &path);
+const StringRef filename(StringRef path);
 
 /// @brief Get stem.
 ///
@@ -242,7 +242,7 @@ const StringRef filename(const StringRef &path);
 ///
 /// @param path Input path.
 /// @result The stem of \a path.
-const StringRef stem(const StringRef &path);
+const StringRef stem(StringRef path);
 
 /// @brief Get extension.
 ///
@@ -256,7 +256,13 @@ const StringRef stem(const StringRef &path);
 ///
 /// @param path Input path.
 /// @result The extension of \a path.
-const StringRef extension(const StringRef &path);
+const StringRef extension(StringRef path);
+
+/// @brief Check whether the given char is a path separator on the host OS.
+///
+/// @param value a character
+/// @result true if \a value is a path separator character on the host OS
+bool is_separator(char value);
 
 /// @brief Has root name?
 ///
@@ -264,7 +270,7 @@ const StringRef extension(const StringRef &path);
 ///
 /// @param path Input path.
 /// @result True if the path has a root name, false otherwise.
-const bool has_root_name(const Twine &path);
+bool has_root_name(const Twine &path);
 
 /// @brief Has root directory?
 ///
@@ -272,7 +278,7 @@ const bool has_root_name(const Twine &path);
 ///
 /// @param path Input path.
 /// @result True if the path has a root directory, false otherwise.
-const bool has_root_directory(const Twine &path);
+bool has_root_directory(const Twine &path);
 
 /// @brief Has root path?
 ///
@@ -280,7 +286,7 @@ const bool has_root_directory(const Twine &path);
 ///
 /// @param path Input path.
 /// @result True if the path has a root path, false otherwise.
-const bool has_root_path(const Twine &path);
+bool has_root_path(const Twine &path);
 
 /// @brief Has relative path?
 ///
@@ -288,7 +294,7 @@ const bool has_root_path(const Twine &path);
 ///
 /// @param path Input path.
 /// @result True if the path has a relative path, false otherwise.
-const bool has_relative_path(const Twine &path);
+bool has_relative_path(const Twine &path);
 
 /// @brief Has parent path?
 ///
@@ -296,7 +302,7 @@ const bool has_relative_path(const Twine &path);
 ///
 /// @param path Input path.
 /// @result True if the path has a parent path, false otherwise.
-const bool has_parent_path(const Twine &path);
+bool has_parent_path(const Twine &path);
 
 /// @brief Has filename?
 ///
@@ -304,7 +310,7 @@ const bool has_parent_path(const Twine &path);
 ///
 /// @param path Input path.
 /// @result True if the path has a filename, false otherwise.
-const bool has_filename(const Twine &path);
+bool has_filename(const Twine &path);
 
 /// @brief Has stem?
 ///
@@ -312,7 +318,7 @@ const bool has_filename(const Twine &path);
 ///
 /// @param path Input path.
 /// @result True if the path has a stem, false otherwise.
-const bool has_stem(const Twine &path);
+bool has_stem(const Twine &path);
 
 /// @brief Has extension?
 ///
@@ -320,19 +326,19 @@ const bool has_stem(const Twine &path);
 ///
 /// @param path Input path.
 /// @result True if the path has a extension, false otherwise.
-const bool has_extension(const Twine &path);
+bool has_extension(const Twine &path);
 
 /// @brief Is path absolute?
 ///
 /// @param path Input path.
 /// @result True if the path is absolute, false if it is not.
-const bool is_absolute(const Twine &path);
+bool is_absolute(const Twine &path);
 
 /// @brief Is path relative?
 ///
 /// @param path Input path.
 /// @result True if the path is relative, false if it is not.
-const bool is_relative(const Twine &path);
+bool is_relative(const Twine &path);
 
 } // end namespace path
 } // end namespace sys