Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ byteorder = "1.5.0"
rayon = { version = "1.10.0", optional = true}
serde = { version = "1.0.217", optional = true, features = ["derive"] }
serde-hex = { version = "0.1.0", optional = true }
indexmap = "2.7.1"
indexmap = "2.10.0"
crc32fast = "1.4.2"
async-trait = { version = "0.1.88", optional = true}
glacier-ini = {git="https://github.com/dafitius/GlacierFormats-rs"}


[features]
default = ["rayon", "path-list", "serde"]
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize};
pub mod encryption;
pub mod misc;
pub mod resource;
pub mod utils;
pub(crate) mod utils;

#[derive(Debug, PartialEq, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
Expand Down
3 changes: 3 additions & 0 deletions src/misc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#[deprecated(
since = "1.2.0",
note = "Replaced by dedicated glacier-ini crate")]
pub mod ini_file_system;
pub mod resource_id;

Expand Down
2 changes: 1 addition & 1 deletion src/resource/pdefs/h2016_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl PackageDefinitionParser for H2016Parser {
}

fn try_read_partition_name(lines: Vec<&str>) -> Option<String> {
let reg = regex!(r"## --- (?:DLC|Chunk )\d{2} (.*)");
let reg = regex!(r"## --- +(?:DLC|Chunk )\d{2} (.*)");
for line in lines {
if reg.is_match(line) {
if let Some(m) = reg.captures_iter(line).next() {
Expand Down
2 changes: 1 addition & 1 deletion src/resource/pdefs/hm2_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl PackageDefinitionParser for HM2Parser {
}

fn try_read_partition_name(lines: Vec<&str>) -> Option<String> {
let reg = regex!(r"// --- (?:DLC|Chunk) \d{2} (.*)");
let reg = regex!(r"// --- +(?:DLC|Chunk) \d{2} (.*)");
for line in lines {
if reg.is_match(line) {
if let Some(m) = reg.captures_iter(line).next() {
Expand Down
6 changes: 3 additions & 3 deletions src/resource/pdefs/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use std::fmt::Display;
use std::path::PathBuf;
use std::str::FromStr;

use glacier_ini::ini_file::IniFileError;
use glacier_ini::IniFileSystem;
use lazy_regex::regex;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use thiserror::Error;

use crate::encryption::xtea::XteaError;
use crate::misc::ini_file_system::{IniFileError, IniFileSystem};
use crate::misc::resource_id::ResourceID;
use crate::resource::pdefs::GameDiscoveryError::InvalidRuntimePath;
use crate::resource::pdefs::PackageDefinitionSource::{HM2, HM2016, HM3};
Expand Down Expand Up @@ -315,7 +315,7 @@ impl GamePaths {
let thumbs_path = retail_directory.join("thumbs.dat");

// Parse the thumbs file, so we can find the runtime path.
let thumbs = IniFileSystem::from(thumbs_path.as_path())
let thumbs = IniFileSystem::from_path(thumbs_path.as_path())
.map_err(GameDiscoveryError::FailedToParseThumbsFile)?;

let app_options = &thumbs.root()["application"];
Expand Down
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::ffi::OsString;
use std::fs;
use std::path::{Component, Path, PathBuf};

pub fn read_file_names(path: &Path) -> Vec<OsString> {
pub(crate) fn read_file_names(path: &Path) -> Vec<OsString> {
match fs::read_dir(path) {
Ok(entries) => entries
.flatten()
Expand All @@ -15,7 +15,7 @@ pub fn read_file_names(path: &Path) -> Vec<OsString> {
}
}

pub fn normalize_path(path: &Path) -> PathBuf {
pub(crate) fn normalize_path(path: &Path) -> PathBuf {
let mut components = path.components().peekable();
let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() {
components.next();
Expand Down