#include <string.h>
#include "native/jni.hpp"
-#include "native/llni.h"
#include "native/native.hpp"
#if defined(ENABLE_JNI_HEADERS)
{
java_lang_String jls(_this);
- java_handle_chararray_t* value = jls.get_value();
+ CharArray value(jls.get_value());
+
int32_t offset = jls.get_offset();
int32_t count = jls.get_count();
int32_t hash = 0;
for (int32_t i = 0; i < count; i++) {
- hash = (31 * hash) + LLNI_array_direct(value, offset + i);
+ hash = (31 * hash) + value.get_element(offset + i);
}
return hash;
{
java_lang_String jls(_this);
- java_handle_chararray_t* value = jls.get_value();
+ CharArray value(jls.get_value());
+
int32_t offset = jls.get_offset();
int32_t count = jls.get_count();
for (int32_t i = 0; i < count; i++) {
- if (LLNI_array_direct(value, offset + i) == ch) {
+ if (value.get_element(offset + i) == ch) {
return i;
}
}
{
java_lang_String jls(_this);
- java_handle_chararray_t* value = jls.get_value();
+ CharArray value(jls.get_value());
+
int32_t offset = jls.get_offset();
int32_t count = jls.get_count();
}
for (int32_t i = fromIndex ; i < count ; i++) {
- if (LLNI_array_direct(value, offset + i) == ch) {
+ if (value.get_element(offset + i) == ch) {
return i;
}
}
{
java_lang_String jls(_this);
- java_handle_chararray_t* value = jls.get_value();
+ CharArray value(jls.get_value());
+
int32_t offset = jls.get_offset();
int32_t count = jls.get_count();
int32_t start = ((fromIndex >= count) ? count - 1 : fromIndex);
for (int32_t i = start; i >= 0; i--) {
- if (LLNI_array_direct(value, offset + i) == ch) {
+ if (value.get_element(offset + i) == ch) {
return i;
}
}