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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! A crate with data types for known BXCAD (BRCAD/BCCAD) formats
//!
//! # Obtaining and working with BXCAD formats
//! In order to parse a BXCAD file's data, you must use the methods implemented in the [BXCAD] trait.
//!
//! **Example:**
//! ```no_run
//! # use std::fs::File;
//! use flour::{BCCAD, BXCAD};
//! # fn main() -> Result<(), flour::error::Error> {
//!
//! // Open a BCCAD file
//! let mut file = File::open("file.bccad")?;
//! let mut bccad = BCCAD::from_binary(&mut file)?;
//!
//! // Delete all animations, and save as a new file
//! bccad.animations = vec![];
//! let mut out_file = File::create("file.out.bccad")?;
//! bccad.to_binary(&mut out_file)?;
//! # Ok(())
//! # }
//! ```
//!
//! # Serializing and BXCADWrapper
//! While [`BXCAD`] doesn't require `serde::Serialize` and `serde::Deserialize`, implementing
//! those is the main idea behind the trait, since that way the BXCAD can be wrapped inside a
//! [`bxcad::BXCADWrapper`]. The function of this struct is to give a common metadata API for all
//! flour-compatible BXCADs.
//!
//! You can create a [`BXCADWrapper`][bxcad::BXCADWrapper] like so:
//! ```no_run
//! # use std::fs::File;
//! # use flour::{BCCAD, BXCAD};
//! use flour::bxcad::BXCADWrapper;
//! # fn main() -> Result<(), flour::error::Error> {
//! # let mut file = File::open("file.bccad")?;
//! # let mut bccad = BCCAD::from_binary(&mut file)?;
//!
//! // this could instead be BXCADWrapper::from_bxcad_indexized, to allow indexization
//! let wrapper = BXCADWrapper::from_bxcad(bccad);
//!
//! # Ok(())
//! # }
//! ```
//!
//! This [`BXCADWrapper`][bxcad::BXCADWrapper] can now be serialized/deserialized without any
//! compatibility issues with other BXCAD types or with future/past versions of flour (post-1.0).
//!
//! For details on "indexization", see [`bxcad::qol::Indexizable`].
//!
//! # Comments
//! `flour` supports the following types of comments:
//! - Single-line: `// comment`
//! - Multi-line: `/* comment */`
//!
//! # Features
//! * **`modder_qol`**
use ;
/// Contains a model for the generic BXCAD format, as well as
/// known implementations of it
/// Error handling
pub
pub use ;
/// RGB color
/// Variable length string, used in BCCAD labels
///
/// Format is as follows:
///
/// * 1 byte for string size (n)
/// * n bytes for string contents
/// * Padded to 4 bytes
;