mp4ameta 0.13.0

A library for reading and writing iTunes style MPEG-4 audio metadata.
Documentation
use super::*;

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Ftyp {
    pub size: Size,
    pub string: String,
}

impl Ftyp {
    pub fn parse(reader: &mut (impl Read + Seek), file_len: u64) -> crate::Result<Self> {
        let head = head::parse(reader, file_len)?;
        if head.fourcc() != FILETYPE {
            return Err(crate::Error::new(ErrorKind::NoFtyp, "No filetype atom found."));
        }

        let string = reader.read_utf8(head.content_len())?;

        Ok(Ftyp { size: head.size(), string })
    }
}