diff --git a/src/Tools/Tests/ISO_Planschbecken.xml b/src/Tools/Tests/ISO_Planschbecken.xml
index c5bf55a0..35fc733c 100644
--- a/src/Tools/Tests/ISO_Planschbecken.xml
+++ b/src/Tools/Tests/ISO_Planschbecken.xml
@@ -13,8 +13,8 @@
../Tests/ISO_Planschbecken.xml
-
-
+
+
Miau.txt
Wuff/Miau.txt
diff --git a/src/Tools/psxcdgen_ex/src/config_reader/mod.rs b/src/Tools/psxcdgen_ex/src/config_reader/mod.rs
index 6f167dd5..30746eee 100644
--- a/src/Tools/psxcdgen_ex/src/config_reader/mod.rs
+++ b/src/Tools/psxcdgen_ex/src/config_reader/mod.rs
@@ -14,11 +14,21 @@ impl Configuration {
}
}
-pub struct File {
+pub struct CommonProperties {
pub name: String,
- pub path: PathBuf,
pub is_hidden: bool,
- pub padded_size: Option,
+ pub padded_size: Option,
+}
+
+pub struct File {
+ pub common: CommonProperties,
+ pub path: PathBuf,
+}
+
+pub struct LbaFile {
+ pub common: CommonProperties,
+ pub header: Option,
+ pub entries: Vec
}
pub struct Directory {
diff --git a/src/Tools/psxcdgen_ex/src/config_reader/xml.rs b/src/Tools/psxcdgen_ex/src/config_reader/xml.rs
index 48fd5513..44de6e16 100644
--- a/src/Tools/psxcdgen_ex/src/config_reader/xml.rs
+++ b/src/Tools/psxcdgen_ex/src/config_reader/xml.rs
@@ -2,7 +2,13 @@ use std::path::PathBuf;
use tool_helper::format_if_error;
use crate::config_reader::Directory;
-use super::{Configuration, Error, File};
+use super::{CommonProperties, Configuration, Error, File};
+
+mod attribute_names {
+ pub const NAME: &'static str = "name";
+ pub const HIDDEN: &'static str = "hidden";
+ pub const PADDED_SIZE: &'static str = "padded_size";
+}
pub fn parse(xml: String) -> Result {
let mut config = Configuration::new();
@@ -47,10 +53,8 @@ fn parse_description(description: roxmltree::Node, config: &mut Configuration) {
fn parse_track(track: roxmltree::Node, config: &mut Configuration) -> Result<(), Error> {
fn parse_file(file: roxmltree::Node, is_hidden: bool) -> Result {
Ok(File{
- name: String::from(file.attribute("name").unwrap_or_default()),
- path: PathBuf::from(file.text().unwrap_or_default()),
- is_hidden: is_hidden | parse_boolean_attribute(&file, "hidden")?,
- padded_size: read_padded_size(&file)?,
+ common: read_common_properties(&file, is_hidden)?,
+ path: PathBuf::from(file.text().unwrap_or_default()),
})
}
@@ -60,8 +64,8 @@ fn parse_track(track: roxmltree::Node, config: &mut Configuration) -> Result<(),
match node.tag_name().name() {
"File" => root.add_file(parse_file(node, is_hidden)?),
"Directory" => {
- is_hidden |= parse_boolean_attribute(&node, "hidden")?;
- let mut new_dir = Directory::new(node.attribute("name").unwrap_or_default(), is_hidden);
+ is_hidden |= parse_boolean_attribute(&node, attribute_names::HIDDEN)?;
+ let mut new_dir = Directory::new(node.attribute(attribute_names::NAME).unwrap_or_default(), is_hidden);
parse_file_system(node, &mut new_dir, is_hidden)?;
root.add_dir(new_dir);
@@ -77,8 +81,16 @@ fn parse_track(track: roxmltree::Node, config: &mut Configuration) -> Result<(),
parse_file_system(track, &mut config.root, false)
}
+fn read_common_properties(xml: &roxmltree::Node, is_hidden: bool) -> Result {
+ Ok(CommonProperties{
+ name: String::from(xml.attribute(attribute_names::NAME).unwrap_or_default()),
+ is_hidden: is_hidden | parse_boolean_attribute(&xml, attribute_names::HIDDEN)?,
+ padded_size: read_padded_size(&xml)?
+ })
+}
+
fn read_padded_size(xml: &roxmltree::Node) -> Result