本文整理汇总了C++中environment::raw方法的典型用法代码示例。如果您正苦于以下问题:C++ environment::raw方法的具体用法?C++ environment::raw怎么用?C++ environment::raw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类environment
的用法示例。
在下文中一共展示了environment::raw方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_field
void write_field(environment e, jobject obj, const char* name, T value)
{
std::string descriptor;
jvb::detail::descriptors::descriptor<T>
(e, std::back_inserter(descriptor));
jclass cls = e.raw()->GetObjectClass(obj);
jfieldID fid = e.raw()->GetFieldID(cls, name, descriptor.c_str());
assert(fid != 0);
jvb::detail::set_field(e.raw(), obj, fid, value);
}
示例2: write_static_field
void write_static_field(environment e, jvb::class_ class_, const char* name, T value)
{
std::string descriptor;
jvb::detail::descriptors::descriptor<T>
(e, std::back_inserter(descriptor));
jclass cls = class_.raw();
jfieldID fid = e.raw()->GetStaticFieldID(cls, name, descriptor.c_str());
assert(fid != 0);
jvb::detail::set_static_field(e.raw(), cls, fid, value);
}
示例3: read_static_field
T read_static_field(environment e, jvb::class_ class_, const char* name)
{
std::string descriptor;
jvb::detail::descriptors::descriptor<T>
(e, std::back_inserter(descriptor));
jclass cls = class_.raw();
std::cout << "Searching for " << name << " with descriptor " << descriptor << std::endl;
jfieldID fid = e.raw()->GetStaticFieldID(cls, name, descriptor.c_str());
assert(fid != 0);
return jvb::detail::get_static_field(e.raw(), cls, fid, jvb::detail::tag<T>());
}
示例4: unwrap
inline jstring unwrap(environment e, const char* c)
{
assert(c != 0);
jstring str = e.raw()->NewStringUTF(c);
assert(str != 0);
return str;
}
示例5: find_id
static jmethodID find_id(environment e, Class cls)
{
std::string descriptor;
jvb::detail::descriptors::descriptor_function
<void, typename boost::function_types::parameter_types<F>::type>
(e, std::back_inserter(descriptor));
jmethodID id = e.raw()->GetMethodID(cls.raw(), "<init>", descriptor.c_str());
assert(id != 0);
return id;
}
示例6: find_id
static jmethodID find_id(environment e, jclass cls, const char* name)
{
typedef typename boost::function_types::result_type<F>::type return_type;
typedef typename boost::function_types::parameter_types<F>::type parameter_types;
std::string type;
detail::descriptors::descriptor_function<return_type, parameter_types>
(e, std::back_inserter<std::string>(type));
assert(cls != 0);
jmethodID id = e.raw()->GetStaticMethodID(cls, name, type.c_str());
assert(id != 0);
return id;
}
示例7: set_array_region
static void set_array_region(environment e, jshortArray ar, jint start, jint len
, jshort const* raw_ar)
{
e.raw()->SetShortArrayRegion(ar, start, len, const_cast<jshort*>(raw_ar));
}
示例8: release_array_elements
static void release_array_elements(environment e, jshortArray ar, jshort* raw_ar
, jint mode)
{
e.raw()->ReleaseShortArrayElements(ar, raw_ar, mode);
}
示例9: string
string(environment e, const char* cstring)
{
s = e.raw()->NewStringUTF(cstring);
}
示例10: class_
jvb::class_ class_(environment e) const
{
return e.raw()->GetObjectClass(obj);
}