identify_magic overloads

Synopses

Declared in <llvm/BinaryFormat/Magic.h>

Identify the type of a binary file based on how magical it is.

Get and identify path's type based on its content.

std::error_code
identify_magic(
    Twine const& path,
    file_magic& result);

Return Value

  • The identified file_magic kind for the given bytes.

  • errc::success if result has been successfully set, otherwise a platform‐specific error_code.

Parameters

Name

Description

magic

Leading bytes of the file used for magic identification.

path

Input path.

result

Set to the type of file, or file_magic::unknown.

Created with MrDocs