umya_spreadsheet/structs/
font_family_numbering.rs1use super::Int32Value;
3use crate::reader::driver::*;
4use crate::writer::driver::*;
5use quick_xml::events::BytesStart;
6use quick_xml::Reader;
7use quick_xml::Writer;
8use std::io::Cursor;
9
10#[derive(Clone, Default, Debug, Eq, Ord, PartialEq, PartialOrd)]
11pub struct FontFamilyNumbering {
12 pub(crate) val: Int32Value,
13}
14
15impl FontFamilyNumbering {
16 #[inline]
17 pub fn get_val(&self) -> &i32 {
18 self.val.get_value()
19 }
20
21 #[inline]
22 pub fn set_val(&mut self, value: i32) -> &mut Self {
23 self.val.set_value(value);
24 self
25 }
26
27 #[inline]
28 pub(crate) fn set_attributes<R: std::io::BufRead>(
29 &mut self,
30 _reader: &mut Reader<R>,
31 e: &BytesStart,
32 ) {
33 set_string_from_xml!(self, e, val, "val");
34 }
35
36 #[inline]
37 pub(crate) fn write_to(&self, writer: &mut Writer<Cursor<Vec<u8>>>) {
38 if self.val.has_value() {
40 write_start_tag(
41 writer,
42 "family",
43 vec![("val", &self.val.get_value_string())],
44 true,
45 );
46 }
47 }
48}