Add evaluation of checksum() conditions

This commit is contained in:
Oliver Hamlet
2018-10-03 19:21:45 +01:00
parent 2e57585787
commit 3e1c2084e5
3 changed files with 196 additions and 16 deletions
+7 -1
View File
@@ -1,3 +1,4 @@
extern crate crc;
#[macro_use]
extern crate nom;
extern crate regex;
@@ -5,10 +6,11 @@ extern crate regex;
#[cfg(test)]
extern crate tempfile;
use std::collections::HashSet;
use std::collections::{HashMap, HashSet};
use std::io;
use std::path::PathBuf;
use std::str;
use std::sync::RwLock;
use nom::{Err, IResult};
@@ -62,7 +64,9 @@ impl GameType {
pub struct State {
game_type: GameType,
data_path: PathBuf,
loot_path: PathBuf,
active_plugins: HashSet<String>, // Lowercased plugin filenames.
crc_cache: RwLock<HashMap<String, u32>>, // Lowercased paths.
}
// Compound conditions joined by 'or'
@@ -162,7 +166,9 @@ mod tests {
State {
game_type: GameType::tes4,
data_path: data_path,
loot_path: PathBuf::new(),
active_plugins: HashSet::new(),
crc_cache: RwLock::default(),
}
}