WIP mutf8

This commit is contained in:
Jean-Marie Mineau 2023-08-23 16:36:49 +02:00
parent d44e2b624b
commit 24f4b0b46d
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
3 changed files with 459 additions and 2 deletions

View file

@ -6,13 +6,16 @@ use std::io::{Cursor, Read, Seek, SeekFrom, Write};
pub use androscalpel_serializer_derive::*;
pub mod leb;
pub mod string;
pub use leb::*;
pub use string::*;
#[derive(Debug, PartialEq, Eq)]
pub enum Error {
InputTooSmall(String), // TODO: find a better name
SerializationError(String),
DeserializationError(String),
InvalidStringEncoding(String),
}
pub type Result<T> = core::result::Result<T, Error>;
@ -26,6 +29,7 @@ impl std::fmt::Display for Error {
Self::InputTooSmall(msg) => write!(f, "Error: {}", msg),
Self::SerializationError(msg) => write!(f, "Error: {}", msg),
Self::DeserializationError(msg) => write!(f, "Error: {}", msg),
Self::InvalidStringEncoding(msg) => write!(f, "Error: {}", msg),
}
}
}