Sha256: 1fce414b5c17908568d02d6d0d686dfb415ddaffcc7901e13cbc201859e0febd

Contents?: true

Size: 1.71 KB

Versions: 23

Compression:

Stored size: 1.71 KB

Contents

#pragma once

#include "common/RhoStd.h"

struct json_object;
struct array_list;
struct lh_entry;
struct lh_table;

namespace rho {
namespace json {

class CJSONEntry
{
    struct json_object* m_rootObject;
    struct json_object* m_object;
public:
    CJSONEntry(struct json_object * obj);
    CJSONEntry(const char* szData);
    CJSONEntry() : m_rootObject(null){}
    ~CJSONEntry();

    boolean isEmpty();
	boolean hasName(String name);

    int getInt(const char* name);
    uint64 getUInt64(const char* name);
    const char* getString(const char* name);
    const char* getString();

    CJSONEntry getEntry(const char* name)const;

    struct json_object* getObject()const{ return m_object; }

    static String quoteValue(const String& strValue);
};

class CJSONArrayIterator
{
    struct json_object* m_rootObject;
    struct array_list*  m_array;
    int                 m_nCurItem;

public:
    CJSONArrayIterator(const char* szData);
	CJSONArrayIterator(const CJSONEntry& oEntry, const char* strName);
    CJSONArrayIterator(const CJSONEntry& oEntry);
    ~CJSONArrayIterator(void);

    boolean isEnd();
    void    next();
    void    reset(int nPos);
    int     getCurPos(){ return m_nCurItem; }

    CJSONEntry getCurItem();
};

class CJSONStructIterator
{
    struct json_object* m_rootObject;
    struct lh_table*    m_struct;
    struct lh_entry*    m_curEntry;
public:
    CJSONStructIterator(const char* szData);
	CJSONStructIterator(const CJSONEntry& oEntry, const char* strName);
    CJSONStructIterator(const CJSONEntry& oEntry);
    ~CJSONStructIterator(void);

    boolean isEnd();
    void    next();
    void    reset();

    String     getCurKey();
    CJSONEntry getCurValue();
    String     getCurString();
    
};

}
}

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rhodes-2.2.3 platform/shared/json/JSONIterator.h
rhodes-2.2.3.beta.1 platform/shared/json/JSONIterator.h
rhodes-2.2.2 platform/shared/json/JSONIterator.h
rhodes-2.2.2.beta.1 platform/shared/json/JSONIterator.h
rhodes-2.2.1 platform/shared/json/JSONIterator.h
rhodes-2.2.1.beta.2 platform/shared/json/JSONIterator.h
rhodes-2.2.1.beta.1 platform/shared/json/JSONIterator.h
rhodes-2.2.0 platform/shared/json/JSONIterator.h
rhodes-2.2.0.beta.3 platform/shared/json/JSONIterator.h
rhodes-2.2.0.beta.2 platform/shared/json/JSONIterator.h
rhodes-2.2.0.beta.1 platform/shared/json/JSONIterator.h
rhodes-2.1.0 platform/shared/json/JSONIterator.h
rhodes-2.0.3 platform/shared/json/JSONIterator.h
rhodes-2.0.2 platform/shared/json/JSONIterator.h
rhodes-2.0.0 platform/shared/json/JSONIterator.h
rhodes-2.0.0.rc2 platform/shared/json/JSONIterator.h
rhodes-2.0.0.rc1 platform/shared/json/JSONIterator.h
rhodes-2.0.0.beta11 platform/shared/json/JSONIterator.h
rhodes-2.0.0.beta10 platform/shared/json/JSONIterator.h
rhodes-2.0.0.beta9 platform/shared/json/JSONIterator.h