umya_spreadsheet/structs/
csv_writer_option.rs

1use super::EnumValue;
2use crate::structs::CsvEncodeValues;
3
4#[derive(Clone, Default, Debug, Eq, Ord, PartialEq, PartialOrd)]
5pub struct CsvWriterOption {
6    pub(crate) csv_encode_values: EnumValue<CsvEncodeValues>,
7    pub(crate) wrap_with_char: Box<str>,
8    pub(crate) do_trim: bool,
9}
10impl CsvWriterOption {
11    #[inline]
12    pub fn get_csv_encode_value(&self) -> &CsvEncodeValues {
13        self.csv_encode_values.get_value()
14    }
15
16    #[inline]
17    pub fn set_csv_encode_value(&mut self, value: CsvEncodeValues) -> &mut Self {
18        self.csv_encode_values.set_value(value);
19        self
20    }
21
22    #[inline]
23    pub fn get_wrap_with_char(&self) -> &str {
24        &self.wrap_with_char
25    }
26
27    #[inline]
28    pub fn set_wrap_with_char<S: Into<String>>(&mut self, value: S) -> &mut Self {
29        self.wrap_with_char = value.into().into_boxed_str();
30        self
31    }
32
33    #[inline]
34    pub fn get_do_trim(&self) -> &bool {
35        &self.do_trim
36    }
37
38    #[inline]
39    pub fn set_do_trim(&mut self, value: bool) -> &mut Self {
40        self.do_trim = value;
41        self
42    }
43}