Add a simple routine to determine the typical system directory for
[oota-llvm.git] / include / llvm / Support / PathV2.h
index 3866e410e62413c79c67b1733aaeefecd23ba85a..8dfbd77840596da6a7d9fed7c1a83ad2968307f7 100644 (file)
@@ -187,7 +187,7 @@ const StringRef root_name(StringRef path);
 /// @result The root directory of \a path if it has one, otherwise
 ///               "".
 const StringRef root_directory(StringRef path);
-
+  
 /// @brief Get root path.
 ///
 /// Equivalent to root_name + root_directory.
@@ -258,6 +258,20 @@ const StringRef stem(StringRef path);
 /// @result The extension of \a 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 Get the typical temporary directory for the system, e.g., 
+/// "/var/tmp" or "C:/TEMP"
+///
+/// @param erasedOnReboot Whether to favor a path that is erased on reboot
+/// rather than one that potentially persists longer.
+/// @param Result Holds the resulting path name.
+void system_temp_directory(bool erasedOnReboot, SmallVectorImpl<char> &result);
+
 /// @brief Has root name?
 ///
 /// root_name != ""