(view: &BinaryView)
| 50 | } |
| 51 | |
| 52 | pub fn from_view_settings(view: &BinaryView) -> Self { |
| 53 | let mut load_settings = LoadSettings::default(); |
| 54 | let settings = Settings::new(); |
| 55 | let mut query_opts = QueryOptions::new_with_view(view); |
| 56 | if settings.contains(Self::ADD_BITFIELDS_SETTING) { |
| 57 | load_settings.add_bitfields = |
| 58 | settings.get_bool_with_opts(Self::ADD_BITFIELDS_SETTING, &mut query_opts); |
| 59 | } |
| 60 | if settings.contains(Self::ADD_COMMENTS_SETTING) { |
| 61 | load_settings.add_comments = |
| 62 | settings.get_bool_with_opts(Self::ADD_COMMENTS_SETTING, &mut query_opts); |
| 63 | } |
| 64 | if settings.contains(Self::AUTO_LOAD_FILE_SETTING) { |
| 65 | let path_str = |
| 66 | settings.get_string_with_opts(Self::AUTO_LOAD_FILE_SETTING, &mut query_opts); |
| 67 | if !path_str.is_empty() { |
| 68 | let path = PathBuf::from(path_str.to_string()); |
| 69 | load_settings.auto_load_file = Some(path); |
| 70 | } |
| 71 | } |
| 72 | load_settings |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | impl Default for LoadSettings { |
nothing calls this directly
no test coverage detected