/* * Created on Wed Dec 16 2020 * * Copyright (c) storycraft. Licensed under the Apache Licence 2.0. */ use std::io::Cursor; use xp3::reader::XP3Reader; const TEST_FILE: [u8; 159] = [ 0x58, 0x50, 0x33, 0x0D, 0x0A, 0x20, 0x0A, 0x1A, 0x8B, 0x67, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x20, 0x77, 0x6F, 0x72, 0x6C, 0x64, 0x21, 0x01, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x01, 0x45, 0x8B, 0x31, 0x0A, 0x80, 0x30, 0x10, 0x04, 0xA7, 0x48, 0xA1, 0x60, 0x69, 0xA9, 0xBD, 0x58, 0xF8, 0x0C, 0x9F, 0x21, 0x04, 0x8C, 0x12, 0x48, 0x54, 0x4C, 0x0A, 0x4B, 0xF1, 0xE5, 0x0A, 0xC9, 0xE1, 0xC2, 0x32, 0xB3, 0xC5, 0x8E, 0xD6, 0x99, 0x87, 0x14, 0x3D, 0xBB, 0x53, 0x25, 0x65, 0x52, 0x65, 0x1B, 0xAD, 0x37, 0x45, 0xDE, 0x02, 0xBB, 0x2D, 0x7B, 0x2F, 0x03, 0xEE, 0x2A, 0xBB, 0xB0, 0x26, 0xA0, 0xF1, 0x1C, 0x38, 0x0C, 0x03, 0x91, 0xEB, 0x6B, 0x30, 0xAB, 0x6F, 0xF8, 0xD3, 0x65, 0x95, 0x97, 0xF0, 0x05, 0xE1, 0xDC, 0x0E, 0x83 ]; pub fn main() { let stream = Cursor::new(&TEST_FILE[..]); let xp3 = XP3Reader::open_archive(stream).unwrap(); for (name, _) in xp3.entries() { println!("file: {}", name); } }