コード例 #1
0
ファイル: cJSON.cpp プロジェクト: ideasiii/ControllerPlatform
cJSON *cJSON_GetObjectItem(cJSON *object, const char *string)
{
	cJSON *c = object->child;
	while(c && cJSON_strcasecmp(c->string, string))
		c = c->next;
	return c;
}
コード例 #2
0
ファイル: cJSON.cpp プロジェクト: S-V/Lollipop
cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string) {
    int i=0;
    cJSON *c=object->child;
    while (c && cJSON_strcasecmp(c->string,string)) i++,c=c->next;
    if (c) return cJSON_DetachItemFromArray(object,i);
    return 0;
}
コード例 #3
0
ファイル: cJSON.cpp プロジェクト: S-V/Lollipop
void   cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem) {
    int i=0;
    cJSON *c=object->child;
    while(c && cJSON_strcasecmp(c->string,string))i++,c=c->next;
    if(c) {
        newitem->string=cJSON_strdup(string);
        cJSON_ReplaceItemInArray(object,i,newitem);
    }
}
コード例 #4
0
ファイル: cJson.c プロジェクト: Slyer74/esp-ginx
cJSON *ICACHE_FLASH_ATTR cJSON_GetObjectItem(cJSON *object, const char *string)
{
    cJSON *c = object->child;

    while (c && cJSON_strcasecmp(c->string, string)) {
        c = c->next;
    }

    return c;
}
コード例 #5
0
ファイル: cJSON.c プロジェクト: 5ouya/raspC
int cJSON_HasObjectItem(cJSON *object,const char *string)	{
	cJSON *c=object->child;
	while (c )
	{
		if(cJSON_strcasecmp(c->string,string)==0){
			return 1;
		}
	c=c->next;
	}
	return 0;
}
コード例 #6
0
ファイル: cJSON.c プロジェクト: shengang1006/libjson
cJSON *cJSON_GetObjectItemV2(cJSON *object,const char *string,int*pos=NULL){
	int hash_code=BKDRHash(string),i=0;
	cJSON *c=object->child;
	while (c){
		if(c->hash_string==-1){c->hash_string=BKDRHash(c->string);}
		if(c->hash_string==hash_code && !cJSON_strcasecmp(c->string,string)){if(pos)*pos=i;return c;}
		c=c->next;
		i++;
	}
	return c;
}
コード例 #7
0
ファイル: cJson.c プロジェクト: Slyer74/esp-ginx
cJSON *ICACHE_FLASH_ATTR
cJSON_DetachItemFromObject(cJSON *object, const char *string)
{
    int i = 0;
    cJSON *c = object->child;

    while (c && cJSON_strcasecmp(c->string, string)) {
        i++, c = c->next;
    }

    if (c) {
        return cJSON_DetachItemFromArray(object, i);
    }

    return 0;
}
コード例 #8
0
ファイル: cJSON.c プロジェクト: FSMaxB/cJSON
cJSON *cJSON_DetachItemFromObject(cJSON *object, const char *string)
{
    int i = 0;
    cJSON *c = object->child;
    while (c && cJSON_strcasecmp(c->string,string))
    {
        i++;
        c = c->next;
    }
    if (c)
    {
        return cJSON_DetachItemFromArray(object, i);
    }

    return NULL;
}
コード例 #9
0
ファイル: cJSON.c プロジェクト: FSMaxB/cJSON
void cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem)
{
    int i = 0;
    cJSON *c = object->child;
    while(c && cJSON_strcasecmp(c->string, string))
    {
        i++;
        c = c->next;
    }
    if(c)
    {
        /* free the old string if not const */
        if (!(newitem->type & cJSON_StringIsConst) && newitem->string)
        {
             cJSON_free(newitem->string);
        }

        newitem->string = cJSON_strdup(string);
        cJSON_ReplaceItemInArray(object, i, newitem);
    }
}
コード例 #10
0
ファイル: cJSON.c プロジェクト: vinyeah/pa
char *cJSON_GetObjectItemString(cJSON *object,const char *string){cJSON *c=object->child; while (c && cJSON_strcasecmp(c->string,string)) c=c->next; if(!c) return NULL; return c->valuestring;}