This commit is contained in:
Jean-Marie Mineau 2024-04-15 15:13:30 +02:00
parent d47494f8f6
commit ef6a2196a7
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
6 changed files with 580 additions and 9 deletions

View file

@ -71,6 +71,36 @@ pub enum MapItemType {
UnkownType(u16),
}
impl MapItemType {
/// If data of this type is stored in the data section
pub fn is_data_section_type(&self) -> bool {
match self {
Self::HeaderItem => false,
Self::StringIdItem => false,
Self::TypeIdItem => false,
Self::ProtoIdItem => false,
Self::FieldIdItem => false,
Self::MethodIdItem => false,
Self::ClassDefItem => false,
Self::CallSiteIdItem => true,
Self::MethodHandleItem => true,
Self::MapList => true,
Self::TypeList => true,
Self::AnnotationSetRefList => true,
Self::AnnotationSetItem => true,
Self::ClassDataItem => true,
Self::CodeItem => true,
Self::StringDataItem => true,
Self::DebugInfoItem => true,
Self::AnnotationItem => true,
Self::EncodedArrayItem => true,
Self::AnnotationsDirectoryItem => true,
Self::HiddenapiClassDataItem => true,
Self::UnkownType(_) => true, // Most likely
}
}
}
impl MapList {
/// The size field of a MapList.
pub fn size_field(&self) -> u32 {