Struct CodeTable

Source
pub struct CodeTable { /* private fields */ }
Expand description

Represent a complete [code_table.bin] file.

Implementations§

Source§

impl CodeTable

Source

pub fn new_from_file<F: Read + Seek>( file: F, ) -> Result<Self, CodeTableDecodeError>

Create a new CodeTable from a reader open on a code_table.bin

Source

pub fn add_missing(&mut self)

Add the three 0xcf00, 0xcf02, 0xcfff code, missing from the standard [code_table.bin] (control for rubi/overtext)

Source

pub fn generate_code_to_text(&self) -> CodeToText<'_>

Generate a CodeToText object, allowing to transform an encoded text to a String with human readable placeholder.

Source

pub fn generate_text_to_code(&self) -> TextToCode<'_>

Generate a TextToCode object, allowing to transform a human-readable string (generated by a CodeToText) into a binary text readable by the game (it first need to be put inside a message container (see the pmd_message crate) then into a farc file (see pmd_farc crate). The pmdtranslate crate contain command line and a complete exemple for those case.

Source

pub fn entries(&self) -> &Vec<CodeTableEntryFile>

Return a list of all the entries in this file

Trait Implementations§

Source§

impl Default for CodeTable

Source§

fn default() -> CodeTable

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.