Kiwi Engine
VM for interpreter
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Macros | Functions
KEDictionary.h File Reference

Dictionary of KEValue objects. More...

#include <Coconut/Coconut.h>
#include "KEObject.h"
#include "KEForwarders.h"

Go to the source code of this file.

Data Structures

struct  KEDictionary
 Dictionary class. The key is CNString and the value is KEValue. More...
 

Macros

#define KESizeOfDictionaryHashTable   64
 

Functions

struct KEDictionaryKEAllocateDictionary (struct CNResource *resource)
 Allocate dictionary. More...
 
void KESetValueToDictionary (struct KEDictionary *dst, struct CNString *key, struct KEValue *val)
 Set value to dictionary. More...
 
struct KEValueKEValueInDictionary (struct KEDictionary *src, struct CNString *key)
 Get value in the dictionary by the key. More...
 
struct CNObjectList KEKeysInDictionary (struct KEDictionary *src, struct CNResource *resource)
 Get string keys from dictionary. More...
 
void KEDumpDictionary (struct CNText *outbuf, struct KEDictionary *src)
 Dump all elements in value dictionary. More...
 

Detailed Description

Dictionary of KEValue objects.

Copyright
Copyright (C) 2013 Steel Wheels Project

Macro Definition Documentation

#define KESizeOfDictionaryHashTable   64

The size of hash table in the KEDictionary

Function Documentation

struct KEDictionary* KEAllocateDictionary ( struct CNResource *  resource)

Allocate dictionary.

Returns
Allocated dictionary
Parameters
resourceResource to allocate the dictionary
void KEDumpDictionary ( struct CNText *  outbuf,
struct KEDictionary src 
)

Dump all elements in value dictionary.

Parameters
outbufOutput buffer
srcSource value array
struct CNObjectList KEKeysInDictionary ( struct KEDictionary src,
struct CNResource *  resource 
)

Get string keys from dictionary.

Returns
List of CNString objects
Parameters
srcSource dictionary
resourceResource to allocate the list
void KESetValueToDictionary ( struct KEDictionary dst,
struct CNString *  key,
struct KEValue val 
)

Set value to dictionary.

Parameters
dstDestination dictionary
keyKey of the source data
valValue of the source data
struct KEValue* KEValueInDictionary ( struct KEDictionary src,
struct CNString *  key 
)

Get value in the dictionary by the key.

Return values
valValue which has the key
NULLThere are no value with given key
Parameters
srcSource dictionary to be searched
keyKey to search the value