libvdo
VdoMap Class Reference

A class representing a dictionary mapping keys to values. More...

#include <vdo-map.h>

Detailed Description

A class representing a dictionary mapping keys to values.

A VdoMap object supports getting/settings properties in the form of key/value pairs with values of the following types.

  • boolean
  • byte
  • uint16, uint32, uint64
  • uint32x2, uint32x4
  • int16, int32, int64
  • double
  • doublex4
  • string

The key is always the name of the property as a string. A VdoMap object does not support duplicate keys. NULL or the empty string "" are not valid keys.

A VdoMap supports different operations to test if maps contains a specific key or set of keys, for example:

gboolean contains = FALSE;
contains = vdo_map_contains(map, "key");
contains = vdo_map_contains_va(map, "key1", "key2", "key3", NULL);
const gchar *keys[] = { "key1", "key2", "key3", };
contains = vdo_map_contains_strv(map, keys);

A VdoMap also supports different operations to test two maps, or a subset of two maps for equality, for example:

gboolean equals = FALSE;
equals = vdo_map_equals(map1, map2);
equals = vdo_map_equals_va(map1, map2, "key1", "key2", "key3", NULL);
const gchar *keys[] = { "key1", "key2", "key3", };
equals = vdo_map_equals_strv(map1, map2, keys);

The documentation for this class was generated from the following file: