Pepper_47_C_interfaces
Public Attributes | List of all members
PPB_VarDictionary_1_0 Struct Reference

#include <ppb_var_dictionary.h>

Collaboration diagram for PPB_VarDictionary_1_0:
Collaboration graph

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)
 

Detailed Description

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.

Definition at line 35 of file ppb_var_dictionary.h.

Member Data Documentation

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.

Returns
An empty dictionary var, whose reference count is set to 1 on behalf of the caller.

Definition at line 43 of file ppb_var_dictionary.h.

void(* PPB_VarDictionary_1_0::Delete)(struct PP_Var dict, struct PP_Var key)

Deletes the specified key and its associated value, if the key exists. The reference to the element will be released.

Parameters
[in]dictA dictionary var.
[in]keyA string var.

Definition at line 76 of file ppb_var_dictionary.h.

struct PP_Var(* PPB_VarDictionary_1_0::Get)(struct PP_Var dict, struct PP_Var key)

Gets the value associated with the specified key.

Parameters
[in]dictA dictionary var.
[in]keyA string var.
Returns
The value that is associated with 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.

Definition at line 55 of file ppb_var_dictionary.h.

struct PP_Var(* PPB_VarDictionary_1_0::GetKeys)(struct PP_Var dict)

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).

Parameters
[in]dictA dictionary var.
Returns
An array var which contains all the keys of dict. Its reference count is incremented on behalf of the caller. The elements are string vars. Returns a null var if failed.

Definition at line 98 of file ppb_var_dictionary.h.

PP_Bool(* PPB_VarDictionary_1_0::HasKey)(struct PP_Var dict, struct PP_Var key)

Checks whether a key exists.

Parameters
[in]dictA dictionary var.
[in]keyA string var.
Returns
A PP_Bool indicating whether the key exists.

Definition at line 85 of file ppb_var_dictionary.h.

PP_Bool(* PPB_VarDictionary_1_0::Set)(struct PP_Var dict, struct PP_Var key, struct PP_Var value)

Sets the value associated with the specified key.

Parameters
[in]dictA dictionary var.
[in]keyA 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]valueThe value to set. The dictionary holds a reference to it on success.
Returns
A PP_Bool indicating whether the operation succeeds.

Definition at line 68 of file ppb_var_dictionary.h.


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