2020-01-24 10:57:14 +02:00
|
|
|
macro_rules! open {
|
2019-11-06 07:55:14 +02:00
|
|
|
($name: ident, $el_name: expr) => {
|
2020-01-24 10:57:14 +02:00
|
|
|
#[allow(dead_code)]
|
2019-11-06 07:55:14 +02:00
|
|
|
pub(crate) fn $name(mut self) -> Self {
|
|
|
|
self.writer
|
|
|
|
.write(XmlEvent::start_element($el_name))
|
|
|
|
.expect("should write to buf");
|
|
|
|
self
|
|
|
|
}
|
|
|
|
};
|
2019-11-05 11:03:23 +02:00
|
|
|
($name: ident, $el_name: expr, $attr0: expr) => {
|
|
|
|
pub(crate) fn $name(mut self, arg0: &str) -> Self {
|
|
|
|
self.writer
|
2019-11-06 07:55:14 +02:00
|
|
|
.write(XmlEvent::start_element($el_name).attr($attr0, arg0))
|
2019-11-05 11:03:23 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self
|
|
|
|
}
|
|
|
|
};
|
2019-11-05 12:20:40 +02:00
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr) => {
|
|
|
|
pub(crate) fn $name(mut self, arg0: &str, arg1: &str) -> Self {
|
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1),
|
|
|
|
)
|
2019-11-05 12:20:40 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self
|
|
|
|
}
|
|
|
|
};
|
2019-11-06 05:29:17 +02:00
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr) => {
|
|
|
|
pub(crate) fn $name(mut self, arg0: &str, arg1: &str, arg2: &str) -> Self {
|
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2),
|
|
|
|
)
|
2019-11-06 05:29:17 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr) => {
|
|
|
|
pub(crate) fn $name(mut self, arg0: &str, arg1: &str, arg2: &str, arg3: &str) -> Self {
|
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3),
|
|
|
|
)
|
2019-11-06 05:29:17 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr, $attr4: expr) => {
|
2020-06-02 21:27:04 +03:00
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
arg0: &str,
|
|
|
|
arg1: &str,
|
|
|
|
arg2: &str,
|
|
|
|
arg3: &str,
|
|
|
|
arg4: &str,
|
|
|
|
) -> Self {
|
2019-11-06 05:29:17 +02:00
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3)
|
|
|
|
.attr($attr4, arg4),
|
|
|
|
)
|
|
|
|
.expect("should write to buf");
|
|
|
|
self
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr, $attr4: expr, $attr5: expr) => {
|
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
arg0: &str,
|
|
|
|
arg1: &str,
|
|
|
|
arg2: &str,
|
|
|
|
arg3: &str,
|
|
|
|
arg4: &str,
|
|
|
|
arg5: &str,
|
|
|
|
) -> Self {
|
|
|
|
self.writer
|
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3)
|
|
|
|
.attr($attr4, arg4)
|
|
|
|
.attr($attr5, arg5),
|
|
|
|
)
|
|
|
|
.expect("should write to buf");
|
|
|
|
self
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr, $attr4: expr, $attr5: expr, $attr6: expr) => {
|
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
arg0: &str,
|
|
|
|
arg1: &str,
|
|
|
|
arg2: &str,
|
|
|
|
arg3: &str,
|
|
|
|
arg4: &str,
|
|
|
|
arg5: &str,
|
|
|
|
arg6: &str,
|
|
|
|
) -> Self {
|
|
|
|
self.writer
|
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3)
|
|
|
|
.attr($attr4, arg4)
|
|
|
|
.attr($attr5, arg5)
|
|
|
|
.attr($attr6, arg6),
|
|
|
|
)
|
|
|
|
.expect("should write to buf");
|
|
|
|
self
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr, $attr4: expr, $attr5: expr, $attr6: expr, $attr7: expr) => {
|
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
arg0: &str,
|
|
|
|
arg1: &str,
|
|
|
|
arg2: &str,
|
|
|
|
arg3: &str,
|
|
|
|
arg4: &str,
|
|
|
|
arg5: &str,
|
|
|
|
arg6: &str,
|
|
|
|
arg7: &str,
|
|
|
|
) -> Self {
|
|
|
|
self.writer
|
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3)
|
|
|
|
.attr($attr4, arg4)
|
|
|
|
.attr($attr5, arg5)
|
|
|
|
.attr($attr6, arg6)
|
|
|
|
.attr($attr7, arg7),
|
|
|
|
)
|
|
|
|
.expect("should write to buf");
|
|
|
|
self
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr, $attr4: expr, $attr5: expr, $attr6: expr, $attr7: expr, $attr8: expr) => {
|
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
arg0: &str,
|
|
|
|
arg1: &str,
|
|
|
|
arg2: &str,
|
|
|
|
arg3: &str,
|
|
|
|
arg4: &str,
|
|
|
|
arg5: &str,
|
|
|
|
arg6: &str,
|
|
|
|
arg7: &str,
|
|
|
|
arg8: &str,
|
|
|
|
) -> Self {
|
|
|
|
self.writer
|
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3)
|
|
|
|
.attr($attr4, arg4)
|
|
|
|
.attr($attr5, arg5)
|
|
|
|
.attr($attr6, arg6)
|
|
|
|
.attr($attr7, arg7)
|
|
|
|
.attr($attr8, arg8),
|
|
|
|
)
|
|
|
|
.expect("should write to buf");
|
|
|
|
self
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr, $attr4: expr, $attr5: expr, $attr6: expr, $attr7: expr, $attr8: expr, $attr9: expr) => {
|
|
|
|
#[allow(clippy::too_many_arguments)]
|
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
arg0: &str,
|
|
|
|
arg1: &str,
|
|
|
|
arg2: &str,
|
|
|
|
arg3: &str,
|
|
|
|
arg4: &str,
|
|
|
|
arg5: &str,
|
|
|
|
arg6: &str,
|
|
|
|
arg7: &str,
|
|
|
|
arg8: &str,
|
|
|
|
arg9: &str,
|
|
|
|
) -> Self {
|
|
|
|
self.writer
|
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3)
|
|
|
|
.attr($attr4, arg4)
|
|
|
|
.attr($attr5, arg5)
|
|
|
|
.attr($attr6, arg6)
|
|
|
|
.attr($attr7, arg7)
|
|
|
|
.attr($attr8, arg8)
|
|
|
|
.attr($attr9, arg9),
|
|
|
|
)
|
|
|
|
.expect("should write to buf");
|
|
|
|
self
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr, $attr4: expr, $attr5: expr, $attr6: expr, $attr7: expr, $attr8: expr, $attr9: expr, $attr10: expr) => {
|
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
arg0: &str,
|
|
|
|
arg1: &str,
|
|
|
|
arg2: &str,
|
|
|
|
arg3: &str,
|
|
|
|
arg4: &str,
|
|
|
|
arg5: &str,
|
|
|
|
arg6: &str,
|
|
|
|
arg7: &str,
|
|
|
|
arg8: &str,
|
|
|
|
arg9: &str,
|
|
|
|
arg10: &str,
|
|
|
|
) -> Self {
|
|
|
|
self.writer
|
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3)
|
|
|
|
.attr($attr4, arg4)
|
|
|
|
.attr($attr5, arg5)
|
|
|
|
.attr($attr6, arg6)
|
|
|
|
.attr($attr7, arg7)
|
|
|
|
.attr($attr8, arg8)
|
|
|
|
.attr($attr9, arg9)
|
|
|
|
.attr($attr10, arg10),
|
|
|
|
)
|
2019-11-06 05:29:17 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self
|
|
|
|
}
|
|
|
|
};
|
2019-11-05 12:20:40 +02:00
|
|
|
}
|
|
|
|
|
2020-01-24 10:57:14 +02:00
|
|
|
macro_rules! closed_with_child {
|
2019-11-05 12:20:40 +02:00
|
|
|
($name: ident, $el_name: expr) => {
|
2020-01-24 10:57:14 +02:00
|
|
|
#[allow(dead_code)]
|
2019-11-05 12:20:40 +02:00
|
|
|
pub(crate) fn $name(mut self, child: &str) -> Self {
|
|
|
|
self.writer
|
2019-11-06 07:55:14 +02:00
|
|
|
.write(XmlEvent::start_element($el_name))
|
2019-11-05 12:20:40 +02:00
|
|
|
.expect("should write to buf");
|
2020-06-02 21:27:04 +03:00
|
|
|
self.writer.write(child).expect("should write to buf");
|
2019-11-05 12:20:40 +02:00
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr) => {
|
|
|
|
pub(crate) fn $name(mut self, arg0: &str, child: &str) -> Self {
|
|
|
|
self.writer
|
2019-11-06 07:55:14 +02:00
|
|
|
.write(XmlEvent::start_element($el_name).attr($attr0, arg0))
|
2019-11-05 12:20:40 +02:00
|
|
|
.expect("should write to buf");
|
2020-06-02 21:27:04 +03:00
|
|
|
self.writer.write(child).expect("should write to buf");
|
2019-11-05 12:20:40 +02:00
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr) => {
|
|
|
|
pub(crate) fn $name(mut self, arg0: &str, arg1: &str, child: &str) -> Self {
|
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1),
|
|
|
|
)
|
2019-11-05 12:20:40 +02:00
|
|
|
.expect("should write to buf");
|
2020-06-02 21:27:04 +03:00
|
|
|
self.writer.write(child).expect("should write to buf");
|
2019-11-05 12:20:40 +02:00
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr) => {
|
|
|
|
pub(crate) fn $name(mut self, arg0: &str, arg1: &str, arg2: &str, child: &str) -> Self {
|
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2),
|
|
|
|
)
|
2019-11-05 12:20:40 +02:00
|
|
|
.expect("should write to buf");
|
2020-06-02 21:27:04 +03:00
|
|
|
self.writer.write(child).expect("should write to buf");
|
2019-11-05 12:20:40 +02:00
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
2019-11-05 11:03:23 +02:00
|
|
|
}
|
|
|
|
|
2020-01-24 10:57:14 +02:00
|
|
|
macro_rules! closed {
|
2019-11-06 12:17:49 +02:00
|
|
|
($name: ident, $el_name: expr) => {
|
2022-11-02 15:34:27 +02:00
|
|
|
#[allow(clippy::wrong_self_convention)]
|
2019-11-06 12:17:49 +02:00
|
|
|
pub(crate) fn $name(mut self) -> Self {
|
|
|
|
self.writer
|
|
|
|
.write(XmlEvent::start_element($el_name))
|
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
2019-11-05 11:03:23 +02:00
|
|
|
($name: ident, $el_name: expr, $attr0: expr) => {
|
2022-11-02 15:34:27 +02:00
|
|
|
#[allow(clippy::wrong_self_convention)]
|
|
|
|
|
2019-11-05 11:03:23 +02:00
|
|
|
pub(crate) fn $name(mut self, arg0: &str) -> Self {
|
|
|
|
self.writer
|
2019-11-06 07:55:14 +02:00
|
|
|
.write(XmlEvent::start_element($el_name).attr($attr0, arg0))
|
2019-11-05 11:03:23 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr) => {
|
2020-01-24 10:57:14 +02:00
|
|
|
#[allow(dead_code)]
|
2022-11-02 15:34:27 +02:00
|
|
|
#[allow(clippy::wrong_self_convention)]
|
2019-11-05 11:03:23 +02:00
|
|
|
pub(crate) fn $name(mut self, arg0: &str, arg1: &str) -> Self {
|
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1),
|
|
|
|
)
|
2019-11-05 11:03:23 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr) => {
|
|
|
|
pub(crate) fn $name(mut self, arg0: &str, arg1: &str, arg2: &str) -> Self {
|
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2),
|
|
|
|
)
|
2019-11-05 11:03:23 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
2019-11-14 18:50:30 +02:00
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr) => {
|
|
|
|
pub(crate) fn $name(mut self, arg0: &str, arg1: &str, arg2: &str, arg3: &str) -> Self {
|
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3),
|
|
|
|
)
|
2019-11-14 18:50:30 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr, $attr4: expr) => {
|
2020-06-02 21:27:04 +03:00
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
arg0: &str,
|
|
|
|
arg1: &str,
|
|
|
|
arg2: &str,
|
|
|
|
arg3: &str,
|
|
|
|
arg4: &str,
|
|
|
|
) -> Self {
|
2019-11-14 18:50:30 +02:00
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3)
|
|
|
|
.attr($attr4, arg4),
|
|
|
|
)
|
2019-11-14 18:50:30 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr, $attr4: expr, $attr5: expr) => {
|
2020-06-02 21:27:04 +03:00
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
arg0: &str,
|
|
|
|
arg1: &str,
|
|
|
|
arg2: &str,
|
|
|
|
arg3: &str,
|
|
|
|
arg4: &str,
|
|
|
|
arg5: &str,
|
|
|
|
) -> Self {
|
2019-11-14 18:50:30 +02:00
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3)
|
|
|
|
.attr($attr4, arg4)
|
|
|
|
.attr($attr5, arg5),
|
|
|
|
)
|
2019-11-14 18:50:30 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr, $attr4: expr, $attr5: expr, $attr6: expr) => {
|
2020-01-24 10:57:14 +02:00
|
|
|
#[allow(clippy::too_many_arguments)]
|
2020-06-02 21:27:04 +03:00
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
arg0: &str,
|
|
|
|
arg1: &str,
|
|
|
|
arg2: &str,
|
|
|
|
arg3: &str,
|
|
|
|
arg4: &str,
|
|
|
|
arg5: &str,
|
|
|
|
arg6: &str,
|
|
|
|
) -> Self {
|
2019-11-14 18:50:30 +02:00
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3)
|
|
|
|
.attr($attr4, arg4)
|
|
|
|
.attr($attr5, arg5)
|
|
|
|
.attr($attr6, arg6),
|
|
|
|
)
|
2019-11-14 18:50:30 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr, $attr4: expr, $attr5: expr, $attr6: expr, $attr7: expr) => {
|
2020-01-24 10:57:14 +02:00
|
|
|
#[allow(clippy::too_many_arguments)]
|
2020-06-02 21:27:04 +03:00
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
arg0: &str,
|
|
|
|
arg1: &str,
|
|
|
|
arg2: &str,
|
|
|
|
arg3: &str,
|
|
|
|
arg4: &str,
|
|
|
|
arg5: &str,
|
|
|
|
arg6: &str,
|
|
|
|
arg7: &str,
|
|
|
|
) -> Self {
|
2019-11-14 18:50:30 +02:00
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3)
|
|
|
|
.attr($attr4, arg4)
|
|
|
|
.attr($attr5, arg5)
|
|
|
|
.attr($attr6, arg6)
|
|
|
|
.attr($attr7, arg7),
|
|
|
|
)
|
2019-11-14 18:50:30 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($name: ident, $el_name: expr, $attr0: expr, $attr1: expr, $attr2: expr, $attr3: expr, $attr4: expr, $attr5: expr, $attr6: expr, $attr7: expr, $attr8: expr) => {
|
2020-01-24 10:57:14 +02:00
|
|
|
#[allow(clippy::too_many_arguments)]
|
2020-06-02 21:27:04 +03:00
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
arg0: &str,
|
|
|
|
arg1: &str,
|
|
|
|
arg2: &str,
|
|
|
|
arg3: &str,
|
|
|
|
arg4: &str,
|
|
|
|
arg5: &str,
|
|
|
|
arg6: &str,
|
|
|
|
arg7: &str,
|
|
|
|
arg8: &str,
|
|
|
|
) -> Self {
|
2019-11-14 18:50:30 +02:00
|
|
|
self.writer
|
2020-06-02 21:27:04 +03:00
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr($attr0, arg0)
|
|
|
|
.attr($attr1, arg1)
|
|
|
|
.attr($attr2, arg2)
|
|
|
|
.attr($attr3, arg3)
|
|
|
|
.attr($attr4, arg4)
|
|
|
|
.attr($attr5, arg5)
|
|
|
|
.attr($attr6, arg6)
|
|
|
|
.attr($attr7, arg7)
|
|
|
|
.attr($attr8, arg8),
|
|
|
|
)
|
2019-11-14 18:50:30 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
2019-11-05 11:03:23 +02:00
|
|
|
}
|
2019-11-11 04:10:33 +02:00
|
|
|
|
2020-01-24 10:57:14 +02:00
|
|
|
macro_rules! closed_with_str {
|
2019-11-11 04:10:33 +02:00
|
|
|
($name: ident, $el_name: expr) => {
|
2020-01-24 10:57:14 +02:00
|
|
|
#[allow(dead_code)]
|
2019-11-11 04:10:33 +02:00
|
|
|
pub(crate) fn $name(mut self, val: &str) -> Self {
|
|
|
|
self.writer
|
|
|
|
.write(XmlEvent::start_element($el_name).attr("w:val", val))
|
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-01-24 10:57:14 +02:00
|
|
|
macro_rules! closed_with_usize {
|
2019-11-11 04:10:33 +02:00
|
|
|
($name: ident, $el_name: expr) => {
|
|
|
|
pub(crate) fn $name(mut self, val: usize) -> Self {
|
|
|
|
self.writer
|
2019-11-11 08:36:26 +02:00
|
|
|
.write(XmlEvent::start_element($el_name).attr("w:val", &format!("{}", val)))
|
2019-11-11 04:10:33 +02:00
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2019-11-12 06:33:45 +02:00
|
|
|
|
2024-03-18 16:27:28 +02:00
|
|
|
macro_rules! closed_with_isize {
|
|
|
|
($name: ident, $el_name: expr) => {
|
|
|
|
pub(crate) fn $name(mut self, val: isize) -> Self {
|
|
|
|
self.writer
|
|
|
|
.write(XmlEvent::start_element($el_name).attr("w:val", &format!("{}", val)))
|
|
|
|
.expect("should write to buf");
|
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-11-12 06:33:45 +02:00
|
|
|
macro_rules! closed_w_with_type_el {
|
|
|
|
($name: ident, $el_name: expr) => {
|
2020-03-19 18:19:39 +02:00
|
|
|
pub(crate) fn $name(mut self, w: i32, t: WidthType) -> Self {
|
2020-06-02 21:27:04 +03:00
|
|
|
self.writer
|
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr("w:w", &format!("{}", w))
|
|
|
|
.attr("w:type", &t.to_string()),
|
|
|
|
)
|
|
|
|
.expect(EXPECT_MESSAGE);
|
|
|
|
self.close()
|
2019-11-12 06:33:45 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! closed_border_el {
|
|
|
|
($name: ident, $el_name: expr) => {
|
2020-06-02 21:27:04 +03:00
|
|
|
pub(crate) fn $name(
|
|
|
|
mut self,
|
|
|
|
val: BorderType,
|
|
|
|
size: usize,
|
|
|
|
space: usize,
|
|
|
|
color: &str,
|
|
|
|
) -> Self {
|
|
|
|
self.writer
|
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr("w:val", &val.to_string())
|
|
|
|
.attr("w:sz", &format!("{}", size))
|
|
|
|
.attr("w:space", &format!("{}", space))
|
|
|
|
.attr("w:color", color),
|
|
|
|
)
|
|
|
|
.expect(EXPECT_MESSAGE);
|
|
|
|
self.close()
|
2019-11-12 06:33:45 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2023-07-27 15:43:15 +03:00
|
|
|
|
|
|
|
macro_rules! closed_paragraph_border_el {
|
|
|
|
($name: ident, $ el_name: expr) => {
|
2024-03-18 16:27:28 +02:00
|
|
|
pub(crate) fn $name<'a>(mut self, val: &str, space: &str, size: &str, color: &str) -> Self {
|
|
|
|
self.writer
|
|
|
|
.write(
|
|
|
|
XmlEvent::start_element($el_name)
|
|
|
|
.attr("w:val", val)
|
|
|
|
.attr("w:space", space)
|
|
|
|
.attr("w:sz", size)
|
|
|
|
.attr("w:color", color),
|
|
|
|
)
|
|
|
|
.expect(EXPECT_MESSAGE);
|
2023-07-27 15:43:15 +03:00
|
|
|
self.close()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|