#include <cybergarage/typedef.h>
#include <cybergarage/util/clist.h>
#include <cybergarage/util/cstring.h>
Data Structures |
| struct | _CgDictionary |
| | The generic wrapper struct for CyberLinkC's dictionarys. More...
|
Defines |
| #define | cg_dictionary_element_setkey(dirElem, name) cg_string_setvalue(dirElem->key, name) |
| #define | cg_dictionary_element_getkey(dirElem) cg_string_getvalue(dirElem->key) |
| #define | cg_dictionary_element_setvalue(dirElem, val) cg_string_setvalue(dirElem->value, val) |
| #define | cg_dictionary_element_getvalue(dirElem) cg_string_getvalue(dirElem->value) |
| #define | cg_dictionary_element_next(dirElem) (CgDictionaryElement *)cg_list_next((CgList *)dirElem) |
| #define | cg_dictionary_element_remove(dirElem) cg_list_remove((CgList *)dirElem) |
| #define | cg_dictionary_clear(dir) cg_list_clear((CgList *)dir, (CG_LIST_DESTRUCTORFUNC)cg_dictionary_element_delete) |
| #define | cg_dictionary_size(dir) cg_list_size((CgList *)dir) |
| #define | cg_dictionary_gets(dir) (CgDictionaryElement *)cg_list_next((CgList *)dir) |
| #define | cg_dictionary_add(dir, dirElem) cg_list_add((CgList *)dir, (CgList *)dirElem) |
| #define | cg_dictionary_remove(dirElem) cg_list_remove((CgList *)dirElem) |
Typedefs |
| typedef struct _CgDictionary | CgDictionaryElement |
| | The generic wrapper struct for CyberLinkC's dictionarys.
|
| typedef struct _CgDictionary | CgDictionary |
Functions |
| CgDictionaryElement * | cg_dictionary_element_new () |
| BOOL | cg_dictionary_element_delete (CgDictionaryElement *dirElem) |
| CgDictionary * | cg_dictionary_new () |
| void | cg_dictionary_delete (CgDictionary *dir) |
| CgDictionaryElement * | cg_dictionary_get (CgDictionary *dir, char *key) |
| void | cg_dictionary_setvalue (CgDictionary *dir, char *key, char *value) |
| char * | cg_dictionary_getvalue (CgDictionary *dir, char *key) |
Define Documentation
| #define cg_dictionary_add |
( |
|
dir, |
|
|
|
dirElem |
|
) |
| cg_list_add((CgList *)dir, (CgList *)dirElem) |
Add a dictionary into a dictionary list
- Parameters:
-
| dir | The dictionary list in question |
| dirElem | The dictionary to add to the list |
Clear the contents of a dictionary list
- Parameters:
-
| dir | Dictionary list in question |
| #define cg_dictionary_element_getkey |
( |
|
dirElem | ) |
cg_string_getvalue(dirElem->key) |
| #define cg_dictionary_element_getvalue |
( |
|
dirElem | ) |
cg_string_getvalue(dirElem->value) |
| #define cg_dictionary_element_remove |
( |
|
dirElem | ) |
cg_list_remove((CgList *)dirElem) |
| #define cg_dictionary_element_setkey |
( |
|
dirElem, |
|
|
|
name |
|
) |
| cg_string_setvalue(dirElem->key, name) |
Set a key
- Parameters:
-
| dirElem | Dictionary struct |
| name | String to set |
| #define cg_dictionary_element_setvalue |
( |
|
dirElem, |
|
|
|
val |
|
) |
| cg_string_setvalue(dirElem->value, val) |
Set a value
- Parameters:
-
| dirElem | Dictionary struct |
| value | String to set |
Get the first actual item from a dictionary list to use as an iterator
- Parameters:
-
| dir | The dictionary list in question |
| #define cg_dictionary_remove |
( |
|
dirElem | ) |
cg_list_remove((CgList *)dirElem) |
Remove a dictionary from dictionary list
- Parameters:
-
| dirElem | The dictionary to be removed |
| #define cg_dictionary_size |
( |
|
dir | ) |
cg_list_size((CgList *)dir) |
Get the size of a dictionary list
- Parameters:
-
| dir | The dictionary list in question |
Typedef Documentation
The generic wrapper struct for CyberLinkC's dictionarys.
This wrapper has been created to enable 100% code compatibility between different platforms (Linux, Win32 etc..)
Function Documentation
Destroy a dictionary list
- Parameters:
-
| dir | The dictionary list in question |
Destroy a dictionary.
- Parameters:
-
| dirElem | Dictionary to destroy |
Get a element of the specified key
- Parameters:
-
| dir | The dictionary list in question |
| key | Name to search. |
- Returns:
- Element of the specified key.
| char* cg_dictionary_getvalue |
( |
CgDictionary * |
dir, |
|
|
char * |
key |
|
) |
| |
Get a value of the specified key
- Parameters:
-
| dir | The dictionary list in question |
| key | Name to search. |
- Returns:
- Value of the specified key.
Create a new dictionary list
- Returns:
- Dictionary list
| void cg_dictionary_setvalue |
( |
CgDictionary * |
dir, |
|
|
char * |
key, |
|
|
char * |
value |
|
) |
| |
Set a new element into a dictionary
- Parameters:
-
| dir | The dictionary list in question |
| key | Name to set. |
| value | Value to set. |