Sha256: 297d834c6411a012f1c83128b9b63c93e9ed5f0a285e66c41db0afacea9c7b68

Contents?: true

Size: 1.83 KB

Versions: 17

Compression:

Stored size: 1.83 KB

Contents

#ifndef JNIRHOJS_H_INCLUDED
#define JNIRHOJS_H_INCLUDED

#include "json/JSONIterator.h"
#include "rhodes.h"

template <>
struct ArgumentsAdapter<rho::json::CJSONArray>
{
    typedef rho::json::CJSONEntry value_type;
    typedef rho::json::CJSONArray container_type;
    typedef int size_type;
    const container_type& m_args;
    ArgumentsAdapter(const container_type& args) : m_args(args) {}
    ArgumentsAdapter(const ArgumentsAdapter& adapter) : m_args(adapter.m_args) {}
    value_type operator[] (size_type n) const { return const_cast<container_type&>(m_args)[n]; }
    size_type size() const { return const_cast<container_type&>(m_args).getSize(); }
};

template <>
struct PropertyMapConvertor<rho::json::CJSONEntry>: public details::RhoJniConvertor
{
    jobject convertToPropertyMap(JNIEnv *env, const rho::json::CJSONEntry& entry);
};


namespace details
{

using rho::json::CJSONEntry;

template <>
struct rho_cast_helper<jstring, CJSONEntry>
{
    jstring operator()(JNIEnv *env, const CJSONEntry& jsonEntry);
};

template <>
struct rho_cast_helper<jobject, CJSONEntry>: public RhoJniConvertor
{
    jobject operator()(JNIEnv *env, const CJSONEntry& jsonEntry);
    jobject convertJsonEntryToJavaCollection(const CJSONEntry& entry);
    jobject convertJsonEntryToJavaMap(const CJSONEntry& entry);
};

template <>
struct rho_cast_helper<jobjectArray, CJSONEntry>: public RhoJniConvertor
{
    jobjectArray operator()(JNIEnv *env, const CJSONEntry& entry);
};

template <>
struct rho_cast_helper<jboolean, CJSONEntry>
{
    jboolean operator()(JNIEnv *env, const CJSONEntry& entry);
};

template <>
struct rho_cast_helper<jint, CJSONEntry>
{
    jint operator()(JNIEnv *env, const CJSONEntry& entry);
};

template <>
struct rho_cast_helper<jdouble, CJSONEntry>
{
    jdouble operator()(JNIEnv *env, const CJSONEntry& entry);
};

}
#endif // JNIRHORUBY_H_INCLUDED

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
rhodes-7.6.0 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-7.5.1 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-7.4.1 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-7.1.17 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-6.2.0 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-6.0.11 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-5.5.18 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-5.5.17 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-5.5.15 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-5.5.0.22 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-5.5.2 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-5.5.0.7 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-5.5.0.3 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
rhodes-5.5.0 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
tauplatform-1.0.3 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
tauplatform-1.0.2 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h
tauplatform-1.0.1 platform/android/Rhodes/jni/include/rhodes/JNIRhoJS.h