1#[macro_export]
2macro_rules! zclass {
3 ($($each:expr),*) => {
4 {
5 let mut vec_class:Vec<String> = Vec::new();
6 $(
7 vec_class.push($each.to_string());
8 )*
9 XZClass::from(vec_class)
10 }
11 };
12}
13
14#[macro_export]
15macro_rules! zcs {
16 ($($each:expr),*) => {
17 {
18 let mut vec_class:Vec<String> = Vec::new();
19 $(
20 vec_class.push($each.to_string());
21 )*
22 vec_class.join(" ")
23 }
24 };
25}
26
27#[macro_export]
29macro_rules! zs {
30 ($a:expr) => {
31 $a.to_string()
32 };
33}
34
35#[macro_export]
36macro_rules! zab {
37 ($a:expr,$bool:expr) => {
38 if $bool {
39 $a.to_string()
40 } else {
41 "".to_string()
42 }
43 };
44
45 ($a:expr,$bool:expr,$b:expr) => {
46 if $bool {
47 $a.to_string()
48 } else {
49 $b.to_string()
50 }
51 };
52}
53
54
55#[macro_export]
56macro_rules! zi18n {
57 ($zshare:expr,$key:expr) => {
58 ($zshare.read().word.get($key).unwrap_or(&("".to_string()))).as_str()
59 };
60}