void CCJSONConverter::convertDictionaryToJson(CCDictionary *dictionary, cJSON *json)
{
    CCDictElement * pElement = NULL;
    CCDICT_FOREACH(dictionary, pElement){
        CCObject * obj = pElement->getObject();
        cJSON * jsonItem = getObjJson(obj);
        cJSON_AddItemToObject(json, pElement->getStrKey(), jsonItem);
    }
Example #2
0
void CCJSONConverter::convertDictionaryToJson(__Dictionary *Dictionary, cJSON *json)
{
#if COCOS2D_VERSION >= 0x00030000
    DictElement * pElement = NULL;
#else
    CCDictElement * pElement = NULL;
#endif
    CCDICT_FOREACH(Dictionary, pElement){
        Ref * obj = pElement->getObject();
        cJSON * jsonItem = getObjJson(obj);
        cJSON_AddItemToObject(json, pElement->getStrKey(), jsonItem);
    }