summaryrefslogtreecommitdiff
path: root/include/llvm/Support/FileSystem.h
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-01-15 20:39:36 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-01-15 20:39:36 +0000
commit28f0ed5c9de4a68f34c0219d4ab83652c4647150 (patch)
tree999622dc7275347a61e4a674455c7beaf7ded075 /include/llvm/Support/FileSystem.h
parentb6516aeef12a05aa47515f76e18fc426d85babbd (diff)
downloadllvm-28f0ed5c9de4a68f34c0219d4ab83652c4647150.tar.gz
llvm-28f0ed5c9de4a68f34c0219d4ab83652c4647150.tar.bz2
llvm-28f0ed5c9de4a68f34c0219d4ab83652c4647150.tar.xz
Support/PathV2: Add identify_magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123548 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/FileSystem.h')
-rw-r--r--include/llvm/Support/FileSystem.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h
index 12f6d9b1d7..4001bf0b84 100644
--- a/include/llvm/Support/FileSystem.h
+++ b/include/llvm/Support/FileSystem.h
@@ -30,6 +30,7 @@
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/DataTypes.h"
+#include "llvm/Support/PathV1.h"
#include "llvm/Support/system_error.h"
#include <ctime>
#include <iterator>
@@ -463,6 +464,14 @@ error_code has_magic(const Twine &path, const Twine &magic, bool &result);
error_code get_magic(const Twine &path, uint32_t len,
SmallVectorImpl<char> &result);
+/// @brief Get and identify \a path's type based on its content.
+///
+/// @param path Input path.
+/// @param result Set to the type of file, or LLVMFileType::Unknown_FileType.
+/// @results errc::success if result has been successfully set, otherwise a
+/// platform specific error_code.
+error_code identify_magic(const Twine &path, LLVMFileType &result);
+
/// @brief Is file bitcode?
///
/// @param path Input path.