Skip to content
Merged
2 changes: 2 additions & 0 deletions src/puffin/src/file_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ pub const MIN_FOOTER_SIZE: u64 = MAGIC_SIZE * 2 + FLAGS_SIZE + PAYLOAD_SIZE_SIZE
bitflags! {
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Flags: u32 {
const DEFAULT = 0b00000000;
Comment thread
zhongzc marked this conversation as resolved.

const FOOTER_PAYLOAD_COMPRESSED_LZ4 = 0b00000001;
}
}
4 changes: 2 additions & 2 deletions src/puffin/src/file_format/writer/footer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use snafu::ResultExt;

use crate::blob_metadata::BlobMetadata;
use crate::error::{Result, SerializeJsonSnafu};
use crate::file_format::{MAGIC, MIN_FOOTER_SIZE};
use crate::file_format::{Flags, MAGIC, MIN_FOOTER_SIZE};
use crate::file_metadata::FileMetadataBuilder;

/// Writer for the footer of a Puffin file.
Expand Down Expand Up @@ -73,7 +73,7 @@ impl FooterWriter {
///
/// TODO(zhongzc): support compression
Comment thread
killme2008 marked this conversation as resolved.
fn write_flags(&self, buf: &mut Vec<u8>) {
buf.extend_from_slice(&[0; 4]);
buf.extend_from_slice(&Flags::DEFAULT.bits().to_le_bytes());
}

fn footer_payload(&mut self) -> Result<Vec<u8>> {
Expand Down