1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//! # The Signum! document
//!
//! This module contains the datastructures and parsers for reading SDO files.

use nom::{
    combinator::map,
    number::complete::{be_u16, be_u32},
    IResult,
};

use crate::util::{Bytes16, Bytes32};
use fmt::Debug;
use std::{borrow::Cow, fmt};

pub mod container;
pub mod cset;
pub mod hcim;
pub mod header;
pub mod pbuf;
pub mod sysp;
pub mod tebu;

#[derive(Debug)]
struct SDoc<'a> {
    charsets: Vec<Cow<'a, str>>,
}

/// Take the next 16 bytes
pub fn bytes16(input: &[u8]) -> IResult<&[u8], Bytes16> {
    map(be_u16, Bytes16)(input)
}

/// Take the next 32 bytes
pub fn bytes32(input: &[u8]) -> IResult<&[u8], Bytes32> {
    map(be_u32, Bytes32)(input)
}