Function libxivdat::dat_file::check_type[][src]

pub fn check_type<P: AsRef<Path>>(path: P) -> Result<DATType, DATError>
Expand description

Checks the DATType of a DAT file based on the header contents. This should be treated as a best guess, since the header is not fully understood.

Errors

If an I/O error occurs while reading the file, a DATError::FileIO error will be returned wrapping the underlying FS error.

A DATError::BadHeader will be returned if the file header cannot be validated, indicating a non-DAT or corrupt file.

Examples

use libxivdat::dat_file::check_type;
use libxivdat::dat_type::DATType;

let dat_type = check_type("./resources/TEST_XOR.DAT").unwrap();
assert_eq!(dat_type, DATType::Macro);