From 28f0ed5c9de4a68f34c0219d4ab83652c4647150 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Sat, 15 Jan 2011 20:39:36 +0000 Subject: Support/PathV2: Add identify_magic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123548 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/FileSystem.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/llvm/Support/FileSystem.h') 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 #include @@ -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 &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. -- cgit v1.2.3