libcef.string_multimap.cs 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // This file manually written from cef/include/internal/cef_string_multimap.h
  3. //
  4. namespace Xilium.CefGlue.Interop
  5. {
  6. using System;
  7. using System.Runtime.InteropServices;
  8. using System.Security;
  9. internal static unsafe partial class libcef
  10. {
  11. // Allocate a new string multimap.
  12. [DllImport(DllName, EntryPoint = "cef_string_multimap_alloc", CallingConvention = CEF_CALL)]
  13. public static extern cef_string_multimap* string_multimap_alloc();
  14. // Return the number of elements in the string multimap.
  15. [DllImport(DllName, EntryPoint = "cef_string_multimap_size", CallingConvention = CEF_CALL)]
  16. private static extern UIntPtr string_multimap_size_core(cef_string_multimap* map);
  17. public static int string_multimap_size(cef_string_multimap* map)
  18. {
  19. return checked((int)string_multimap_size_core(map));
  20. }
  21. // Return the number of values with the specified key.
  22. [DllImport(DllName, EntryPoint = "cef_string_multimap_find_count", CallingConvention = CEF_CALL)]
  23. private static extern UIntPtr string_multimap_find_count_core(cef_string_multimap* map, cef_string_t* key);
  24. public static int string_multimap_find_count(cef_string_multimap* map, cef_string_t* key)
  25. {
  26. return checked((int)string_multimap_find_count_core(map, key));
  27. }
  28. // Return the value_index-th value with the specified key.
  29. [DllImport(DllName, EntryPoint = "cef_string_multimap_enumerate", CallingConvention = CEF_CALL)]
  30. private static extern int string_multimap_enumerate_core(cef_string_multimap* map, cef_string_t* key, UIntPtr value_index, cef_string_t* value);
  31. public static int string_multimap_enumerate(cef_string_multimap* map, cef_string_t* key, int value_index, cef_string_t* value)
  32. {
  33. return string_multimap_enumerate_core(map, key, checked((UIntPtr)value_index), value);
  34. }
  35. // Return the key at the specified zero-based string multimap index.
  36. [DllImport(DllName, EntryPoint = "cef_string_multimap_key", CallingConvention = CEF_CALL)]
  37. private static extern int string_multimap_key_core(cef_string_multimap* map, UIntPtr index, cef_string_t* key);
  38. public static int string_multimap_key(cef_string_multimap* map, int index, cef_string_t* key)
  39. {
  40. return string_multimap_key_core(map, checked((UIntPtr)index), key);
  41. }
  42. // Return the value at the specified zero-based string multimap index.
  43. [DllImport(DllName, EntryPoint = "cef_string_multimap_value", CallingConvention = CEF_CALL)]
  44. private static extern int string_multimap_value_core(cef_string_multimap* map, UIntPtr index, cef_string_t* value);
  45. public static int string_multimap_value(cef_string_multimap* map, int index, cef_string_t* value)
  46. {
  47. return string_multimap_value_core(map, checked((UIntPtr)index), value);
  48. }
  49. // Append a new key/value pair at the end of the string multimap.
  50. [DllImport(DllName, EntryPoint = "cef_string_multimap_append", CallingConvention = CEF_CALL)]
  51. public static extern int string_multimap_append(cef_string_multimap* map, cef_string_t* key, cef_string_t* value);
  52. // Clear the string multimap.
  53. [DllImport(DllName, EntryPoint = "cef_string_multimap_clear", CallingConvention = CEF_CALL)]
  54. public static extern void string_multimap_clear(cef_string_multimap* map);
  55. // Free the string multimap.
  56. [DllImport(DllName, EntryPoint = "cef_string_multimap_free", CallingConvention = CEF_CALL)]
  57. public static extern void string_multimap_free(cef_string_multimap* map);
  58. }
  59. }