parsers: rename to formats

This commit is contained in:
dece 2020-05-24 16:11:41 +02:00
parent 1c509413bf
commit 027fe270a2
17 changed files with 18 additions and 18 deletions

View file

@ -4,8 +4,8 @@ use nom::multi::count;
use nom::number::complete::*; use nom::number::complete::*;
use nom::sequence::tuple; use nom::sequence::tuple;
use crate::parsers::bnd::{BinderOptions, format, use_be}; use crate::formats::bnd::{BinderOptions, format, use_be};
use crate::parsers::common::{sjis_to_string, take_cstring}; use crate::formats::common::{sjis_to_string, take_cstring};
#[derive(Debug)] #[derive(Debug)]
pub struct BhfHeader { pub struct BhfHeader {
@ -22,10 +22,10 @@ pub struct BhfHeader {
} }
impl BinderOptions for BhfHeader { impl BinderOptions for BhfHeader {
/// See `parsers::bnd::format` function. /// See `formats::bnd::format` function.
fn format(&self) -> u8 { format(self.endianness, self.raw_format) } fn format(&self) -> u8 { format(self.endianness, self.raw_format) }
/// See `parsers::bnd::use_be` function. /// See `formats::bnd::use_be` function.
fn use_be(&self) -> bool { use_be(self.endianness, self.format()) } fn use_be(&self) -> bool { use_be(self.endianness, self.format()) }
} }

View file

@ -5,7 +5,7 @@ use nom::number::complete::*;
use nom::sequence::tuple; use nom::sequence::tuple;
use crate::utils::bin::has_flag; use crate::utils::bin::has_flag;
use crate::parsers::common::{sjis_to_string, take_cstring}; use crate::formats::common::{sjis_to_string, take_cstring};
const FORMAT_BE: u8 = 0b00000001; const FORMAT_BE: u8 = 0b00000001;
const FORMAT_HAS_ID: u8 = 0b00000010; const FORMAT_HAS_ID: u8 = 0b00000010;

View file

@ -3,7 +3,7 @@ use nom::multi::count;
use nom::number::complete::*; use nom::number::complete::*;
use nom::sequence::tuple; use nom::sequence::tuple;
use crate::parsers::common::take_cstring_from; use crate::formats::common::take_cstring_from;
#[derive(Debug)] #[derive(Debug)]
pub struct DatHeader { pub struct DatHeader {

View file

@ -6,8 +6,8 @@ use nom::multi::count;
use nom::number::complete::*; use nom::number::complete::*;
use nom::sequence::tuple; use nom::sequence::tuple;
use crate::parsers::common::{sjis_to_string, take_cstring, take_cstring_from, VarSizeInt}; use crate::formats::common::{sjis_to_string, take_cstring, take_cstring_from, VarSizeInt};
use crate::parsers::paramdef; use crate::formats::paramdef;
use crate::utils::bin::{has_flag, mask}; use crate::utils::bin::{has_flag, mask};
use crate::utils::str as utils_str; use crate::utils::str as utils_str;

View file

@ -5,7 +5,7 @@ use nom::multi::count;
use nom::number::complete::*; use nom::number::complete::*;
use nom::sequence::tuple; use nom::sequence::tuple;
use crate::parsers::common::{sjis_to_string_lossy, take_cstring, take_cstring_from, VarSizeInt}; use crate::formats::common::{sjis_to_string_lossy, take_cstring, take_cstring_from, VarSizeInt};
use crate::utils::str as utils_str; use crate::utils::str as utils_str;
#[derive(Debug)] #[derive(Debug)]

View file

@ -1,7 +1,7 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
pub mod name_hashes; pub mod name_hashes;
pub mod parsers { pub mod formats {
pub mod bhd; pub mod bhd;
pub mod bhf; pub mod bhf;
pub mod bnd; pub mod bnd;

View file

@ -6,7 +6,7 @@ use std::path;
use nom::Err::{Error as NomError, Failure as NomFailure}; use nom::Err::{Error as NomError, Failure as NomFailure};
use crate::name_hashes; use crate::name_hashes;
use crate::parsers::bhd; use crate::formats::bhd;
use crate::unpackers::errors::UnpackError; use crate::unpackers::errors::UnpackError;
use crate::utils::fs as utils_fs; use crate::utils::fs as utils_fs;

View file

@ -4,7 +4,7 @@ use std::path;
use nom::Err::{Error as NomError, Failure as NomFailure}; use nom::Err::{Error as NomError, Failure as NomFailure};
use crate::parsers::bhf; use crate::formats::bhf;
use crate::unpackers::errors::UnpackError; use crate::unpackers::errors::UnpackError;
use crate::utils::fs as utils_fs; use crate::utils::fs as utils_fs;

View file

@ -4,7 +4,7 @@ use std::path;
use nom::Err::{Error as NomError, Failure as NomFailure}; use nom::Err::{Error as NomError, Failure as NomFailure};
use crate::parsers::bnd; use crate::formats::bnd;
use crate::unpackers::dcx::load_dcx; use crate::unpackers::dcx::load_dcx;
use crate::unpackers::errors::UnpackError; use crate::unpackers::errors::UnpackError;
use crate::utils::fs as utils_fs; use crate::utils::fs as utils_fs;

View file

@ -4,7 +4,7 @@ use std::path;
use nom::Err::{Error as NomError, Failure as NomFailure}; use nom::Err::{Error as NomError, Failure as NomFailure};
use crate::parsers::dat; use crate::formats::dat;
use crate::unpackers::errors::UnpackError; use crate::unpackers::errors::UnpackError;
use crate::utils::fs as utils_fs; use crate::utils::fs as utils_fs;

View file

@ -5,7 +5,7 @@ use std::path;
use flate2::read::ZlibDecoder; use flate2::read::ZlibDecoder;
use nom::Err::{Error as NomError, Failure as NomFailure}; use nom::Err::{Error as NomError, Failure as NomFailure};
use crate::parsers::dcx; use crate::formats::dcx;
use crate::unpackers::errors::UnpackError; use crate::unpackers::errors::UnpackError;
use crate::utils::fs as utils_fs; use crate::utils::fs as utils_fs;

View file

@ -2,8 +2,8 @@ use std::path;
use nom::Err::{Error as NomError, Failure as NomFailure}; use nom::Err::{Error as NomError, Failure as NomFailure};
use crate::parsers::param; use crate::formats::param;
use crate::parsers::paramdef; use crate::formats::paramdef;
use crate::unpackers::errors::UnpackError; use crate::unpackers::errors::UnpackError;
use crate::utils::fs as utils_fs; use crate::utils::fs as utils_fs;

View file

@ -2,7 +2,7 @@ use std::path;
use nom::Err::{Error as NomError, Failure as NomFailure}; use nom::Err::{Error as NomError, Failure as NomFailure};
use crate::parsers::paramdef; use crate::formats::paramdef;
use crate::unpackers::errors::UnpackError; use crate::unpackers::errors::UnpackError;
use crate::utils::fs as utils_fs; use crate::utils::fs as utils_fs;