Pepper_56_C_interfaces
Pepper_56_C_interfaces
|
#include <ppb_var_dictionary.h>
Public Attributes | |
struct PP_Var(* | Create )(void) |
struct PP_Var(* | Get )(struct PP_Var dict, struct PP_Var key) |
PP_Bool(* | Set )(struct PP_Var dict, struct PP_Var key, struct PP_Var value) |
void(* | Delete )(struct PP_Var dict, struct PP_Var key) |
PP_Bool(* | HasKey )(struct PP_Var dict, struct PP_Var key) |
struct PP_Var(* | GetKeys )(struct PP_Var dict) |
A dictionary var contains key-value pairs with unique keys. The keys are strings while the values can be arbitrary vars. Key comparison is always done by value instead of by reference.
struct PP_Var(* PPB_VarDictionary_1_0::Create)(void) |
Creates a dictionary var, i.e., a PP_Var
with type set to PP_VARTYPE_DICTIONARY
.
Deletes the specified key and its associated value, if the key exists. The reference to the element will be released.
[in] | dict | A dictionary var. |
[in] | key | A string var. |
Gets the value associated with the specified key.
[in] | dict | A dictionary var. |
[in] | key | A string var. |
key
. The reference count of the element returned is incremented on behalf of the caller. If key
is not a string var, or it doesn't exist in dict
, an undefined var is returned. Gets all the keys in a dictionary. Please note that for each key that you set into the dictionary, a string var with the same contents is returned; but it may not be the same string var (i.e., value.as_id
may be different).
[in] | dict | A dictionary var. |
dict
. Its reference count is incremented on behalf of the caller. The elements are string vars. Returns a null var if failed. Checks whether a key exists.
[in] | dict | A dictionary var. |
[in] | key | A string var. |
PP_Bool
indicating whether the key exists. Sets the value associated with the specified key.
[in] | dict | A dictionary var. |
[in] | key | A string var. If this key hasn't existed in dict , it is added and associated with value ; otherwise, the previous value is replaced with value . |
[in] | value | The value to set. The dictionary holds a reference to it on success. |
PP_Bool
indicating whether the operation succeeds.