MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / from_view_settings

Method from_view_settings

plugins/svd/src/settings.rs:52–73  ·  view source on GitHub ↗
(view: &BinaryView)

Source from the content-addressed store, hash-verified

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
76impl Default for LoadSettings {

Callers

nothing calls this directly

Calls 4

get_bool_with_optsMethod · 0.80
get_string_with_optsMethod · 0.80
containsMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected