예제 #1
0
        public static NameValueCollection ToNameValueCollection(cef_string_multimap* multimap)
        {
            var result = new NameValueCollection(StringComparer.InvariantCultureIgnoreCase);
            if (multimap == null) return result;

            var size = libcef.string_multimap_size(multimap);

            var n_key = new cef_string_t();
            var n_value = new cef_string_t();
            for (var i = 0; i < size; i++)
            {
                libcef.string_multimap_key(multimap, i, &n_key);
                libcef.string_multimap_value(multimap, i, &n_value);

                result.Add(cef_string_t.ToString(&n_key), cef_string_t.ToString(&n_value));
            }

            libcef.string_clear(&n_key);
            libcef.string_clear(&n_value);

            return result;
        }
예제 #2
0
 public static extern int string_multimap_value(cef_string_multimap* map, int index, cef_string_t* value);
예제 #3
0
 public static extern int string_multimap_size(cef_string_multimap* map);
예제 #4
0
 public static extern int string_multimap_key(cef_string_multimap* map, int index, cef_string_t* key);
예제 #5
0
 public static extern void string_multimap_free(cef_string_multimap* map);
예제 #6
0
 public static extern int string_multimap_find_count(cef_string_multimap* map, cef_string_t* key);
예제 #7
0
 public static extern int string_multimap_enumerate(cef_string_multimap* map, cef_string_t* key, int value_index, cef_string_t* value);
예제 #8
0
 public static extern void string_multimap_clear(cef_string_multimap* map);
예제 #9
0
 public static extern int string_multimap_append(cef_string_multimap* map, cef_string_t* key, cef_string_t* value);
예제 #10
0
 public static void set_header_map(cef_response_t* self, cef_string_multimap* headerMap)
 {
     set_header_map_delegate d;
     var p = self->_set_header_map;
     if (p == _pc) { d = _dc; }
     else
     {
         d = (set_header_map_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_header_map_delegate));
         if (_pc == IntPtr.Zero) { _dc = d; _pc = p; }
     }
     d(self, headerMap);
 }
예제 #11
0
 public static void set(cef_request_t* self, cef_string_t* url, cef_string_t* method, cef_post_data_t* postData, cef_string_multimap* headerMap)
 {
     set_delegate d;
     var p = self->_set;
     if (p == _pc) { d = _dc; }
     else
     {
         d = (set_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_delegate));
         if (_pc == IntPtr.Zero) { _dc = d; _pc = p; }
     }
     d(self, url, method, postData, headerMap);
 }
예제 #12
0
 public static void get_header_map(cef_request_t* self, cef_string_multimap* headerMap)
 {
     get_header_map_delegate d;
     var p = self->_get_header_map;
     if (p == _pa) { d = _da; }
     else
     {
         d = (get_header_map_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_header_map_delegate));
         if (_pa == IntPtr.Zero) { _da = d; _pa = p; }
     }
     d(self, headerMap);
 }