public static Dictionary<string, string> ToDictionary(cef_string_map* map) { if (map == null) return null; var result = new Dictionary<string, string>(); var count = libcef.string_map_size(map); if (count == 0) return result; cef_string_t n_value = new cef_string_t(); for (var i = 0; i < count; i++) { libcef.string_map_key(map, i, &n_value); // FIXME: do not ignore return value of libcef.string_map_key var key = cef_string_t.ToString(&n_value); libcef.string_map_value(map, i, &n_value); // FIXME: do not ignore return value of libcef.string_map_value var value = cef_string_t.ToString(&n_value); result.Add(key, value); } libcef.string_clear(&n_value); return result; }
public static void get_element_attributes(cef_domnode_t* self, cef_string_map* attrMap) { get_element_attributes_delegate d; var p = self->_get_element_attributes; if (p == _p1a) { d = _d1a; } else { d = (get_element_attributes_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_element_attributes_delegate)); if (_p1a == IntPtr.Zero) { _d1a = d; _p1a = p; } } d(self, attrMap); }
public static extern void string_map_free(cef_string_map* map);
public static extern void string_map_clear(cef_string_map* map);
public static extern int string_map_append(cef_string_map* map, cef_string_t* key, cef_string_t* value);
public static extern int string_map_value(cef_string_map* map, int index, cef_string_t* value);
public static extern int string_map_key(cef_string_map* map, int index, cef_string_t* key);
public static extern int string_map_size(cef_string_map* map);
public static void get_switches(cef_command_line_t* self, cef_string_map* switches) { get_switches_delegate d; var p = self->_get_switches; if (p == _p10) { d = _d10; } else { d = (get_switches_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_switches_delegate)); if (_p10 == IntPtr.Zero) { _d10 = d; _p10 = p; } } d(self, switches); }