pub struct MessageBin { /* private fields */ }
Expand description
A structure representing a translation (message) file in 3ds pokemon mystery dungeon games.
Each text have an associated (32bit, probably crc32) hash associated with them as a key.
Implementations§
Source§impl MessageBin
impl MessageBin
Sourcepub fn messages(&self) -> &Vec<(u32, u32, String)>
pub fn messages(&self) -> &Vec<(u32, u32, String)>
Return all the hash, the unk value and message content stored in the file
Sourcepub fn message_by_hash(&self, hash: u32) -> Option<&String>
pub fn message_by_hash(&self, hash: u32) -> Option<&String>
Return the message content with the given hash if it exist.
Sourcepub fn insert(&mut self, hash: u32, unk: u32, message: String)
pub fn insert(&mut self, hash: u32, unk: u32, message: String)
If the hash is already present, update the message content and unknown value, otherwise, add a new message at the end of the messages list. Return the old string if it exist.
Sourcepub fn load_file<T: Read + Seek>(
file: &mut T,
code_to_text: Option<&CodeToText<'_>>,
) -> Result<Self, MessageBinReadError>
pub fn load_file<T: Read + Seek>( file: &mut T, code_to_text: Option<&CodeToText<'_>>, ) -> Result<Self, MessageBinReadError>
Load a MessageBin file from the reader.
pub fn write<T: Seek + Write>( &self, file: &mut T, text_to_code: Option<&TextToCode<'_>>, ) -> Result<(), MessageBinWriteError>
Trait Implementations§
Source§impl Debug for MessageBin
impl Debug for MessageBin
Source§impl Default for MessageBin
impl Default for MessageBin
Source§fn default() -> MessageBin
fn default() -> MessageBin
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MessageBin
impl RefUnwindSafe for MessageBin
impl Send for MessageBin
impl Sync for MessageBin
impl Unpin for MessageBin
impl UnwindSafe for MessageBin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more