mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user