Sha256: 8c3384bafbec588568d21174ac1361a98b68c3287b6a2eb9877b148da76efc42

Contents?: true

Size: 1.79 KB

Versions: 32

Compression:

Stored size: 1.79 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(const CJSONEntry& oCopy);
    CJSONEntry() : m_rootObject(null){}
    ~CJSONEntry();

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

    int getInt(const char* name);
    uint64 getUInt64(const char* name);
    double getDouble(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

32 entries across 32 versions & 1 rubygems

Version Path
rhodes-3.0.2 platform/shared/json/JSONIterator.h
rhodes-3.0.2.beta.1 platform/shared/json/JSONIterator.h
rhodes-3.0.1 platform/shared/json/JSONIterator.h
rhodes-3.0.1.beta.8 platform/shared/json/JSONIterator.h
rhodes-3.0.1.beta.7 platform/shared/json/JSONIterator.h
rhodes-3.0.1.beta.6 platform/shared/json/JSONIterator.h
rhodes-3.0.1.beta.5 platform/shared/json/JSONIterator.h
rhodes-3.0.1.beta.4 platform/shared/json/JSONIterator.h
rhodes-3.0.1.beta.3 platform/shared/json/JSONIterator.h
rhodes-3.0.1.beta.2 platform/shared/json/JSONIterator.h
rhodes-3.0.0 platform/shared/json/JSONIterator.h
rhodes-3.0.0.beta.7 platform/shared/json/JSONIterator.h
rhodes-3.0.0.beta.6 platform/shared/json/JSONIterator.h
rhodes-3.0.0.beta.5 platform/shared/json/JSONIterator.h
rhodes-3.0.0.beta.4 platform/shared/json/JSONIterator.h
rhodes-3.0.0.beta.3 platform/shared/json/JSONIterator.h
rhodes-3.0.0.beta.2 platform/shared/json/JSONIterator.h
rhodes-3.0.0.beta.1 platform/shared/json/JSONIterator.h
rhodes-2.4.1 platform/shared/json/JSONIterator.h
rhodes-2.4.1.beta.1 platform/shared/json/JSONIterator.h