del_geo_cpp_headers/
lib.rs

1pub struct Headers {}
2
3pub const HEADERS: Headers = Headers {};
4
5impl Headers {
6    pub fn get(&self, idx: u32) -> Option<(&str, &str)> {
7        match idx {
8            0 => Some(("aabb.h", include_str!("aabb.h"))),
9            1 => Some(("aabb2.h", include_str!("aabb2.h"))),
10            2 => Some(("aabb3.h", include_str!("aabb3.h"))),
11            3 => Some(("mat2_sym.h", include_str!("mat2_sym.h"))),
12            4 => Some(("mat2x3_col_major.h", include_str!("mat2x3_col_major.h"))),
13            5 => Some(("mat3_col_major.h", include_str!("mat3_col_major.h"))),
14            6 => Some(("mat4_col_major.h", include_str!("mat4_col_major.h"))),
15            7 => Some(("quaternion.h", include_str!("quaternion.h"))),
16            8 => Some(("tri3.h", include_str!("tri3.h"))),
17            9 => Some(("vec3.h", include_str!("vec3.h"))),
18            _ => None,
19        }
20    }
21
22    pub fn write_files(&self, path_out_dir: &std::path::Path) {
23        for header_idx in 0.. {
24            use std::io::Write;
25            let Some((header_name, header_content)) = self.get(header_idx) else {
26                break;
27            };
28            let path = path_out_dir.join(header_name);
29            let mut output = std::fs::File::create(path).unwrap();
30            write!(output, "{}", header_content).unwrap();
31        }
32    }
33}