Support/PathV2: Add identify_magic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123548 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer
2011-01-15 20:39:36 +00:00
parent b6516aeef1
commit 28f0ed5c9d
5 changed files with 49 additions and 40 deletions

View File

@@ -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.